diff --git a/src/entities/BrandCard/ui/BrandCard.tsx b/src/entities/BrandCard/ui/BrandCard.tsx index 71329b09..fe199026 100644 --- a/src/entities/BrandCard/ui/BrandCard.tsx +++ b/src/entities/BrandCard/ui/BrandCard.tsx @@ -1,7 +1,6 @@ import { FC } from 'react' import BrandWithoutImage from '@/assets/images/brands/brand-without-image.webp' -import { Routes } from '@/shared/config/routerConfig/routes' import Link from '@/shared/ui/Link/Link' import Img from '@/ui/img' import { Brand } from '@/widgets/BrandBlock/types/types' @@ -19,7 +18,7 @@ interface BrandCardProps { const BrandCard: FC = ({ card }) => { return ( - + {card.name} ) diff --git a/src/entities/NewsCard/ui/NewsCard.tsx b/src/entities/NewsCard/ui/NewsCard.tsx index 12791d3c..6b3d10ef 100644 --- a/src/entities/NewsCard/ui/NewsCard.tsx +++ b/src/entities/NewsCard/ui/NewsCard.tsx @@ -1,6 +1,7 @@ import { FC, useMemo } from 'react' import NoImage from '@/assets/icons/image-not-found-icon.svg' +import { Routes } from '@/shared/config/routerConfig/routes' import { TEXT_PROMO } from '@/shared/constants/constants' import Heading, { HeadingType } from '@/shared/ui/Heading/Heading' import Link from '@/shared/ui/Link/Link' @@ -34,7 +35,7 @@ const NewsCard: FC = ({ image, date, title, link }) => { }, [date]) return ( - + {image ? ( {'новость'} ) : ( diff --git a/src/entities/WidgetButtonsFunctions/WidgetButtonsFunctions.tsx b/src/entities/WidgetButtonsFunctions/WidgetButtonsFunctions.tsx index 7fba1a09..8089f1ca 100644 --- a/src/entities/WidgetButtonsFunctions/WidgetButtonsFunctions.tsx +++ b/src/entities/WidgetButtonsFunctions/WidgetButtonsFunctions.tsx @@ -2,6 +2,7 @@ import classnames from 'classnames' import { FC } from 'react' import IconCompare from '@/assets/icons/IconCompare.svg' +import IconEye from '@/assets/icons/IconEye.svg' import IconLike from '@/assets/icons/IconLike' import styles from '@/features/ProductItem/ProductItem.module.scss' import { ECardView } from '@/shared/model/types/common' @@ -16,6 +17,8 @@ type TWidgetButtonsFunctions = { isInCompared: boolean handleAddToCompared: VoidFunction layout: ECardView + active?: boolean + onEyeClick?: VoidFunction } /** @@ -25,13 +28,17 @@ type TWidgetButtonsFunctions = { * @param {boolean} isInCompared - добавлен ли товар к списку для сравнения; * @param {function} handleAddToCompared - функция добавления товара к списку для сравнения; * @param {string} layout - текущий вид отображения карточки товара; + * @param {boolean} active - выводить или нет кнопку; + * @param {function} onEyeClick - функция открытия поп-апа с дополнительной информацией о товаре; */ export const WidgetButtonsFunctions: FC = ({ isLiked, handleLike, isInCompared, handleAddToCompared, - layout + layout, + active, + onEyeClick }) => { const theme = layout === ECardView.COMPACT ? ButtonTheme.OUTLINED : undefined const size = layout === ECardView.COMPACT ? ButtonSize.S : ButtonSize.XS @@ -64,6 +71,17 @@ export const WidgetButtonsFunctions: FC = ({ })} /> + {active && ( + + )} ) } diff --git a/src/entities/WidgetButtonsPurchase/WidgetButtonsPurchase.tsx b/src/entities/WidgetButtonsPurchase/WidgetButtonsPurchase.tsx index 233ee874..40869e60 100644 --- a/src/entities/WidgetButtonsPurchase/WidgetButtonsPurchase.tsx +++ b/src/entities/WidgetButtonsPurchase/WidgetButtonsPurchase.tsx @@ -2,7 +2,6 @@ import classNames from 'classnames' import { FC } from 'react' import IconCart from '@/assets/icons/IconCart.svg' -import IconEye from '@/assets/icons/IconEye.svg' import WB from '@/assets/icons/WB.svg' import { ECardView } from '@/shared/model/types/common' import { Button, ButtonSize, ButtonTheme } from '@/shared/ui/Button/Button' @@ -12,7 +11,6 @@ import styles from './WidgetButtonsPurchase.module.scss' type TWidgetButtonsPurchase = { isInCart: boolean handleAddToCart: VoidFunction - onEyeClick: VoidFunction layout: ECardView wb_urls?: string } @@ -21,14 +19,12 @@ type TWidgetButtonsPurchase = { * Компонент (виджет) группы кнопок для добавления в корзину и открытия поп-апа с подробной информацией о товаре. * @param {boolean} isInCart - добавлен ли товар в корзину; * @param {function} handleAddToCart - функция добавления товара в корзину; - * @param {function} onEyeClick - функция открытия поп-апа с дополнительной информацией о товаре; * @param {string} layout - текущий вид отображения карточки товара; * @param {string} wb_urls ссылка на страницу с товаром на WB */ export const WidgetButtonsPurchase: FC = ({ isInCart, handleAddToCart, - onEyeClick, layout, wb_urls }) => { @@ -57,13 +53,6 @@ export const WidgetButtonsPurchase: FC = ({ )} - ) } diff --git a/src/features/ProductItem/ProductItem.tsx b/src/features/ProductItem/ProductItem.tsx index a8e3f0a0..794c5d68 100644 --- a/src/features/ProductItem/ProductItem.tsx +++ b/src/features/ProductItem/ProductItem.tsx @@ -125,6 +125,8 @@ export const ProductItem: FC = ({ handleLike={handleLike} handleAddToCompared={handleAddToCompared} layout={layout} + active={true} + onEyeClick={changeModalState} /> )} @@ -148,6 +150,8 @@ export const ProductItem: FC = ({ handleLike={handleLike} handleAddToCompared={handleAddToCompared} layout={layout} + active={true} + onEyeClick={changeModalState} /> )} @@ -179,7 +183,6 @@ export const ProductItem: FC = ({ @@ -197,7 +200,6 @@ export const ProductItem: FC = ({ @@ -207,6 +209,8 @@ export const ProductItem: FC = ({ handleLike={handleLike} handleAddToCompared={handleAddToCompared} layout={layout} + active={true} + onEyeClick={changeModalState} /> )} diff --git a/src/features/ProductItem/ProductSkeleton/ProductSkeleton.module.scss b/src/features/ProductItem/ProductSkeleton/ProductSkeleton.module.scss index 93085e5c..5af20a9c 100644 --- a/src/features/ProductItem/ProductSkeleton/ProductSkeleton.module.scss +++ b/src/features/ProductItem/ProductSkeleton/ProductSkeleton.module.scss @@ -18,7 +18,7 @@ &__buttons { display: flex; - width: 50px; + width: 90px; height: 40px; } diff --git a/src/widgets/BrandBlock/ui/BrandBlock.tsx b/src/widgets/BrandBlock/ui/BrandBlock.tsx index cc235b75..6d6434d8 100644 --- a/src/widgets/BrandBlock/ui/BrandBlock.tsx +++ b/src/widgets/BrandBlock/ui/BrandBlock.tsx @@ -5,7 +5,6 @@ import { AppDispatch } from '@/app/providers/StoreProvider/config/store' import BrandCard from '@/entities/BrandCard' import HeadingBlock from '@/entities/HeadingBlock' import LinkButton from '@/entities/LinkButton' -import { Routes } from '@/shared/config/routerConfig/routes' import { TEXT_ALL_BRANDS, TEXT_OUR_BRANDS } from '@/shared/constants/constants' import { useResize } from '@/shared/libs/hooks/useResize' import Scroll from '@/shared/ui/Scroll/Scroll' @@ -33,7 +32,7 @@ const BrandBlock: FC = () => { return ( brands?.length !== 0 && (
- + {brands.map(card => ( @@ -41,7 +40,7 @@ const BrandBlock: FC = () => { ))} - {!isScreenMd && } + {!isScreenMd && }
)