Skip to content

Commit

Permalink
Merge pull request #417 from Studio-Yandex-Practicum/enhancemant_414_…
Browse files Browse the repository at this point in the history
…header_routes

Добавил недостающие руты в меню О нас в хедер
  • Loading branch information
kirill-k88 authored Jun 13, 2024
2 parents 8630550 + c59b9e1 commit 776d34d
Show file tree
Hide file tree
Showing 37 changed files with 319 additions and 86 deletions.
13 changes: 10 additions & 3 deletions src/app/router/AppRouter/ui/AppRouter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,13 @@ import HelpPage from '@/pages/HelpPage/HelpPage'
import LoginPage from '@/pages/LoginPage/LoginPage'
import { LogoutPage } from '@/pages/LogoutPage/LogoutPage'
import MainPage from '@/pages/MainPage/MainPage'
import { PrivacyPage } from '@/pages/PrivacyPage/PrivacyPage'
import { ProductPage } from '@/pages/ProductPage/ProductPage'
import { ProductsPage } from '@/pages/ProductsPage/ProductsPage'
import { ReviewsPage } from '@/pages/ReviewsPage/ReviewsPage'
import RootPage from '@/pages/RootPage/RootPage'
import SearchResultsPage from '@/pages/SearchResultsPage/SearchResultsPage'
import { TermsPage } from '@/pages/TermsPage/TermsPage'
import VouchersPage from '@/pages/VouchersPage/VouchersPage'
import { Routes } from '@/shared/config/routerConfig/routes'

