Skip to content

Commit

Permalink
Merge pull request #246 from Studio-Yandex-Practicum/enhancement-143-…
Browse files Browse the repository at this point in the history
…categoryGridToFSD

категории под FSD
  • Loading branch information
ArturKhelshtein authored Mar 4, 2024
2 parents 508d84e + 1374870 commit 91e8f44
Show file tree
Hide file tree
Showing 11 changed files with 51 additions and 64 deletions.
2 changes: 1 addition & 1 deletion src/entities/SearchResult/SearchResult.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { forwardRef } from 'react'

import SearchItem from '@/entities/SearchItem/SearchItem'
import { TCategory } from '@/models/CategoryModel'
import { Routes } from '@/shared/config/routerConfig/routes'
import { SEARCH_CATEGORY, SEARCH_PRODUCT } from '@/shared/constants/constants'
import { TCategory } from '@/shared/model/CategoryModel'
import type { TProduct } from '@/shared/model/types/common'
import Link from '@/shared/ui/Link/Link'

Expand Down
48 changes: 0 additions & 48 deletions src/mockData/catalogListData.ts

This file was deleted.

8 changes: 0 additions & 8 deletions src/shared/config/catalogLinks/catalogLinks.ts

This file was deleted.

42 changes: 42 additions & 0 deletions src/shared/mockData/catalogListData.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import { Routes } from '@/shared/config/routerConfig/routes'

export const linkItems = [
{ index: 0, label: 'Блог', to: Routes.BLOG },
{ index: 1, label: 'Новости', to: Routes.NEWS },
{ index: 2, label: 'Отзывы о магазине', to: Routes.REVIEWS },
{ index: 3, label: 'Контакты', to: Routes.CONTACTS }
]

export const catalogListData = [
{
id: 15,
name: 'Браслеты',
slug: 'brasletyi1',
branches: [],
root: 'Бижутерия',
is_prohibited: false,
is_visible_on_main: true,
image:
'http://gealit.ru/media/category-images/brasletyi/%D0%A1%D0%BD%D0%B8%D0%BC%D0%BE%D0%BA_%D1%8D%D0%BA%D1%80%D0%B0%D0%BD%D0%B0_2023-11-29_163851.jpg'
},
{
id: 1,
name: 'Машинки',
slug: 'mashinki',
branches: [],
root: 'Игрушки',
is_prohibited: false,
is_visible_on_main: true,
image: 'http://gealit.ru/media/category-images/mashinki/170734.jpg'
},
{
id: 22,
name: 'Медиаплееры',
slug: 'mediapleeryi1',
branches: [],
root: 'Телевизоры и аудиотехника',
is_prohibited: false,
is_visible_on_main: true,
image: null
}
]
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ export type TCategory = {
name: string
slug: string
branches?: TCategory[]
root?: TCategory
root?: string
is_prohibited?: boolean
is_visible_on_main?: boolean
image?: string
image?: string | null
type?: 'category'
}
2 changes: 1 addition & 1 deletion src/shared/model/types/common.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { TCategory } from '@/models/CategoryModel'
import { TCategory } from '@/shared/model/CategoryModel'

export type TProduct = {
name: string
Expand Down
2 changes: 1 addition & 1 deletion src/shared/ui/CategoryCard/ui/CategoryCard.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { type FC } from 'react'

import { TCategory } from '@/models/CategoryModel'
import { Routes } from '@/shared/config/routerConfig/routes'
import { TCategory } from '@/shared/model/CategoryModel'
import Link from '@/shared/ui/Link/Link'

import Subheading from '../../Subheading/Subheading'
Expand Down
3 changes: 2 additions & 1 deletion src/widgets/CategoryGrid/CategoryGrid.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { catalogListData } from '@/mockData/catalogListData'
import { TEXT_POPULAR_CATEGORIES } from '@/shared/constants/constants'
import { catalogListData } from '@/shared/mockData/catalogListData'
import CategoryCard from '@/shared/ui/CategoryCard/ui/CategoryCard'
import Heading from '@/shared/ui/Heading/Heading'

Expand All @@ -8,6 +8,7 @@ import styles from './CategoryGrid.module.scss'
/**
* Компонент сетки с карточками популярных категорий для главной страницы.
*/

const CategoryGrid = () => {
return (
<section className={styles.section}>
Expand Down
4 changes: 2 additions & 2 deletions src/widgets/Header/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ import { fetchCategories } from '@/entities/Category/slice/categorySlice'
import HeaderAccount from '@/entities/HeaderAccount/HeaderAccount'
import CallBack from '@/features/CallBack'
import SearchProduct from '@/features/SearchProduct'
import { linkItems } from '@/mockData/catalogListData'
import { headerAccountData } from '@/mockData/headerAccountData'
import { Routes } from '@/shared/config/routerConfig/routes'
import ArrowIcon from '@/shared/icons/arrow.svg'
import IconCategories from '@/shared/icons/IconCategories.svg'
import { linkItems } from '@/shared/mockData/catalogListData'
import { headerAccountData } from '@/shared/mockData/headerAccountData'
import CatalogLink from '@/shared/ui/CatalogLink/CatalogLink'
import ContextMenuElement from '@/shared/ui/ContextMenuElement/ContextMenuElement'
import Link from '@/shared/ui/Link/Link'
Expand Down

0 comments on commit 91e8f44

Please sign in to comment.