-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of github.com:Studio-Yandex-Practicum/maxboom_f…
…rontend into enhancement_289_favorite-page
- Loading branch information
Showing
70 changed files
with
1,398 additions
and
140 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
import SideBarButton from './ui/SideBarButton' | ||
export default SideBarButton |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
@use '@/shared/styles/utils/variables' as var; | ||
|
||
.sideBarButton { | ||
display: flex; | ||
justify-content: space-between; | ||
align-items: center; | ||
gap: 10px; | ||
width: fit-content; | ||
background: var.$white; | ||
font-size: 14px; | ||
color: var.$body-color; | ||
fill: var.$body-color; | ||
padding: 5px 15px; | ||
transition: 0.25s; | ||
} | ||
|
||
.sideBarButton:hover { | ||
color: var.$header-color; | ||
fill: var.$header-color; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import type { Meta, StoryObj } from '@storybook/react' | ||
|
||
import SideBarButton from './SideBarButton' | ||
|
||
const meta = { | ||
title: 'entities/SideBarButton', | ||
component: SideBarButton, | ||
parameters: { | ||
layout: 'centered' | ||
}, | ||
tags: ['autodocs'] | ||
} satisfies Meta<typeof SideBarButton> | ||
|
||
export default meta | ||
type Story = StoryObj<typeof meta> | ||
|
||
export const Default: Story = {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { FC } from 'react' | ||
|
||
import CategoryIcon from '@/assets/images/sideBarMenu/iconCategory.svg' | ||
import { Button, ButtonDesign, ButtonSize } from '@/shared/ui/Button/Button' | ||
|
||
import styles from './SideBarButton.module.scss' | ||
|
||
interface ISideBarButton { | ||
onClick: () => void | ||
} | ||
|
||
/** | ||
* Компонент кнопки "Меню" - для адаптива Side Bar Menu | ||
* @param {function} onClick - функция клика для открытия модального окна SideBarMenuModal | ||
*/ | ||
|
||
const SideBarButton: FC<ISideBarButton> = ({ onClick }) => { | ||
return ( | ||
<Button | ||
design={ButtonDesign.SQUARE} | ||
size={ButtonSize.S} | ||
type="button" | ||
onClick={onClick} | ||
className={styles.sideBarButton}> | ||
<span>Меню</span> | ||
<CategoryIcon /> | ||
</Button> | ||
) | ||
} | ||
|
||
export default SideBarButton |
23 changes: 23 additions & 0 deletions
23
src/features/CartEdit/model/services/putDecreaseProductAmount.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { createAsyncThunk } from '@reduxjs/toolkit' | ||
|
||
import { ThunkConfig } from '@/app/providers/StoreProvider/config/StateSchema' | ||
import { apiErrorIdentify } from '@/shared/api/apiErrorIdentify' | ||
import { ApiError, ApiErrorTypes, ApiRoutes } from '@/shared/api/types' | ||
import { IProductCartList } from '@/shared/model/types/ProductCartListModel' | ||
|
||
export const putDecreaseProductAmount = createAsyncThunk<IProductCartList, number, ThunkConfig<ApiError>>( | ||
'cart-decrease-product-amount', | ||
async (productId, thunkAPI) => { | ||
const { rejectWithValue, extra } = thunkAPI | ||
try { | ||
const { data } = await extra.api.put( | ||
`api/${ApiRoutes.DECREASE_PRODUCT_AMOUNT}`, | ||
{ product: productId }, | ||
{ withCredentials: true } | ||
) | ||
return data | ||
} catch (error) { | ||
return rejectWithValue(apiErrorIdentify(error, ApiErrorTypes.DATA_EMPTY_ERROR)) | ||
} | ||
} | ||
) |
2 changes: 1 addition & 1 deletion
2
src/features/CartEdit/model/services/putIncreaseProductAmount.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,8 @@ | ||
import { IProductCartList } from '@/models/ProductCartListModel' | ||
import { IProductCartList } from '@/shared/model/types/ProductCartListModel' | ||
|
||
export interface IProductAmountStateSchema { | ||
isIncreaseSuccessful: boolean | ||
isDecreaseSuccessful: boolean | ||
productList: IProductCartList | ||
error?: string | string[] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
import SideBar from './ui/SideBar' | ||
export default SideBar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
@use '@/shared/styles/utils/variables' as var; | ||
@use '@/shared/styles/utils/mixins' as media; | ||
|
||
.sideBar { | ||
display: flex; | ||
flex-direction: column; | ||
min-width: 100%; | ||
border-radius: 5px; | ||
|
||
&__header { | ||
display: flex; | ||
justify-content: space-between; | ||
align-items: center; | ||
width: 100%; | ||
background: var.$body-bg; | ||
border-radius: 6px; | ||
padding: 10px 10px 10px 15px; | ||
cursor: pointer; | ||
transition: 0.25s; | ||
} | ||
|
||
&__headerText { | ||
transition: 0.25s; | ||
} | ||
|
||
&__headerArrow { | ||
fill: var.$body-color; | ||
transition: 0.25s; | ||
} | ||
|
||
&__headerArrow_active { | ||
transform: rotate(180deg); | ||
} | ||
|
||
&__header:hover &__headerText { | ||
color: var.$header-color; | ||
} | ||
|
||
&__header:hover &__headerArrow path { | ||
fill: var.$header-color; | ||
} | ||
|
||
&__children { | ||
padding: 15px 0 20px; | ||
transition: 0.5s; | ||
|
||
&_close { | ||
padding: 0; | ||
} | ||
} | ||
} |
Oops, something went wrong.