diff --git a/src/app/providers/StoreProvider/config/StateSchema.ts b/src/app/providers/StoreProvider/config/StateSchema.ts index e06ea1da..c81bca02 100644 --- a/src/app/providers/StoreProvider/config/StateSchema.ts +++ b/src/app/providers/StoreProvider/config/StateSchema.ts @@ -18,6 +18,7 @@ import { ICategoryFiltersSchema } from '@/components/Dropdown/types/types' import type { IFeedbackFormSchema } from '@/widgets/FeedbackForm/model/scheme/feedbackFormSliceSchema' import { IAboutUsSchema } from '@/pages/AboutUsPage/model/types/types' import { ICartSchema } from '@/pages/CartPage/model/types' +import { IProductAmountStateSchema } from '@/features/CartEdit/model/types' export interface StateSchema { aboutUs: IAboutUsSchema @@ -42,6 +43,7 @@ export interface StateSchema { getCategories: IMainCategorySchema cart: ICartSchema categoryFilters: ICategoryFiltersSchema + productAmount: IProductAmountStateSchema } export interface ThunkExtraArg { diff --git a/src/app/providers/StoreProvider/config/store.ts b/src/app/providers/StoreProvider/config/store.ts index 3ff1fbe2..84985178 100644 --- a/src/app/providers/StoreProvider/config/store.ts +++ b/src/app/providers/StoreProvider/config/store.ts @@ -23,6 +23,7 @@ import { categoryFiltersSliceReducer } from '@/components/Dropdown/slice/filters import { feedbackFormReducer } from '@/widgets/FeedbackForm/model/slice/feedbackFormSlice' import { aboutUsReducer } from '@/pages/AboutUsPage/model/slice/aboutUsSlice' import { cartReducer } from '@/pages/CartPage/model/slice' +import { productAmountReducer } from '@/features/CartEdit/model/slice/productAmountSlice' export type RootState = StateSchema @@ -48,7 +49,8 @@ const rootReducer: ReducersMapObject = { categoryBranches: categoryBranchesReducer, getCategories: getCategoriesReducer, cart: cartReducer, - categoryFilters: categoryFiltersSliceReducer + categoryFilters: categoryFiltersSliceReducer, + productAmount: productAmountReducer } export function createReduxStore(initialState: RootState) { diff --git a/src/app/router/AppRouter/ui/AppRouter.tsx b/src/app/router/AppRouter/ui/AppRouter.tsx index b465af84..1b5cc211 100644 --- a/src/app/router/AppRouter/ui/AppRouter.tsx +++ b/src/app/router/AppRouter/ui/AppRouter.tsx @@ -6,6 +6,7 @@ import CartPage from '@/pages/CartPage/CartPage' import { CategoryPage } from '@/pages/CategoryPage/CategoryPage' import ComparePage from '@/pages/ComparePage/ComparePage' import ContactsPage from '@/pages/ContactsPage/ContactsPage' +import DeliveryPage from '@/pages/DeliveryPage/DeliveryPage' import ErrorPage from '@/pages/ErrorPage/ErrorPage' import FavoritesPage from '@/pages/FavoritesPage/FavoritesPage' import { FeedbackPage } from '@/pages/FeedbackPage/FeedbackPage' @@ -60,7 +61,7 @@ export const AppRouter = createBrowserRouter([ }, { path: Routes.DELIVERY, - element: // временная заглушка нужна страница с информацией о доставке + element: }, { path: Routes.FAVORITES, diff --git a/src/entities/AboutUs/ui/AboutUs.module.scss b/src/entities/AboutUs/ui/AboutUs.module.scss index 6ffa0ae5..352c85a6 100644 --- a/src/entities/AboutUs/ui/AboutUs.module.scss +++ b/src/entities/AboutUs/ui/AboutUs.module.scss @@ -5,6 +5,4 @@ font-size: 16px; font-weight: 400; color: var.$body-color; - margin: 0; - padding: 30px 0 56px; } diff --git a/src/entities/ProductEntity/ui/ProductEntity/ProductEntity.tsx b/src/entities/ProductEntity/ui/ProductEntity/ProductEntity.tsx index de1d2271..ff419818 100644 --- a/src/entities/ProductEntity/ui/ProductEntity/ProductEntity.tsx +++ b/src/entities/ProductEntity/ui/ProductEntity/ProductEntity.tsx @@ -1,6 +1,6 @@ import { type FC } from 'react' -import { IProductData } from '@/pages/CartPage/model/types' +import { IProduct } from '@/models/ProductModel' import Subheading from '@/shared/ui/Subheading/Subheading' import styles from './ProductEntity.module.scss' @@ -14,11 +14,13 @@ import styles from './ProductEntity.module.scss' * @param {string} currency - валюта, в которой обозначена стоимость; */ -export const ProductEntity: FC = product => { +export const ProductEntity: FC = product => { return (
- {'product'} + {product.images.length > 0 && ( + {'product'} + )}
{product.id} diff --git a/src/features/CartEdit/model/selectors.ts b/src/features/CartEdit/model/selectors.ts new file mode 100644 index 00000000..2963212e --- /dev/null +++ b/src/features/CartEdit/model/selectors.ts @@ -0,0 +1,9 @@ +import { StateSchema } from '@/app/providers/StoreProvider' + +export const putIncreaseProductAmountSelector = (state: StateSchema) => { + return state.productAmount.isIncreaseSuccessful +} + +export const getProductListSelector = (state: StateSchema) => { + return state.productAmount.productList +} diff --git a/src/features/CartEdit/model/services/putIncreaseProductAmount.ts b/src/features/CartEdit/model/services/putIncreaseProductAmount.ts new file mode 100644 index 00000000..a4e3951b --- /dev/null +++ b/src/features/CartEdit/model/services/putIncreaseProductAmount.ts @@ -0,0 +1,25 @@ +import { createAsyncThunk } from '@reduxjs/toolkit' + +import { ThunkConfig } from '@/app/providers/StoreProvider/config/StateSchema' +import { IProductCartList } from '@/models/ProductCartListModel' +import { apiErrorIdentify } from '@/shared/api/apiErrorIdentify' +import { ApiError, ApiErrorTypes, ApiRoutes } from '@/shared/api/types' + +export const putIncreaseProductAmount = createAsyncThunk>( + 'cart-increase-product-amount', + async (productId, thunkAPI) => { + const { rejectWithValue, extra } = thunkAPI + try { + const { data } = await extra.api.put( + `api/${ApiRoutes.INCREASE_PRODUCT_AMOUNT}`, + { product: productId }, + { + withCredentials: true + } + ) + return data + } catch (error) { + return rejectWithValue(apiErrorIdentify(error, ApiErrorTypes.DATA_EMPTY_ERROR)) + } + } +) diff --git a/src/features/CartEdit/model/slice/productAmountSlice.ts b/src/features/CartEdit/model/slice/productAmountSlice.ts new file mode 100644 index 00000000..551f9570 --- /dev/null +++ b/src/features/CartEdit/model/slice/productAmountSlice.ts @@ -0,0 +1,52 @@ +import { createSlice } from '@reduxjs/toolkit' + +import { rejectedPayloadHandle } from '@/shared/api/rejectedPayloadHandle' + +import { putIncreaseProductAmount } from '../services/putIncreaseProductAmount' +import { IProductAmountStateSchema } from '../types' + +const initialState: IProductAmountStateSchema = { + isIncreaseSuccessful: false, + productList: { + amount: 0, + product: { + id: 0, + category: 'string', + brand: 'string', + images: [], + price: '', + name: '', + slug: '', + description: '', + code: 2147483647, + wb_urls: '' + }, + full_price: 0 + } +} + +export const productAmountSlice = createSlice({ + name: 'cart/product/amount', + initialState, + reducers: { + setProductList: (state, { payload }) => { + state.productList = payload + } + }, + extraReducers: builder => { + builder + .addCase(putIncreaseProductAmount.pending, state => { + state.isIncreaseSuccessful = false + }) + .addCase(putIncreaseProductAmount.fulfilled, (state, { payload }) => { + state.isIncreaseSuccessful = true + state.productList = payload + }) + .addCase(putIncreaseProductAmount.rejected, (state, { payload }) => { + state.isIncreaseSuccessful = false + state.error = rejectedPayloadHandle(payload) + }) + } +}) + +export const { actions: productAmountActions, reducer: productAmountReducer } = productAmountSlice diff --git a/src/features/CartEdit/model/types.ts b/src/features/CartEdit/model/types.ts new file mode 100644 index 00000000..75772578 --- /dev/null +++ b/src/features/CartEdit/model/types.ts @@ -0,0 +1,7 @@ +import { IProductCartList } from '@/models/ProductCartListModel' + +export interface IProductAmountStateSchema { + isIncreaseSuccessful: boolean + productList: IProductCartList + error?: string | string[] +} diff --git a/src/features/CartEdit/ui/CartEdit/CartEdit.stories.tsx b/src/features/CartEdit/ui/CartEdit/CartEdit.stories.tsx index 76c6cf17..7013b639 100644 --- a/src/features/CartEdit/ui/CartEdit/CartEdit.stories.tsx +++ b/src/features/CartEdit/ui/CartEdit/CartEdit.stories.tsx @@ -28,22 +28,25 @@ type Story = StoryObj export const Default: Story = { args: { cartId: 85, - amount: 2, - product: { - id: 1, - category: 'техника', - brand: 'Tefal', - images: [ - { - image: image1 - } - ], - price: '1000', - name: 'Tefal Iron', - slug: '1hfjnfjkf', - description: 'Functional', - code: 108290, - wb_urls: 'jnfne' + productList: { + amount: 1, + product: { + id: 1, + category: 'техника', + brand: 'Tefal', + images: [ + { + image: image1 + } + ], + price: '1000', + name: 'Tefal Iron', + slug: '1hfjnfjkf', + description: 'Functional', + code: 108290, + wb_urls: 'jnfne' + }, + full_price: 0 } } } diff --git a/src/features/CartEdit/ui/CartEdit/CartEdit.tsx b/src/features/CartEdit/ui/CartEdit/CartEdit.tsx index fe9e6bb7..a03a17d9 100644 --- a/src/features/CartEdit/ui/CartEdit/CartEdit.tsx +++ b/src/features/CartEdit/ui/CartEdit/CartEdit.tsx @@ -1,32 +1,39 @@ -import { useState } from 'react' +import { useEffect, useState } from 'react' +import { useSelector } from 'react-redux' import ArrowIcon from '@/assets/images/cart/arrow-right.svg' import { ProductEntity } from '@/entities/ProductEntity/ui/ProductEntity/ProductEntity' -import { IProductData } from '@/pages/CartPage/model/types' +import { IProductCartList } from '@/models/ProductCartListModel' +import { useAppDispatch } from '@/shared/libs/hooks/store' import { Button } from '@/shared/ui/Button/Button' import ButtonDots from '@/shared/ui/ButtonDots/ButtonDots' import Paragraph from '@/shared/ui/Paragraph/Paragraph' import Subheading from '@/shared/ui/Subheading/Subheading' +import { getProductListSelector } from '../../model/selectors' +import { putIncreaseProductAmount } from '../../model/services/putIncreaseProductAmount' +import { productAmountActions } from '../../model/slice/productAmountSlice' + import styles from './CartEdit.module.scss' export type TCartEditProps = { cartId: number - amount: number - product: IProductData + productList: IProductCartList } /** * Компонент используется для отображения добавленных в корзину продуктов, изменения кол-ва продуктов в корзине, * для удаления продуктов из корзины, для добавления продуктов в закладки * @param {number} cartId - id корзины - * @param {number} amount - количество товаров в корзине - * @param {IProductData} product - это продукт для определения состояния + * @param {IProductCartList} productList - это продукт для определения состояния */ // eslint-disable-next-line @typescript-eslint/no-unused-vars -export const CartEdit: React.FC = ({ cartId, amount, product }: TCartEditProps) => { +export const CartEdit: React.FC = ({ cartId, productList }: TCartEditProps) => { const [needToOpenContextMenuButtonDots, setNeedToOpen] = useState(false) + const dispatch = useAppDispatch() + + const productListState: IProductCartList = useSelector(getProductListSelector) function deleteProductHandler() { setNeedToOpen(false) @@ -37,7 +44,7 @@ export const CartEdit: React.FC = ({ cartId, amount, product }: } function increaseAmountHandler() { - // tbd https://github.com/Studio-Yandex-Practicum/maxboom_frontend/issues/317 + dispatch(putIncreaseProductAmount(productListState.product.id)) } function decreaseAmountHandler() { @@ -48,20 +55,25 @@ export const CartEdit: React.FC = ({ cartId, amount, product }: //tbd https://github.com/Studio-Yandex-Practicum/maxboom_frontend/issues/316 } + useEffect(() => { + dispatch(productAmountActions.setProductList(productList)) + }, [productList]) + return ( <>
- +
{' '} - {amount * Number(product.price)} {product.brand} + {productListState.amount * Number(productListState.product.price)}{' '} + {productListState.product.brand} {/* currency, not brand, c Number непонятно пока*/} {' '} - {product.price} {product.brand}/шт + {productListState.product.price} {productListState.product.brand}/шт {/* currency, not brand */}
@@ -74,7 +86,7 @@ export const CartEdit: React.FC = ({ cartId, amount, product }: { const dispatch = useDispatch() const aboutUs = useSelector(getAboutUsSelector) @@ -22,20 +26,17 @@ const AboutUsPage = () => { return ( - {aboutUs?.map((item, index) => ( - - {item.headline} - - ))} - - - - Главная - {' '} - / О нас - - - {aboutUs?.map((item, index) => )} +
+
+ {aboutUs?.map((item, index) => ( + + {item.headline} + + ))} + +
+ {aboutUs?.map((item, index) => )} +
) } diff --git a/src/pages/CartPage/CartPage.tsx b/src/pages/CartPage/CartPage.tsx index 3c18d99e..4e5b4802 100644 --- a/src/pages/CartPage/CartPage.tsx +++ b/src/pages/CartPage/CartPage.tsx @@ -5,6 +5,7 @@ import { Link } from 'react-router-dom' import WrapperForMainContent from '@/components/WrapperForMainContent/WrapperForMainContent' import { CartCouponApply } from '@/features/CartCouponApply/ui/CartCouponApply/CartCouponApply' import { CartEdit } from '@/features/CartEdit/ui/CartEdit/CartEdit' +import { ICart } from '@/models/CartModel' import { useAppDispatch } from '@/shared/libs/hooks/store' import Heading, { HeadingType } from '@/shared/ui/Heading/Heading' import Subheading from '@/shared/ui/Subheading/Subheading' @@ -13,7 +14,6 @@ import { MakeOrder } from '@/widgets/MakeOrder/ui/MakeOrder/MakeOrder' import styles from './CartPage.module.scss' import { getCartSelector } from './model/selector' import { getCartList } from './model/services' -import { ICart } from './model/types' /** * Компонент страница корзины. На странице отображаются товары в корзине, можно изменять кол-во товаров в корзине, @@ -47,9 +47,7 @@ const CartPage = () => {
{cart.products.map(item => { - return ( - - ) + return })}
diff --git a/src/pages/CartPage/model/services.ts b/src/pages/CartPage/model/services.ts index a3485d7c..9ca83161 100644 --- a/src/pages/CartPage/model/services.ts +++ b/src/pages/CartPage/model/services.ts @@ -1,11 +1,10 @@ import { createAsyncThunk } from '@reduxjs/toolkit' import { ThunkConfig } from '@/app/providers/StoreProvider/config/StateSchema' +import { ICart } from '@/models/CartModel' import { apiErrorIdentify } from '@/shared/api/apiErrorIdentify' import { ApiError, ApiErrorTypes, ApiRoutes } from '@/shared/api/types' -import { ICart } from './types' - export const getCartList = createAsyncThunk>( 'cart', async (_, thunkAPI) => { diff --git a/src/pages/CartPage/model/types.ts b/src/pages/CartPage/model/types.ts index 93f4006f..92642884 100644 --- a/src/pages/CartPage/model/types.ts +++ b/src/pages/CartPage/model/types.ts @@ -1,35 +1,4 @@ -export interface ICart { - id: number - products: IProductListData[] - user: number - cart_full_price: number -} - -export interface IProductListData { - amount: number - product: IProductData - full_price: number -} -export interface IProductData { - id: number - category: string - brand: string - images: IImageData[] - price: string - name: string - slug: string - description: string - code: number - wb_urls: string - quantity?: number - is_deleted?: boolean - wholesale?: number - label_hit?: boolean - label_popular?: boolean -} -export interface IImageData { - image: string -} +import { ICart } from '@/models/CartModel' export interface ICartSchema { isLoading: boolean diff --git a/src/pages/ContactsPage/ContactsPage.module.scss b/src/pages/ContactsPage/ContactsPage.module.scss index e6f2f6b4..595d672e 100644 --- a/src/pages/ContactsPage/ContactsPage.module.scss +++ b/src/pages/ContactsPage/ContactsPage.module.scss @@ -1,9 +1,19 @@ -.heading { - align-self: flex-start; - padding: 30px; -} - .contacts { + display: flex; + flex-direction: column; + padding-top: 24px; + padding-bottom: 56px; + + &__titleBox { + display: flex; + flex-direction: column; + gap: 10px; + width: 100%; + max-width: 1330px; + margin: 0 auto; + padding-bottom: 30px; + } + &__map { width: 100%; width: 500px; diff --git a/src/pages/ContactsPage/ContactsPage.tsx b/src/pages/ContactsPage/ContactsPage.tsx index 1a438dba..4e423797 100644 --- a/src/pages/ContactsPage/ContactsPage.tsx +++ b/src/pages/ContactsPage/ContactsPage.tsx @@ -3,15 +3,24 @@ import { Link } from 'react-router-dom' import YMap from '@/assets/icons/YMap.svg' import FormQuestion from '@/features/FormQuestion/ui/FormQuestion' +import Breadcrumbs from '@/shared/ui/Breadcrumbs/Breadcrumbs' import Heading, { HeadingType } from '@/shared/ui/Heading/Heading' import Map from '@/widgets/Map/Map' import styles from './ContactsPage.module.scss' +const links = [ + { heading: 'Главная', href: '/' }, + { heading: 'Контакты', href: '' } +] + const ContactsPage: FC = () => { return ( -
- Контакты +
+
+ Контакты + +
@@ -69,7 +78,7 @@ const ContactsPage: FC = () => {
-
+ ) } diff --git a/src/pages/DeliveryPage/DeliveryPage.module.scss b/src/pages/DeliveryPage/DeliveryPage.module.scss new file mode 100644 index 00000000..51b13192 --- /dev/null +++ b/src/pages/DeliveryPage/DeliveryPage.module.scss @@ -0,0 +1,13 @@ +.delivery { + display: flex; + flex-direction: column; + gap: 30px; + width: 100%; + padding: 0 0 56px; + + &__titleBox { + display: flex; + flex-direction: column; + gap: 10px; + } +} diff --git a/src/pages/DeliveryPage/DeliveryPage.tsx b/src/pages/DeliveryPage/DeliveryPage.tsx new file mode 100644 index 00000000..8abdd721 --- /dev/null +++ b/src/pages/DeliveryPage/DeliveryPage.tsx @@ -0,0 +1,25 @@ +import WrapperForMainContent from '@/components/WrapperForMainContent/WrapperForMainContent' +import Breadcrumbs from '@/shared/ui/Breadcrumbs/Breadcrumbs' +import Heading, { HeadingType } from '@/shared/ui/Heading/Heading' + +import styles from './DeliveryPage.module.scss' + +const links = [ + { heading: 'Главная', href: '/' }, + { heading: 'Информация о доставке', href: '' } +] + +const DeliveryPage = () => { + return ( + +
+
+ Информация о доставке + +
+
+
+ ) +} + +export default DeliveryPage diff --git a/src/pages/ProductPage/ProductPage.module.scss b/src/pages/ProductPage/ProductPage.module.scss new file mode 100644 index 00000000..d4a58af9 --- /dev/null +++ b/src/pages/ProductPage/ProductPage.module.scss @@ -0,0 +1,6 @@ +.pageDescriptor { + width: 100%; + display: flex; + flex-direction: column; + gap: 10px; +} diff --git a/src/pages/ProductPage/ProductPage.tsx b/src/pages/ProductPage/ProductPage.tsx index 11ba00f2..e48395a1 100644 --- a/src/pages/ProductPage/ProductPage.tsx +++ b/src/pages/ProductPage/ProductPage.tsx @@ -4,8 +4,9 @@ import { useParams } from 'react-router' import { StateSchema } from '@/app/providers/StoreProvider' import { AppDispatch } from '@/app/providers/StoreProvider/config/store' -import { PageDescription } from '@/components/PageDescription/PageDescription' import WrapperForMainContent from '@/components/WrapperForMainContent/WrapperForMainContent' +import Breadcrumbs from '@/shared/ui/Breadcrumbs/Breadcrumbs' +import Heading from '@/shared/ui/Heading/Heading' import Advantages from '@/widgets/Advantages/ui/Advantages/Advantages' import { Product } from '@/widgets/Product/Product' import { ProductInfo } from '@/widgets/ProductInfo/ProductInfo' @@ -13,6 +14,7 @@ import { ViewedProducts } from '@/widgets/ViewedProducts/ViewedProducts' import { addToViewedProducts } from './model/functions/functions' import { getProduct } from './model/slice/productSlice' +import styles from './ProductPage.module.scss' /** * Страница с выбранным товаром. @@ -23,6 +25,11 @@ export const ProductPage = () => { const productStore = useSelector((store: StateSchema) => store.product) const { slug } = useParams() + const links = [ + { heading: 'Главная', href: '/' }, + { heading: productStore.product.name, href: '' } + ] + useEffect(() => { if (slug) dispatch(getProduct(slug)) }, [slug]) @@ -34,7 +41,10 @@ export const ProductPage = () => { return ( <> - +
+ {productStore.product.name} + +
diff --git a/src/pages/RootPage/RootPage.tsx b/src/pages/RootPage/RootPage.tsx index 3da8245d..4111c809 100644 --- a/src/pages/RootPage/RootPage.tsx +++ b/src/pages/RootPage/RootPage.tsx @@ -9,14 +9,14 @@ import styles from './root.module.scss' const RootPage = () => { return ( - <> +
- +
) } diff --git a/src/pages/RootPage/root.module.scss b/src/pages/RootPage/root.module.scss index fba92b0c..64b81395 100644 --- a/src/pages/RootPage/root.module.scss +++ b/src/pages/RootPage/root.module.scss @@ -1,3 +1,10 @@ +.rootPageWrapper { + display: grid; + grid-template-rows: auto 1fr auto; + min-height: 100vh; + margin: 0; +} + .main { display: flex; flex-direction: column; diff --git a/src/shared/api/types.ts b/src/shared/api/types.ts index 33984230..db6103c4 100644 --- a/src/shared/api/types.ts +++ b/src/shared/api/types.ts @@ -12,7 +12,8 @@ export enum ApiRoutes { CORE_BASE = 'core/base', STORIES = 'stories', PRODUCT = 'catalogue', - CART_LIST = 'cart' + CART_LIST = 'cart', + INCREASE_PRODUCT_AMOUNT = 'cart/add/' } export enum ApiErrorTypes { diff --git a/src/shared/ui/Breadcrumbs/Breadcrumbs.module.scss b/src/shared/ui/Breadcrumbs/Breadcrumbs.module.scss index 08c7b456..1d2ce11f 100644 --- a/src/shared/ui/Breadcrumbs/Breadcrumbs.module.scss +++ b/src/shared/ui/Breadcrumbs/Breadcrumbs.module.scss @@ -1,9 +1,14 @@ @use '../../styles/utils/variables' as var; .breadcrumbs { - display: flex; + display: flex; } .link { - color: var.$subtitle-color; + color: var.$subtitle-color; + transition: color 0.3s; + + &:hover { + color: var.$theme-secondary-color; + } } diff --git a/src/shared/ui/Breadcrumbs/Breadcrumbs.tsx b/src/shared/ui/Breadcrumbs/Breadcrumbs.tsx index db1d80ac..5ba8c814 100644 --- a/src/shared/ui/Breadcrumbs/Breadcrumbs.tsx +++ b/src/shared/ui/Breadcrumbs/Breadcrumbs.tsx @@ -26,11 +26,11 @@ const Breadcrumbs: FC = ({ links }) => { {links.map((link, index) => { return ( (index !== links.length - 1 && ( - - - {link.heading}{' '} + + + {link.heading} - {` / `} +  /  )) || {link.heading} ) diff --git a/src/shared/ui/logo/Logo.tsx b/src/shared/ui/logo/Logo.tsx index 26f1f99a..11900fa6 100644 --- a/src/shared/ui/logo/Logo.tsx +++ b/src/shared/ui/logo/Logo.tsx @@ -1,29 +1,26 @@ import { type FC } from 'react' +import { Routes } from '@/shared/config/routerConfig/routes' import Link from '@/shared/ui/Link/Link' import styles from './logo.module.scss' type TLogoProps = { image: string - title: string - url: string width: string height: string } /** * @param {string} image - путь к логотипу на сервере - * @param {string} title - лейбл логотипа (и альт) - * @param {string} url - путь ссылки по нажатию на логотип * @param {string} width - ширина логотипа * @param {string} height - высота логотипа */ -const Logo: FC = ({ image, title, url, width, height }) => { +const Logo: FC = ({ image, width, height }) => { return (
- - {title} + + Logo
) diff --git a/src/widgets/Footer/Footer.tsx b/src/widgets/Footer/Footer.tsx index 29571da2..43e1d3a8 100644 --- a/src/widgets/Footer/Footer.tsx +++ b/src/widgets/Footer/Footer.tsx @@ -45,13 +45,7 @@ function Footer() {
- + {coreBaseData.footer.company_info}
diff --git a/src/widgets/Header/Header.tsx b/src/widgets/Header/Header.tsx index 47f96951..93e316af 100644 --- a/src/widgets/Header/Header.tsx +++ b/src/widgets/Header/Header.tsx @@ -68,7 +68,7 @@ function Header() { () => (
  • - + Информация о доставке
  • @@ -147,13 +147,7 @@ function Header() {
- +
diff --git a/src/widgets/Header/model/slice/headerSlice.tsx b/src/widgets/Header/model/slice/headerSlice.tsx index cedba396..c627969f 100644 --- a/src/widgets/Header/model/slice/headerSlice.tsx +++ b/src/widgets/Header/model/slice/headerSlice.tsx @@ -9,9 +9,7 @@ const initialState: CoreBaseHeaderSchema = { isLoading: false, header: { main_logo: { - image: '', - url: '', - title: '' + image: '' }, support: { callback: '', diff --git a/src/widgets/Header/model/types/types.tsx b/src/widgets/Header/model/types/types.tsx index 386f9f42..7e51401f 100644 --- a/src/widgets/Header/model/types/types.tsx +++ b/src/widgets/Header/model/types/types.tsx @@ -1,7 +1,5 @@ interface Logo { image: string - url: string - title: string } interface Support {