Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enhancement_313_bread_crumbs_at_pages #326

Merged
merged 1 commit into from
Apr 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/app/router/AppRouter/ui/AppRouter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import CartPage from '@/pages/CartPage/CartPage'
import { CategoryPage } from '@/pages/CategoryPage/CategoryPage'
import ComparePage from '@/pages/ComparePage/ComparePage'
import ContactsPage from '@/pages/ContactsPage/ContactsPage'
import DeliveryPage from '@/pages/DeliveryPage/DeliveryPage'
import ErrorPage from '@/pages/ErrorPage/ErrorPage'
import FavoritesPage from '@/pages/FavoritesPage/FavoritesPage'
import { FeedbackPage } from '@/pages/FeedbackPage/FeedbackPage'
Expand Down Expand Up @@ -59,7 +60,7 @@ export const AppRouter = createBrowserRouter([
},
{
path: Routes.DELIVERY,
element: <ProductsPage /> // временная заглушка нужна страница с информацией о доставке
element: <DeliveryPage />
},
{
path: Routes.FAVORITES,
Expand Down
2 changes: 0 additions & 2 deletions src/entities/AboutUs/ui/AboutUs.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,4 @@
font-size: 16px;
font-weight: 400;
color: var.$body-color;
margin: 0;
padding: 30px 0 56px;
}
22 changes: 9 additions & 13 deletions src/pages/AboutUsPage/AboutUsPage.module.scss
Original file line number Diff line number Diff line change
@@ -1,19 +1,15 @@
@use '@/shared/styles/utils/variables' as var;

.title {
.aboutUs {
display: flex;
flex-direction: column;
gap: 30px;
width: 100%;
margin: 0 0 10px;
padding: 0;
}

.link {
text-decoration: none;
color: var.$subtitle-color;
font-size: 13.5px;
font-weight: 400;
line-height: 16.2px;
padding: 0 0 56px;

&:hover {
color: var.$theme-primary-color;
&__titleBox {
display: flex;
flex-direction: column;
gap: 10px;
}
}
33 changes: 17 additions & 16 deletions src/pages/AboutUsPage/AboutUsPage.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
import { useEffect } from 'react'
import { useDispatch, useSelector } from 'react-redux'
import { Link } from 'react-router-dom'

import { AppDispatch } from '@/app/providers/StoreProvider/config/store'
import WrapperForMainContent from '@/components/WrapperForMainContent/WrapperForMainContent'
import AboutUs from '@/entities/AboutUs'
import Breadcrumbs from '@/shared/ui/Breadcrumbs/Breadcrumbs'
import Heading, { HeadingType } from '@/shared/ui/Heading/Heading'
import Subheading from '@/shared/ui/Subheading/Subheading'

import styles from './AboutUsPage.module.scss'
import { getAboutUsSelector } from './model/selectors/selectors'
import { getAboutUs } from './model/services/getAboutUs'

const links = [
{ heading: 'Главная', href: '/' },
{ heading: 'О нас', href: '' }
]

const AboutUsPage = () => {
const dispatch = useDispatch<AppDispatch>()
const aboutUs = useSelector(getAboutUsSelector)
Expand All @@ -22,20 +26,17 @@ const AboutUsPage = () => {

return (
<WrapperForMainContent>
{aboutUs?.map((item, index) => (
<Heading key={index} type={HeadingType.MAIN} className={styles.title}>
{item.headline}
</Heading>
))}

<Subheading>
<Link to={'/'} className={styles.link}>
Главная
</Link>{' '}
/ О нас
</Subheading>

{aboutUs?.map((item, index) => <AboutUs key={index} text={item.text} />)}
<section className={styles.aboutUs}>
<div className={styles.aboutUs__titleBox}>
{aboutUs?.map((item, index) => (
<Heading key={index} type={HeadingType.MAIN}>
{item.headline}
</Heading>
))}
<Breadcrumbs links={links} />
</div>
{aboutUs?.map((item, index) => <AboutUs key={index} text={item.text} />)}
</section>
</WrapperForMainContent>
)
}
Expand Down
20 changes: 15 additions & 5 deletions src/pages/ContactsPage/ContactsPage.module.scss
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
.heading {
align-self: flex-start;
padding: 30px;
}

.contacts {
display: flex;
flex-direction: column;
padding-top: 24px;
padding-bottom: 56px;

&__titleBox {
display: flex;
flex-direction: column;
gap: 10px;
width: 100%;
max-width: 1330px;
margin: 0 auto;
padding-bottom: 30px;
}

&__map {
width: 100%;
width: 500px;
Expand Down
15 changes: 12 additions & 3 deletions src/pages/ContactsPage/ContactsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,24 @@ import { Link } from 'react-router-dom'

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 Map from '@/widgets/Map/Map'

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

const links = [
{ heading: 'Главная', href: '/' },
{ heading: 'Контакты', href: '' }
]

const ContactsPage: FC = () => {
return (
<div className={styles.contacts}>
<Heading className={styles.heading}>Контакты</Heading>
<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}>
Expand Down Expand Up @@ -69,7 +78,7 @@ const ContactsPage: FC = () => {
</div>
<FormQuestion />
</div>
</div>
</section>
)
}

Expand Down
13 changes: 13 additions & 0 deletions src/pages/DeliveryPage/DeliveryPage.module.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
.delivery {
display: flex;
flex-direction: column;
gap: 30px;
width: 100%;
padding: 0 0 56px;

&__titleBox {
display: flex;
flex-direction: column;
gap: 10px;
}
}
25 changes: 25 additions & 0 deletions src/pages/DeliveryPage/DeliveryPage.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import WrapperForMainContent from '@/components/WrapperForMainContent/WrapperForMainContent'
import Breadcrumbs from '@/shared/ui/Breadcrumbs/Breadcrumbs'
import Heading, { HeadingType } from '@/shared/ui/Heading/Heading'

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

const links = [
{ heading: 'Главная', href: '/' },
{ heading: 'Информация о доставке', href: '' }
]

const DeliveryPage = () => {
return (
<WrapperForMainContent>
<section className={styles.delivery}>
<div className={styles.delivery__titleBox}>
<Heading type={HeadingType.MAIN}>Информация о доставке</Heading>
<Breadcrumbs links={links} />
</div>
</section>
</WrapperForMainContent>
)
}

export default DeliveryPage
2 changes: 1 addition & 1 deletion src/widgets/Header/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ function Header() {
() => (
<ul className={styles['header__context-menu-list']}>
<li className={styles['header__context-menu-item']}>
<Link to="" className={styles['header__context-menu-link']}>
<Link to={Routes.DELIVERY} className={styles['header__context-menu-link']}>
Информация о доставке
</Link>
</li>
Expand Down
Loading