-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7c27885
commit 9b51623
Showing
25 changed files
with
446 additions
and
288 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
body { | ||
margin: 0 auto; | ||
max-width: 100vw; | ||
min-width: 375px; | ||
font-family: | ||
Roboto, | ||
Arial, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,10 @@ | ||
@use '../../shared/styles/utils/mixins' as media; | ||
|
||
.wrapper { | ||
max-width: 1470px; | ||
width: 100%; | ||
margin: 0 auto; | ||
padding: 25px; | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
gap: 20px; | ||
|
||
@include media.respond-to('middle') { | ||
max-width: 768px; | ||
width: 100%; | ||
} | ||
|
||
@include media.respond-to('small') { | ||
width: 390px; | ||
gap: 20px; | ||
} | ||
gap: 48px; | ||
width: 100%; | ||
max-width: 1470px; | ||
margin: 0 auto; | ||
padding: 25px; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
import HeadingBlock from './ui/HeadingBlock' | ||
export default HeadingBlock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
@use '@/shared/styles/utils/variables' as var; | ||
@use '@/shared/styles/utils/mixins' as media; | ||
|
||
.headingBlock { | ||
display: flex; | ||
justify-content: space-between; | ||
align-items: center; | ||
width: 100%; | ||
|
||
&__heading { | ||
display: flex; | ||
gap: 15px; | ||
align-items: flex-end; | ||
} | ||
|
||
&__link { | ||
display: flex; | ||
justify-content: space-between; | ||
align-items: center; | ||
gap: 10px; | ||
font-size: 15px; | ||
color: var.$link-color; | ||
fill: var.$link-color; | ||
cursor: pointer; | ||
opacity: 1; | ||
transition: 0.25s; | ||
|
||
&:hover { | ||
opacity: 0.7; | ||
} | ||
|
||
@include media.respond-to('middle') { | ||
display: none; | ||
} | ||
} | ||
|
||
&__arrow { | ||
transform: rotate(270deg); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import type { Meta, StoryObj } from '@storybook/react' | ||
|
||
import IconHand from '@/assets/images/img-hand.png.png' | ||
|
||
import HeadingBlock from './HeadingBlock' | ||
|
||
const meta = { | ||
title: 'entities/HeadingBlock', | ||
component: HeadingBlock, | ||
parameters: { | ||
layout: 'centered' | ||
}, | ||
tags: ['autodocs'] | ||
} satisfies Meta<typeof HeadingBlock> | ||
|
||
export default meta | ||
type Story = StoryObj<typeof meta> | ||
|
||
export const Default: Story = () => { | ||
const title = 'Новости' | ||
const subtitle = 'Все новости' | ||
const link = '#' | ||
|
||
return ( | ||
<div style={{ width: '700px' }}> | ||
<HeadingBlock | ||
title={title} | ||
isIcon={true} | ||
image={IconHand} | ||
isLink={true} | ||
subtitle={subtitle} | ||
link={link} | ||
/> | ||
</div> | ||
) | ||
} | ||
|
||
Default.args = { | ||
title: 'Новости', | ||
subtitle: 'Все новости', | ||
link: '#' | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
import { FC } from 'react' | ||
|
||
import ArrowIcon from '@/assets/images/sideBarMenu/IconArrowDown.svg' | ||
import Heading, { HeadingType } from '@/shared/ui/Heading/Heading' | ||
import Link from '@/shared/ui/Link/Link' | ||
|
||
import styles from './HeadingBlock.module.scss' | ||
|
||
interface IHeadingBlock { | ||
title: string | ||
isIcon?: boolean | ||
image?: string | ||
alt?: string | ||
isLink?: boolean | ||
subtitle?: string | ||
link?: string | ||
} | ||
|
||
/** | ||
* Компонент HeadingBlock - это заголовок с отдельным линком. Отрисовывается на главной странице MainPage в блоках новостей, отзывов и т.п. | ||
* @param {string} title - заголовок блока | ||
* @param {boolean} isIcon - булево значение показывающее линк | ||
* @param {string} image - картинка в заголовке блока | ||
* @param {string} alt - alt картинки в заголовке блока | ||
* @param {boolean} isLink - булево значение показывающее линк | ||
* @param {string} subtitle - название линка | ||
* @param {string} link - ссылка | ||
*/ | ||
|
||
const HeadingBlock: FC<IHeadingBlock> = ({ | ||
title, | ||
isIcon = false, | ||
image, | ||
alt, | ||
isLink = false, | ||
subtitle, | ||
link | ||
}) => { | ||
return ( | ||
<article className={styles.headingBlock}> | ||
<Heading type={HeadingType.NORMAL} className={styles.headingBlock__heading}> | ||
{title} | ||
{isIcon && <img src={image} alt={alt} />} | ||
</Heading> | ||
{isLink && ( | ||
<Link to={link} className={styles.headingBlock__link}> | ||
{subtitle} | ||
<ArrowIcon className={styles.headingBlock__arrow} /> | ||
</Link> | ||
)} | ||
</article> | ||
) | ||
} | ||
|
||
export default HeadingBlock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,7 @@ | ||
.rootPageWrapper { | ||
display: grid; | ||
grid-template-rows: auto 1fr auto; | ||
min-height: 100vh; | ||
margin: 0; | ||
} | ||
|
||
.main { | ||
display: flex; | ||
flex-direction: column; | ||
gap: 60px; | ||
align-items: center; | ||
gap: 23px; | ||
width: 100%; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.