Skip to content

Commit

Permalink
#150 enhancement: добавить константу для количества брендов к показу …
Browse files Browse the repository at this point in the history
…на главной странице
  • Loading branch information
Sibisov-Artem committed Jan 28, 2024
1 parent a0bbd47 commit a687650
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/shared/constants/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,6 @@ export const VIBER_LINK = 'viber://chat?number=79778480228'
export const TELEGRAM_LINK = '//t.me/79778480228'
export const EMAIL_LINK = 'mailto:mail@mail.ru'
export const MAX_PRODUCTS_NUMBER: number = 99

//for BrandBlock component
export const BRANDS_FOR_MAIN_NUMBER: number = 6
3 changes: 2 additions & 1 deletion src/widgets/BrandBlock/ui/BrandBlock/BrandBlock.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import Link from '@/shared/ui/Link/Link'
import BrandCard from '@/entities/BrandCard/BrandCard'
import { TEXT_OUR_BRANDS, TEXT_ALL_BRANDS } from '@/shared/constants/constants'
import styles from './BrandBlock.module.scss'
import { BRANDS_FOR_MAIN_NUMBER } from '@/shared/constants/constants'

/**
* Компонент списка брендов для главной страницы.
Expand All @@ -32,7 +33,7 @@ const BrandBlock = () => {
</Link>
</div>
<ul className={styles.brands__body}>
{brands.slice(0, 6).map(card => (
{brands.slice(0, BRANDS_FOR_MAIN_NUMBER).map(card => (
<BrandCard card={card} key={card.id} />
))}
</ul>
Expand Down

0 comments on commit a687650

Please sign in to comment.