diff --git a/src/assets/icons/IconLeftArrow.svg b/src/assets/icons/IconLeftArrow.svg
new file mode 100644
index 00000000..b81652a8
--- /dev/null
+++ b/src/assets/icons/IconLeftArrow.svg
@@ -0,0 +1,5 @@
+
+
+
\ No newline at end of file
diff --git a/src/assets/icons/IconRightArrow.svg b/src/assets/icons/IconRightArrow.svg
new file mode 100644
index 00000000..ae058501
--- /dev/null
+++ b/src/assets/icons/IconRightArrow.svg
@@ -0,0 +1,5 @@
+
+
+
\ No newline at end of file
diff --git a/src/assets/icons/dots.svg b/src/assets/icons/dots.svg
new file mode 100644
index 00000000..e11ebf69
--- /dev/null
+++ b/src/assets/icons/dots.svg
@@ -0,0 +1,3 @@
+
+
+
\ No newline at end of file
diff --git a/src/components/CardReview/CardReview.module.scss b/src/components/CardReview/CardReview.module.scss
deleted file mode 100644
index 6781b0a0..00000000
--- a/src/components/CardReview/CardReview.module.scss
+++ /dev/null
@@ -1,87 +0,0 @@
-@use '../../shared/styles/utils/variables' as color;
-
-.review {
- display: flex;
- flex-direction: column;
- min-width: 340px;
- align-items: flex-start;
- justify-content: space-between;
- padding: 35px 30px 40px 40px;
- gap: 9px;
-
- .title {
- display: flex;
- align-items: center;
- gap: 3px;
- }
-
- p {
- font-size: 0.9375rem;
- font-weight: 400;
- line-height: 1.7;
- }
-
- &__header {
- display: flex;
- align-items: center;
- line-height: 1.62;
- gap: 11px;
-
- h3 {
- font-size: 1rem;
- font-weight: 500;
- }
-
- span {
- font-size: 0.875rem;
- font-weight: 400;
- display: flex;
- align-items: center;
- gap: 3px;
- }
- }
-
- &__initials {
- width: 40px;
- height: 40px;
- border-radius: 50%;
- background: color.$bg-gradient-green;
- color: color.$white;
- font-size: 1.125rem;
- font-weight: 500;
- line-height: 1.2;
- display: flex;
- align-items: center;
- justify-content: center;
- }
-
- &__data {
- font-weight: 400;
- line-height: 1.7;
-
- p {
- overflow: hidden;
- display: -webkit-box;
- -webkit-line-clamp: 5;
- -webkit-box-orient: vertical;
- text-overflow: clip;
- }
-
- span {
- font-size: 0.875rem;
- opacity: 0.4;
- }
- }
-}
-
-.link__text {
- font-size: 0.9375rem;
- line-height: 1.7;
- font-weight: 500;
- text-decoration: none;
- color: color.$link-color;
-
- &:hover {
- opacity: 0.7;
- }
-}
diff --git a/src/components/Footer/Footer.tsx b/src/components/Footer/Footer.tsx
deleted file mode 100644
index d9c5163a..00000000
--- a/src/components/Footer/Footer.tsx
+++ /dev/null
@@ -1,85 +0,0 @@
-import Logo from '../logo/Logo'
-import VisaIcon from '@/assets/images/footer/visa.svg'
-import MastercardIcon from '@/assets/images/footer/mastercard.svg'
-import MirIcon from '@/assets/images/footer/mir.svg'
-import WebmoneyIcon from '@/assets/images/footer/webmoney.svg'
-import UmoneyIcon from '@/assets/images/footer/io.svg'
-import SubscribeForm from '../SubscribeForm/SubscribeForm'
-import Link from '@/shared/ui/Link/Link'
-import styles from './footer.module.scss'
-
-function Footer() {
- const onSubmitHandler = () => {}
- return (
-
-
-
-
-
-
Интернет-магазин «Maxboom.ru», 2023
-
-
-
-
-
-
Поддержка
-
-
-
-
- +7 977 848-02-28
-
-
-
-
- Обратный звонок
-
-
-
-
Будни, с 10:00 до 20:00
-
-
-
-
-
-
- Created by{' '}
-
- maxboom.ru
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- )
-}
-
-export default Footer
diff --git a/src/components/ReviewsBlock/ReviewsBlock.module.scss b/src/components/ReviewsBlock/ReviewsBlock.module.scss
deleted file mode 100644
index 05d5dc2a..00000000
--- a/src/components/ReviewsBlock/ReviewsBlock.module.scss
+++ /dev/null
@@ -1,59 +0,0 @@
-@use '../../shared/styles/utils/variables' as color;
-
-.wrapper {
- width: 100%;
- margin: 0 auto;
-
- h2 {
- font-size: #{'min(max(18px, 1.6vw), 20px)'};
- line-height: 115%;
- font-weight: 500;
- }
-
- .header {
- display: flex;
- justify-content: space-between;
- align-items: flex-end;
- margin: 0 25px;
- }
-
- .link {
- font-size: 15px;
- line-height: 120%;
- font-weight: 500;
-
- &:hover {
- opacity: 0.7;
- }
- }
-
- .svg {
- width: 1.25rem;
- height: 0.5625rem;
- margin-left: 0.5rem;
- vertical-align: middle;
- }
-
- ul {
- display: flex;
- gap: 20px;
- max-width: 100%;
- padding: 20px 25px;
- overflow: auto hidden;
- cursor: grab;
-
- &::-webkit-scrollbar {
- height: 3px;
- }
-
- &::-webkit-scrollbar-thumb {
- background: color.$theme-primary-color;
- cursor: grab;
- }
-
- &::-webkit-scrollbar-track {
- margin-left: 25px;
- margin-right: 25px;
- }
- }
-}
diff --git a/src/components/SearchItem/search-item.module.scss b/src/components/SearchItem/search-item.module.scss
deleted file mode 100644
index 8371e4e2..00000000
--- a/src/components/SearchItem/search-item.module.scss
+++ /dev/null
@@ -1,57 +0,0 @@
-.link {
- padding: 20px 30px;
- display: flex;
- align-items: center;
- min-height: 30px;
- color: #343434;
- text-decoration: none;
- transition: color 0.25s;
-}
-
-.image {
- width: 34px;
- height: 34px;
- margin-right: 20px;
- flex: 0 0 auto;
-}
-
-.number {
- margin: 0;
- font-size: 14px;
- line-height: 12px;
- font-weight: 400;
- color: #bdc2d3;
-}
-
-.price {
- display: flex;
- align-items: center;
- font-size: 16px;
- font-weight: 400;
- margin: 0;
- color: #343434;
-}
-
-.wrapper {
- display: flex;
- flex-direction: column;
- margin-right: 20px;
- flex: 1;
-}
-
-.paragraph {
- font-size: 15px;
- font-weight: 400;
- line-height: 1.2;
- margin: 0 0 5px;
-}
-
-.price-wrapper {
- display: flex;
- flex: 0 0 auto;
- column-gap: 20px;
-}
-
-.image-link {
- visibility: visible;
-}
diff --git a/src/components/Subscribe/Subscribe.tsx b/src/components/Subscribe/Subscribe.tsx
index 6b514c39..c4a18f33 100644
--- a/src/components/Subscribe/Subscribe.tsx
+++ b/src/components/Subscribe/Subscribe.tsx
@@ -1,6 +1,6 @@
import styles from './Subscribe.module.scss'
import imgSubs from '@/assets/images/img-subsc-small.png'
-import SubscribeForm from '../SubscribeForm/SubscribeForm'
+import SubscribeForm from '../../features/SubscribeForm/SubscribeForm'
const Subscribe = () => {
const onSubmitHandler = () => {}
diff --git a/src/components/header/header.tsx b/src/components/header/header.tsx
index 2eaab324..e3cb12ee 100644
--- a/src/components/header/header.tsx
+++ b/src/components/header/header.tsx
@@ -1,7 +1,7 @@
+import { coreBaseData } from '@/mockData/coreBaseData'
import { useMemo } from 'react'
import classNames from 'classnames'
-import Logo from '../logo/Logo'
-import Search from '../search/search'
+import Logo from '../../shared/ui/logo/Logo'
import ArrowIcon from '@/assets/icons/arrow.svg'
import LightningIcon from '@/assets/images/header/lightning.svg'
import ContextMenuElement from '../ContextMenuElement/ContextMenuElement'
@@ -15,6 +15,7 @@ import { CatalogLinksId } from '@/shared/config/catalogLinks/catalogLinks'
import Link from '@/shared/ui/Link/Link'
import IconCategories from '@/assets/icons/IconCategories.svg'
import styles from './header.module.scss'
+import SearchProduct from '@/features/SearchProduct'
function Header() {
const aboutUsNode = useMemo(
@@ -151,8 +152,14 @@ function Header() {
-
-
+
+
diff --git a/src/components/logo/Logo.tsx b/src/components/logo/Logo.tsx
deleted file mode 100644
index b9514daf..00000000
--- a/src/components/logo/Logo.tsx
+++ /dev/null
@@ -1,25 +0,0 @@
-import { FC } from 'react'
-import logo from '@/assets/images/logo/maxboom.jpg'
-import styles from './logo.module.scss'
-import Link from '@/shared/ui/Link/Link'
-
-type TLogoProps = {
- width: string
- height: string
-}
-/**
- * @param {string} width - ширина логотипа
- * @param {string} height - высота логотипа
- */
-
-const Logo: FC = ({ width, height }) => {
- return (
-
-
-
-
-
- )
-}
-
-export default Logo
diff --git a/src/components/search/search.tsx b/src/components/search/search.tsx
deleted file mode 100644
index 7e232b57..00000000
--- a/src/components/search/search.tsx
+++ /dev/null
@@ -1,55 +0,0 @@
-import React, { FC, useEffect, useState } from 'react'
-import styles from './search.module.scss'
-import { searchResponseData } from '@/mockData/searchData'
-import { TResultData } from '@/shared/model/types/common'
-import SearchResult from '../searchResult/searchResult'
-import { Input, InputSize, InputTheme } from '@/shared/ui/Input/Input'
-
-// @TODO: Перевести форму на Formik + Yup
-// https://github.com/Studio-Yandex-Practicum/maxboom_frontend/issues/92
-const Search: FC> = () => {
- const [visible, setVisability] = useState(false)
- const [resultData, setResultData] = useState({ data: [], success: false }) // TODO: move to redux
-
- const inputEventHandler = () => {
- setResultData(searchResponseData)
- }
-
- const closeContextMenuHandler = (e: Event) => {
- const searchResultNode = document.querySelector(styles.result)
- const withinBoundaries = e.composedPath().includes(searchResultNode!)
-
- if (!withinBoundaries && visible) {
- setVisability(false)
- }
- }
-
- useEffect(() => {
- if (resultData.success) {
- setVisability(true)
- }
- }, [resultData])
-
- useEffect(() => {
- document.addEventListener('click', closeContextMenuHandler)
- return () => {
- document.removeEventListener('click', closeContextMenuHandler)
- }
- }, [])
-
- return (
-
- )
-}
-
-export default Search
diff --git a/src/entities/CardReview/ui/CardReview/CardReview.stories.tsx b/src/entities/CardReview/ui/CardReview/CardReview.stories.tsx
new file mode 100644
index 00000000..c45fa99b
--- /dev/null
+++ b/src/entities/CardReview/ui/CardReview/CardReview.stories.tsx
@@ -0,0 +1,26 @@
+import type { Meta, StoryObj } from '@storybook/react'
+import CardReview from './CardReview'
+
+const meta = {
+ title: 'entities/CardReview',
+ component: CardReview,
+ parameters: {
+ layout: 'centered'
+ },
+ tags: ['autodocs']
+} satisfies Meta
+
+export default meta
+type Story = StoryObj
+
+export const Default: Story = {
+ args: {
+ review: {
+ id: 1,
+ name: 'Рейтинг нашего магазина',
+ score: '4.3',
+ text: 'Мы очень ним гордимся, это результат упорного труда в течении длительного времени и сейчас наша команда ежедневно работает над улучшением сервиса.',
+ date: ''
+ }
+ }
+}
diff --git a/src/components/CardReview/CardReview.tsx b/src/entities/CardReview/ui/CardReview/CardReview.tsx
similarity index 97%
rename from src/components/CardReview/CardReview.tsx
rename to src/entities/CardReview/ui/CardReview/CardReview.tsx
index 5e84f19b..b77adfb1 100644
--- a/src/components/CardReview/CardReview.tsx
+++ b/src/entities/CardReview/ui/CardReview/CardReview.tsx
@@ -4,7 +4,7 @@ import IconStar from '@/assets/icons/IconStar'
import Paragraph from '@/shared/ui/Paragraph/Paragraph'
import Heading, { HeadingType } from '@/shared/ui/Heading/Heading'
import Link from '@/shared/ui/Link/Link'
-import styles from './CardReview.module.scss'
+import styles from './cardReview.module.scss'
export type Props = {
review: TReview
diff --git a/src/entities/CardReview/ui/CardReview/cardReview.module.scss b/src/entities/CardReview/ui/CardReview/cardReview.module.scss
new file mode 100644
index 00000000..296f8a0a
--- /dev/null
+++ b/src/entities/CardReview/ui/CardReview/cardReview.module.scss
@@ -0,0 +1,87 @@
+@use '../../../../shared/styles/utils/variables' as color;
+
+.review {
+ display: flex;
+ flex-direction: column;
+ min-width: 340px;
+ align-items: flex-start;
+ justify-content: space-between;
+ padding: 35px 30px 40px 40px;
+ gap: 9px;
+
+ .title {
+ display: flex;
+ align-items: center;
+ gap: 3px;
+ }
+
+ p {
+ font-size: 0.9375rem;
+ font-weight: 400;
+ line-height: 1.7;
+ }
+
+ &__header {
+ display: flex;
+ align-items: center;
+ line-height: 1.62;
+ gap: 11px;
+
+ h3 {
+ font-size: 1rem;
+ font-weight: 500;
+ }
+
+ span {
+ font-size: 0.875rem;
+ font-weight: 400;
+ display: flex;
+ align-items: center;
+ gap: 3px;
+ }
+ }
+
+ &__initials {
+ width: 40px;
+ height: 40px;
+ border-radius: 50%;
+ background: color.$bg-gradient-green;
+ color: color.$white;
+ font-size: 1.125rem;
+ font-weight: 500;
+ line-height: 1.2;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ }
+
+ &__data {
+ font-weight: 400;
+ line-height: 1.7;
+
+ p {
+ overflow: hidden;
+ display: -webkit-box;
+ -webkit-line-clamp: 5;
+ -webkit-box-orient: vertical;
+ text-overflow: clip;
+ }
+
+ span {
+ font-size: 0.875rem;
+ opacity: 0.4;
+ }
+ }
+}
+
+.link__text {
+ font-size: 0.9375rem;
+ line-height: 1.7;
+ font-weight: 500;
+ text-decoration: none;
+ color: color.$link-color;
+
+ &:hover {
+ opacity: 0.7;
+ }
+}
\ No newline at end of file
diff --git "a/src/entities/\320\241ontactCard/\320\241ontactCard.tsx" b/src/entities/ContactCard/ContactCard.tsx
similarity index 94%
rename from "src/entities/\320\241ontactCard/\320\241ontactCard.tsx"
rename to src/entities/ContactCard/ContactCard.tsx
index 95935675..f84f04bf 100644
--- "a/src/entities/\320\241ontactCard/\320\241ontactCard.tsx"
+++ b/src/entities/ContactCard/ContactCard.tsx
@@ -23,7 +23,7 @@ const ContactCard: FC = ({ messenger, Icon }) => {
- {messenger.title}
+ {messenger.title}
)
diff --git "a/src/entities/\320\241ontactCard/contactCard.module.scss" b/src/entities/ContactCard/contactCard.module.scss
similarity index 81%
rename from "src/entities/\320\241ontactCard/contactCard.module.scss"
rename to src/entities/ContactCard/contactCard.module.scss
index 7fd48054..9520775b 100644
--- "a/src/entities/\320\241ontactCard/contactCard.module.scss"
+++ b/src/entities/ContactCard/contactCard.module.scss
@@ -19,10 +19,4 @@
width: 60px;
height: 60px;
margin-bottom: 12px;
-}
-
-.text {
- color: var.$body-color;
- font-size: 15px;
- text-align: center;
-}
+}
\ No newline at end of file
diff --git a/src/entities/Payments/Payments.stories.ts b/src/entities/Payments/Payments.stories.ts
new file mode 100644
index 00000000..ba7cf140
--- /dev/null
+++ b/src/entities/Payments/Payments.stories.ts
@@ -0,0 +1,41 @@
+import type { Meta, StoryObj } from '@storybook/react'
+
+import Payments from './Payments'
+
+const data = {
+ footer: {
+ additional_logos: [
+ {
+ image: 'https://maxboom.ru/image/catalog/demo-prostore/svg-icon/icon-payments-visa.svg',
+ url: '//visa.ru',
+ title: 'visa'
+ },
+ {
+ image: 'https://maxboom.ru/image/catalog/demo-prostore/svg-icon/io.svg',
+ url: '//yoomoney.ru',
+ title: 'yoomoney'
+ }
+ ],
+ support: {
+ name: 'Обрантый звонок',
+ phone_number: '+7 977 848-02-28'
+ }
+ }
+}
+
+const meta = {
+ title: 'entities/Payments',
+ component: Payments,
+ parameters: {
+ layout: 'centered'
+ }
+} as Meta
+
+export default meta
+type Story = StoryObj
+
+export const Default: Story = {
+ args: {
+ data: data
+ }
+}
diff --git a/src/entities/Payments/Payments.tsx b/src/entities/Payments/Payments.tsx
new file mode 100644
index 00000000..a762662b
--- /dev/null
+++ b/src/entities/Payments/Payments.tsx
@@ -0,0 +1,34 @@
+import { type FC } from 'react'
+import Link from '@/shared/ui/Link/Link'
+import styles from './payments.module.scss'
+
+type TPayments = {
+ data: { footer: { additional_logos: Logo[] } }
+}
+
+type Logo = {
+ image: string
+ title: string
+ url: string
+}
+
+/** платежная система
+ * @param {string} image - путь к картинке
+ * @param {string} title - название
+ * @param {string} url - путь к сайту
+ */
+const Payments: FC = ({ data }) => {
+ return (
+
+ {data.footer.additional_logos.map(logo => (
+
+
+
+
+
+ ))}
+
+ )
+}
+
+export default Payments
diff --git a/src/entities/Payments/payments.module.scss b/src/entities/Payments/payments.module.scss
new file mode 100644
index 00000000..1a1ccbe0
--- /dev/null
+++ b/src/entities/Payments/payments.module.scss
@@ -0,0 +1,39 @@
+@use '/src/shared/styles/utils/variables' as var;
+
+.payments {
+ margin: 0;
+ padding: 0;
+ display: flex;
+ column-gap: 3px;
+ list-style: none;
+ margin-right: 8px;
+}
+
+.payment {
+ &-item {
+ display: flex;
+ width: 34px;
+ height: 24px;
+ padding: 3px;
+ justify-content: center;
+ align-items: center;
+ border-radius: 4px;
+ background: var.$bg-no-image;
+ }
+
+ &-icon {
+ display: flex;
+ width: 100%;
+ height: 100%;
+ }
+
+ &-nav {
+ margin: 0;
+ padding: 0;
+ list-style: none;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ column-gap: 3px;
+ }
+}
diff --git a/src/entities/ProductEntity/ui/ProductEntity/ProductEntity.module.scss b/src/entities/ProductEntity/ui/ProductEntity/ProductEntity.module.scss
new file mode 100644
index 00000000..6f73d6fc
--- /dev/null
+++ b/src/entities/ProductEntity/ui/ProductEntity/ProductEntity.module.scss
@@ -0,0 +1,71 @@
+@use '../../../../shared/styles/utils/variables' as var;
+@use '../../../../shared/styles/utils/mixins' as media;
+
+
+
+.description {
+ display: flex;
+ align-items: center;
+ padding: 10px;
+ background: var.$white;
+ border-radius: 10px;
+ height: 110px;
+ width: 400px;
+
+ @include media.respond-to('large') {
+ width: 75%;
+ }
+}
+
+.frame {
+ width: 90px;
+ height: 90px;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ padding: 10px;
+ margin: 0 20px 0 0;
+ background: var.$white;
+ border-radius: 5px;
+
+ @include media.respond-to('large') {
+ border: 1px solid var.$light-grey;
+ }
+}
+
+.image {
+ display: flex;
+ max-height: 100%;
+ width: 70px;
+ height: 70px;
+ object-fit: cover;
+}
+
+.description_wrapper {
+ display: flex;
+ flex-direction: column;
+ max-height: 80px;
+}
+
+.number {
+ margin: 0 0 5px;
+ font-size: 14px;
+ line-height: 1;
+ font-weight: 400;
+ color: var.$subtitle-color;
+}
+
+.name {
+ display: flex;
+ font-size: 15px;
+ line-height: 1.35;
+ font-weight: 700;
+ color: var.$body-color;
+ text-overflow: ellipsis;
+ overflow: hidden;
+ width: 250px;
+
+ @include media.respond-to('large') {
+ width: 100%;
+ }
+}
\ No newline at end of file
diff --git a/src/entities/ProductEntity/ui/ProductEntity/ProductEntity.tsx b/src/entities/ProductEntity/ui/ProductEntity/ProductEntity.tsx
new file mode 100644
index 00000000..0ea9e606
--- /dev/null
+++ b/src/entities/ProductEntity/ui/ProductEntity/ProductEntity.tsx
@@ -0,0 +1,17 @@
+import { TProduct } from '@/mockData/productsData'
+import styles from './ProductEntity.module.scss'
+import { type FC } from 'react'
+
+export const ProductEntity: FC = product => {
+ return (
+
+
+
+
+
+
+ )
+}
diff --git a/src/components/SearchItem/searchItem.module.scss b/src/entities/SearchItem/SearchItem.module.scss
similarity index 94%
rename from src/components/SearchItem/searchItem.module.scss
rename to src/entities/SearchItem/SearchItem.module.scss
index 4b9996af..f15b65b8 100644
--- a/src/components/SearchItem/searchItem.module.scss
+++ b/src/entities/SearchItem/SearchItem.module.scss
@@ -1,4 +1,4 @@
-@use '../../shared/styles/utils/variables' as var;
+@use '@/shared/styles/utils/variables' as var;
.link {
padding: 20px 30px;
@@ -17,23 +17,6 @@
flex: 0 0 auto;
}
-.number {
- margin: 0;
- font-size: 14px;
- line-height: 12px;
- font-weight: 400;
- color: var.$body-color-light-grey;
-}
-
-.price {
- display: flex;
- align-items: center;
- font-size: 16px;
- font-weight: 400;
- margin: 0;
- color: var.$body-color;
-}
-
.wrapper {
display: flex;
flex-direction: column;
@@ -48,12 +31,29 @@
margin: 0 0 5px;
}
+.number {
+ margin: 0;
+ font-size: 14px;
+ line-height: 12px;
+ font-weight: 400;
+ color: var.$body-color-light-grey;
+}
+
.price-wrapper {
display: flex;
flex: 0 0 auto;
column-gap: 20px;
}
+.price {
+ display: flex;
+ align-items: center;
+ font-size: 16px;
+ font-weight: 400;
+ margin: 0;
+ color: var.$body-color;
+}
+
.image-link {
visibility: visible;
}
diff --git a/src/entities/SearchItem/SearchItem.stories.tsx b/src/entities/SearchItem/SearchItem.stories.tsx
new file mode 100644
index 00000000..35f22c83
--- /dev/null
+++ b/src/entities/SearchItem/SearchItem.stories.tsx
@@ -0,0 +1,22 @@
+import { Meta, Story } from '@storybook/react'
+import { searchResponseData } from '@/mockData/searchData'
+import SearchItem from './SearchItem'
+import { TProduct } from '@/shared/model/types/common'
+import { TLinkProps } from '@/shared/ui/Link/Link'
+
+export default {
+ title: 'Entities/SearchItem',
+ component: SearchItem,
+ parameters: {
+ layout: 'centered'
+ }
+} as Meta
+
+type StoryProps = TProduct & TLinkProps
+
+const Template: Story = args =>
+
+export const Default: Story = Template.bind({})
+Default.args = {
+ ...(searchResponseData.data[2] as StoryProps)
+}
diff --git a/src/components/SearchItem/SearchItem.tsx b/src/entities/SearchItem/SearchItem.tsx
similarity index 58%
rename from src/components/SearchItem/SearchItem.tsx
rename to src/entities/SearchItem/SearchItem.tsx
index deab9b8a..ca657e43 100644
--- a/src/components/SearchItem/SearchItem.tsx
+++ b/src/entities/SearchItem/SearchItem.tsx
@@ -1,32 +1,33 @@
-import { FC, useMemo, useState } from 'react'
+import { type FC, useMemo, useState } from 'react'
import ArrowRightIcon from '@/assets/images/searchItem/arrow-right.svg'
import { TProduct } from '@/shared/model/types/common'
import Link, { TLinkProps } from '@/shared/ui/Link/Link'
-import styles from './searchItem.module.scss'
+import styles from './SearchItem.module.scss'
/**
- * @param {string} image - фото товара
- * @param {string} name - название товара
- * @param {number} number - артикул товара
- * @param {string} price - цена товара с валютой
+ * Компонент элемента из поисковой выдачи для тултипа-подсказки
*/
const SearchItem: FC = props => {
const { image, name, number, price, ...otherProps } = props
- const [isVisible, setVisability] = useState(false)
+ const [isVisible, setVisibility] = useState(false)
const handleMouseEnter = () => {
- setVisability(true)
+ setVisibility(true)
}
const handleMouseLeave = () => {
- setVisability(false)
+ setVisibility(false)
}
const arrowNode = useMemo(() => , [])
return (
-
-
+
+
{name}
{number}
diff --git a/src/components/SubscribeForm/SubscribeForm.tsx b/src/entities/SubscribeForm/SubscribeForm.tsx
similarity index 52%
rename from src/components/SubscribeForm/SubscribeForm.tsx
rename to src/entities/SubscribeForm/SubscribeForm.tsx
index a66df0e5..c581dd39 100644
--- a/src/components/SubscribeForm/SubscribeForm.tsx
+++ b/src/entities/SubscribeForm/SubscribeForm.tsx
@@ -1,7 +1,8 @@
-import { FC, FormEvent } from 'react'
+import { type FC, FormEvent } from 'react'
import SubscribeIcon from '@/assets/images/subscriptionForm/icon-subsc.svg'
import styles from './subscribeForm.module.scss'
import { Input, InputSize, InputTheme } from '@/shared/ui/Input/Input'
+import classNames from 'classnames'
type TSubscribeForm = {
type: 'footer' | 'subscribe'
@@ -16,30 +17,32 @@ type TSubscribeForm = {
* @param {string} className - нужно будет, если захотят переиспользовать компонент
* @param {string} onSubmit - функция для обработки формы
*/
-const SubscribeForm: FC
= ({ className, type, onSubmit }) => {
- let classNameLabel = styles.label_footer
- if (type === 'subscribe') {
- classNameLabel = styles.label_subscribe
- }
-
- let classNameForm = styles.form_footer
- if (type === 'subscribe') {
- classNameForm = styles.form_subscribe
- }
- let classNameContainer = styles.container_footer
- if (type === 'subscribe') {
- classNameContainer = styles.container_subscribe
- }
+const SubscribeForm: FC = ({ type, onSubmit, className = '' }) => {
+ const classNameContainer = classNames(styles.container, {
+ [styles.container]: true,
+ [styles.container_footer]: type === 'footer',
+ [styles.container_subscribe]: type === 'subscribe'
+ })
+ const classNameLabel = classNames({
+ [styles.label]: true,
+ [styles.label_footer]: type === 'footer',
+ [styles.label_subscribe]: type === 'subscribe'
+ })
+ const classNameForm = classNames({
+ [styles.form]: true,
+ [styles.form_footer]: type === 'footer',
+ [styles.form_subscribe]: type === 'subscribe'
+ })
return (
-
+
{/* @TODO: Добавить компонент Label
https://github.com/Studio-Yandex-Practicum/maxboom_frontend/issues/102 */}
-
Подписаться на рассылку
-
Мы не будем присылать вам спам. Только скидки и выгодные предложения
-