Expand Down Expand Up @@ -82,7 +85,7 @@ export const AppRouter = createBrowserRouter([
},
{
path: Routes.PRIVACY,
element: <ProductsPage /> // временная заглушка нужна страница с политикой безопасности
element: <PrivacyPage />
},
{
path: Routes.PRODUCTS,
Expand All @@ -93,9 +96,13 @@ export const AppRouter = createBrowserRouter([
element: <ProductsPage />
},
{
path: Routes.REVIEWS + '/:index',
path: Routes.FEEDBACKS + '/:index',
element: <FeedbackPage />
},
{
path: Routes.REVIEWS,
element: <ReviewsPage />
},
{
path: Routes.SEARCH,
element: <SearchResultsPage />
Expand All @@ -106,7 +113,7 @@ export const AppRouter = createBrowserRouter([
},
{
path: Routes.TERMS,
element: <ProductsPage /> // временная заглушка нужна страница с условиями соглашения
element: <TermsPage />
},
{
path: Routes.ADD_RETURN,
Expand Down
2 changes: 1 addition & 1 deletion src/components/BlogMain/BlogMain.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ import { FC, useState } from 'react'
import type { PropsBlog } from '@/models/PropsBlog'
import Heading from '@/shared/ui/Heading/Heading'
import Subheading from '@/shared/ui/Subheading/Subheading'
import WrapperForMainContent from '@/shared/ui/WrapperForMainContent/WrapperForMainContent'

import BlogCategories from '../BlogCategories/BlogCategories'
import BlogItemForContainer from '../BlogItemForContainer/BlogItemForContainer'
import BlogMainItem from '../BlogMainItem/BlogMainItem'
import BlogTags from '../BlogTags/BlogTags'
import { Pagination } from '../Pagination/Pagination'
import WrapperForMainContent from '../WrapperForMainContent/WrapperForMainContent'

import styles from './blog-main.module.scss'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export const ReviewCardFeedback: FC<IReviewCardFeedbackProps> = ({ pk, text, sco
<Paragraph className={styles.reviewCardFeedback__review}>{text}</Paragraph>

<Subheading>{newDate}</Subheading>
<Link to={`${Routes.REVIEWS}/${index}`} className={styles.reviewCardFeedback__link}>
<Link to={`${Routes.FEEDBACKS}/${index}`} className={styles.reviewCardFeedback__link}>
Читать полный отзыв
</Link>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export const ReviewCardStore: FC<IReviewCardStoreProps> = ({ score }) => {
<Paragraph className={styles.paragraph}>{FEEDBACK_STORE_COMMENT}</Paragraph>
<Paragraph className={styles.paragraph}>
Вы можете&nbsp;
<Link to={`${Routes.REVIEWS}/0`} className={styles.link}>
<Link to={`${Routes.FEEDBACKS}/0`} className={styles.link}>
оставить отзыв
</Link>
&nbsp; о нашем магазине или&nbsp;
Expand Down
2 changes: 1 addition & 1 deletion src/mockData/headerMenuData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export const headerMenuData = [
},
{
title: 'Отзывы о магазине',
link: Routes.REVIEWS
link: Routes.FEEDBACKS
},
{
title: 'Контакты',
Expand Down
2 changes: 1 addition & 1 deletion src/pages/AboutUsPage/AboutUsPage.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { useEffect } from 'react'
import { useSelector } from 'react-redux'

import WrapperForMainContent from '@/components/WrapperForMainContent/WrapperForMainContent'
import AboutUs from '@/entities/AboutUs'
import { useAppDispatch } from '@/shared/libs/hooks/store'
import Breadcrumbs from '@/shared/ui/Breadcrumbs/Breadcrumbs'
import Heading, { HeadingType } from '@/shared/ui/Heading/Heading'
import WrapperForMainContent from '@/shared/ui/WrapperForMainContent/WrapperForMainContent'

import styles from './AboutUsPage.module.scss'
import { getAboutUsSelector } from './model/selectors/selectors'
Expand Down
2 changes: 1 addition & 1 deletion src/pages/AccountPage/AccountPage.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { type FC, Suspense, useState } from 'react'

import WrapperForMainContent from '@/components/WrapperForMainContent/WrapperForMainContent'
import SideBarMenuModal from '@/features/SideBarMenuModal'
import { useResize } from '@/shared/libs/hooks/useResize'
import Breadcrumbs from '@/shared/ui/Breadcrumbs/Breadcrumbs'
import Heading from '@/shared/ui/Heading/Heading'
import Modal from '@/shared/ui/Modal/Modal'
import Spinner from '@/shared/ui/Spinner/Spinner'
import WrapperForMainContent from '@/shared/ui/WrapperForMainContent/WrapperForMainContent'
import { AccountCart } from '@/widgets/AccountCart/AccountCart'
import { AccountMenu } from '@/widgets/AccountMenu/AccountMenu'
import { AccountSubscribe } from '@/widgets/AccountSubscribe/AccountSubscribe'
Expand Down
2 changes: 1 addition & 1 deletion src/pages/BlogPage/BlogPage.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import BlogMain from '@/components/BlogMain/BlogMain'
import WrapperForMainContent from '@/components/WrapperForMainContent/WrapperForMainContent'
import { blogPageData } from '@/mockData/blogPageData'
import { TEXT_BLOG, LINK_SHOW_ALL } from '@/shared/constants/constants'
import WrapperForMainContent from '@/shared/ui/WrapperForMainContent/WrapperForMainContent'

const BlogPage = () => {
return (
Expand Down
2 changes: 1 addition & 1 deletion src/pages/CartPage/CartPage.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { useSelector } from 'react-redux'
import { Link } from 'react-router-dom'

import WrapperForMainContent from '@/components/WrapperForMainContent/WrapperForMainContent'
import { getCartSelector } from '@/entities/CartEntity/model/selectors/selectors'
import type { ICartEntity } from '@/entities/CartEntity/model/types/types'
import { CartCouponApply } from '@/features/CartCouponApply/ui/CartCouponApply/CartCouponApply'
import { CartEdit } from '@/features/CartEdit/ui/CartEdit/CartEdit'
import Heading, { HeadingType } from '@/shared/ui/Heading/Heading'
import Subheading from '@/shared/ui/Subheading/Subheading'
import WrapperForMainContent from '@/shared/ui/WrapperForMainContent/WrapperForMainContent'
import { MakeOrder } from '@/widgets/MakeOrder/ui/MakeOrder/MakeOrder'

import styles from './CartPage.module.scss'
Expand Down
2 changes: 1 addition & 1 deletion src/pages/ComparePage/ComparePage.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import WrapperForMainContent from '@/components/WrapperForMainContent/WrapperForMainContent'
import Heading from '@/shared/ui/Heading/Heading'
import Subheading from '@/shared/ui/Subheading/Subheading'
import WrapperForMainContent from '@/shared/ui/WrapperForMainContent/WrapperForMainContent'

import styles from './ComparePage.module.scss'

Expand Down
140 changes: 86 additions & 54 deletions src/pages/ContactsPage/ContactsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import YMap from '@/assets/icons/YMap.svg'
import FormQuestion from '@/features/FormQuestion/ui/FormQuestion'
import Breadcrumbs from '@/shared/ui/Breadcrumbs/Breadcrumbs'
import Heading, { HeadingType } from '@/shared/ui/Heading/Heading'
import Paragraph from '@/shared/ui/Paragraph/Paragraph'
import WrapperForMainContent from '@/shared/ui/WrapperForMainContent/WrapperForMainContent'
import Map from '@/widgets/Map/Map'

import styles from './ContactsPage.module.scss'
Expand All @@ -16,69 +18,99 @@ const links = [

const ContactsPage: FC = () => {
return (
<section className={styles.contacts}>
<div className={styles.contacts__titleBox}>
<Heading type={HeadingType.MAIN}>Контакты</Heading>
<Breadcrumbs links={links} />
</div>
<Map />
<div className={styles.contacts__info}>
<div className={styles.contacts__block}>
<Heading type={HeadingType.SMALL}>Основной магазин</Heading>
<ul>
<li className={styles.contacts__text}>Телефон</li>
<li>+7 977 848-02-28</li>
<li>Будни, с 10.00 до 20.00</li>
</ul>
<ul>
<li className={styles.contacts__text}>Электронная почта</li>
<Link to="mailto:Maxboomofficial@yandex.ru" className={styles.contacts__mall}>
Maxboomofficial@yandex.ru
</Link>
</ul>
<ul>
<li className={styles.contacts__text}>Адрес магазина</li>
<YMap />
<Link
target="_blank"
to="https://yandex.ru/maps/22/kaliningrad/?ll=20.499113%2C54.718681&pt=20.499113%2C54.718681&z=17"
className={styles.contacts__city}>
г. Москва
</Link>
</ul>
<WrapperForMainContent>
<section className={styles.contacts}>
<div className={styles.contacts__titleBox}>
<Heading type={HeadingType.MAIN}>Контакты</Heading>
<Breadcrumbs links={links} />
</div>
<div className={styles.contacts__block}>
<Heading type={HeadingType.SMALL}>Наши реквизиты</Heading>
<div>
<p>Банковские и юридические реквизиты</p>
</div>
<ul>
<li className={styles.contacts__text}>Наименование</li>
<li>Maxboom.ru</li>
</ul>
</div>
<div className={styles.contacts__blockAdress}>
<div className={styles.contacts__adress}>
<Map />
<div className={styles.contacts__info}>
<div className={styles.contacts__block}>
<Heading type={HeadingType.SMALL}>Основной магазин</Heading>
<ul>
<li className={styles.contacts__text}>
<Paragraph className={styles.contacts__text}>Телефон</Paragraph>
</li>
<li>
<Link to="tel:+79778480228">+7 977 848-02-28</Link>
</li>
<li>
<Paragraph>Будни, с 10.00 до 20.00</Paragraph>
</li>
</ul>
<ul>
<li className={styles.contacts__text}>ОГРН</li>
<li>123456789</li>
<li className={styles.contacts__text}>
<Paragraph className={styles.contacts__text}>Электронная почта</Paragraph>
</li>
<Link to="mailto:Maxboomofficial@yandex.ru" className={styles.contacts__mall}>
Maxboomofficial@yandex.ru
</Link>
</ul>
<ul>
<li className={styles.contacts__text}>Адрес</li>
<li>104329, Москва г, Талалихина</li>
<li>ул, дом № 1, корпус 3, оф.8</li>
<li>
<Paragraph className={styles.contacts__text}>Адрес магазина</Paragraph>{' '}
</li>
<YMap />
<Link
target="_blank"
to="https://yandex.ru/maps/22/kaliningrad/?ll=20.499113%2C54.718681&pt=20.499113%2C54.718681&z=17"
className={styles.contacts__city}>
г. Москва
</Link>
</ul>
</div>
<div>
<ul className={styles.contacts__adressPhone}>
<li className={styles.contacts__text}>Телефон</li>
<li>+7 977 848-02-28</li>
<div className={styles.contacts__block}>
<Heading type={HeadingType.SMALL}>Наши реквизиты</Heading>
<div>
<Paragraph>Банковские и юридические реквизиты</Paragraph>
</div>
<ul>
<li>
<Paragraph className={styles.contacts__text}>Наименование</Paragraph>
</li>
<li>
<Paragraph>Maxboom.ru</Paragraph>
</li>
</ul>
</div>
<div className={styles.contacts__blockAdress}>
<div className={styles.contacts__adress}>
<ul>
<li>
<Paragraph className={styles.contacts__text}>ОГРН</Paragraph>
</li>
<li>
<Paragraph>123456789</Paragraph>
</li>
</ul>
<ul>
<li className={styles.contacts__text}>
<Paragraph className={styles.contacts__text}>Адрес</Paragraph>
</li>
<li>
<Paragraph>
{`104329, Москва г, Талалихина
ул, дом № 1, корпус 3, оф.8`}
</Paragraph>
</li>
</ul>
</div>
<div>
<ul className={styles.contacts__adressPhone}>
<li>
<Paragraph className={styles.contacts__text}>Телефон</Paragraph>
</li>
<li>
<Link to="tel:+79778480228">+7 977 848-02-28</Link>
</li>
</ul>
</div>
</div>
<FormQuestion />
</div>
<FormQuestion />
</div>
</section>
</section>
</WrapperForMainContent>
)
}

Expand Down
2 changes: 1 addition & 1 deletion src/pages/DeliveryPage/DeliveryPage.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import WrapperForMainContent from '@/components/WrapperForMainContent/WrapperForMainContent'
import Breadcrumbs from '@/shared/ui/Breadcrumbs/Breadcrumbs'
import Heading, { HeadingType } from '@/shared/ui/Heading/Heading'
import WrapperForMainContent from '@/shared/ui/WrapperForMainContent/WrapperForMainContent'

import styles from './DeliveryPage.module.scss'

Expand Down
2 changes: 1 addition & 1 deletion src/pages/ErrorPage/ErrorPage.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { FC } from 'react'

import image from '@/assets/images/errorPage/img-page-not-found.webp'
import WrapperForMainContent from '@/components/WrapperForMainContent/WrapperForMainContent'
import { Routes } from '@/shared/config/routerConfig/routes'
import Heading, { HeadingType } from '@/shared/ui/Heading/Heading'
import Link from '@/shared/ui/Link/Link'
import Paragraph from '@/shared/ui/Paragraph/Paragraph'
import WrapperForMainContent from '@/shared/ui/WrapperForMainContent/WrapperForMainContent'

import styles from './ErrorPage.module.scss'

Expand Down
2 changes: 1 addition & 1 deletion src/pages/FavoritesPage/FavoritesPage.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { FC, Suspense, useState } from 'react'

import WrapperForMainContent from '@/components/WrapperForMainContent/WrapperForMainContent'
import { useFavorite } from '@/entities/Favorite/model/hooks/useFavorite'
import SideBarMenuModal from '@/features/SideBarMenuModal'
import { Routes } from '@/shared/config/routerConfig/routes'
Expand All @@ -10,6 +9,7 @@ import Breadcrumbs from '@/shared/ui/Breadcrumbs/Breadcrumbs'
import Heading from '@/shared/ui/Heading/Heading'
import Modal from '@/shared/ui/Modal/Modal'
import Spinner from '@/shared/ui/Spinner/Spinner'
import WrapperForMainContent from '@/shared/ui/WrapperForMainContent/WrapperForMainContent'
import { ProductsList } from '@/widgets/ProductsList/ProductsList'
import { withAdaptiveSideBar } from '@/widgets/SideBarMenu'

Expand Down
7 changes: 5 additions & 2 deletions src/pages/FeedbackPage/FeedbackPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,19 @@ import { useSelector } from 'react-redux'
import { useParams } from 'react-router'

import { StateSchema } from '@/app/providers/StoreProvider'
import WrapperForMainContent from '@/components/WrapperForMainContent/WrapperForMainContent'
import {
getAverageMark,
getFirstFeedbacks,
getNextFeedbacks
} from '@/features/Reviews/model/slice/feedbacksSlice'
import { bodyScrollControl } from '@/shared/libs/helpers/popupHelper'
import { scrollPageToTop } from '@/shared/libs/helpers/scrollPageToTop'
import { useAppDispatch } from '@/shared/libs/hooks/store'
import { useResize } from '@/shared/libs/hooks/useResize'
import Breadcrumbs from '@/shared/ui/Breadcrumbs/Breadcrumbs'
import { Button, ButtonSize, ButtonTheme } from '@/shared/ui/Button/Button'
import Heading from '@/shared/ui/Heading/Heading'
import WrapperForMainContent from '@/shared/ui/WrapperForMainContent/WrapperForMainContent'
import { AveregeMark } from '@/widgets/AveregeMark/AveregeMark'
import { FeedbackForm } from '@/widgets/FeedbackForm/FeedbackForm'
import { FeedbackList } from '@/widgets/FeedbackList/FeedbackList'
Expand Down Expand Up @@ -42,6 +43,8 @@ export const FeedbackPage = () => {
dispatch(getFirstFeedbacks())

dispatch(getAverageMark())

scrollPageToTop()
}, [])

const fetchNextPage = () => {
Expand All @@ -63,7 +66,7 @@ export const FeedbackPage = () => {
</div>
<div className={styles.feedbackpage__container}>
<FeedbackList
targetId={(index && +index) || 0}
targetId={index ? +index : undefined}
feedbacks={feedback.feedbacks}
isLoading={feedback.isLoading}
nextPage={feedback.next}
Expand Down
2 changes: 1 addition & 1 deletion src/pages/FormReturnPage/FormReturnPage.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { FC, Suspense, lazy, useState } from 'react'

import WrapperForMainContent from '@/components/WrapperForMainContent/WrapperForMainContent'
import { Routes } from '@/shared/config/routerConfig/routes'
import { useResize } from '@/shared/libs/hooks/useResize'
import Breadcrumbs from '@/shared/ui/Breadcrumbs/Breadcrumbs'
import Heading, { HeadingType } from '@/shared/ui/Heading/Heading'
import Modal from '@/shared/ui/Modal/Modal'
import Spinner from '@/shared/ui/Spinner/Spinner'
import WrapperForMainContent from '@/shared/ui/WrapperForMainContent/WrapperForMainContent'
import FormReturn from '@/widgets/FormReturn'
import { withAdaptiveSideBar } from '@/widgets/SideBarMenu'

Expand Down
Loading

0 comments on commit 776d34d

Please sign in to comment.