-
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 pull request #329 from Studio-Yandex-Practicum/enhancement-305-…
…skeleton #305-skeletons
- Loading branch information
Showing
19 changed files
with
339 additions
and
13 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
28 changes: 28 additions & 0 deletions
28
src/components/PageControls/PageControlsSkeletons/PageControlsSkeletons.module.scss
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,28 @@ | ||
@use '../../../shared/styles/utils/variables' as var; | ||
|
||
.sk-page-controls { | ||
width: 100%; | ||
display: flex; | ||
justify-content: space-between; | ||
|
||
&__dropdowns { | ||
display: flex; | ||
gap: 12px; | ||
} | ||
|
||
&__dropdown { | ||
width: 150px; | ||
height: 36px; | ||
} | ||
|
||
&__cards-controls { | ||
display: flex; | ||
gap: 10px; | ||
} | ||
|
||
&__cards-control { | ||
width: 36px; | ||
height: 36px; | ||
border-radius: 6px; | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
src/components/PageControls/PageControlsSkeletons/PageControlsSkeletons.stories.tsx
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 { Meta, StoryObj } from '@storybook/react' | ||
import { type FC } from 'react' | ||
|
||
import { PageControlsSkeletons } from '@/components/PageControls/PageControlsSkeletons/PageControlsSkeletons' | ||
|
||
const StorybookWrapper: FC = () => { | ||
return ( | ||
<div> | ||
<PageControlsSkeletons /> | ||
</div> | ||
) | ||
} | ||
|
||
const meta = { | ||
title: 'shared/PageControlsSkeletons', | ||
component: StorybookWrapper, | ||
tags: ['autodocs'] | ||
} satisfies Meta<typeof StorybookWrapper> | ||
|
||
export default meta | ||
type Story = StoryObj<typeof meta> | ||
|
||
export const Default: Story = {} |
21 changes: 21 additions & 0 deletions
21
src/components/PageControls/PageControlsSkeletons/PageControlsSkeletons.tsx
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,21 @@ | ||
import { type FC } from 'react' | ||
import Skeleton from 'react-loading-skeleton' | ||
import 'react-loading-skeleton/dist/skeleton.css' | ||
|
||
import styles from './PageControlsSkeletons.module.scss' | ||
|
||
export const PageControlsSkeletons: FC = () => { | ||
return ( | ||
<div className={styles['sk-page-controls']}> | ||
<div className={styles['sk-page-controls__dropdowns']}> | ||
<Skeleton className={styles['sk-page-controls__dropdown']} inline={true} /> | ||
<Skeleton className={styles['sk-page-controls__dropdown']} inline={true} /> | ||
</div> | ||
<ul className={styles['sk-page-controls__cards-controls']}> | ||
<Skeleton className={styles['sk-page-controls__cards-control']} inline={true} /> | ||
<Skeleton className={styles['sk-page-controls__cards-control']} inline={true} /> | ||
<Skeleton className={styles['sk-page-controls__cards-control']} inline={true} /> | ||
</ul> | ||
</div> | ||
) | ||
} |
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
17 changes: 17 additions & 0 deletions
17
src/components/PageDescription/PageDescriptionSkeleton/PageDescriptionSkeleton.module.scss
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 @@ | ||
@use '../../../shared/styles/utils/variables' as var; | ||
|
||
.sk-content { | ||
width: 330px; | ||
height:30px | ||
} | ||
|
||
.sk-content__description { | ||
display: flex; | ||
flex-direction: column; | ||
align-self: flex-start; | ||
gap: 10px; | ||
} | ||
|
||
.sk-content__breadcrumbs { | ||
height: 16px; | ||
} |
23 changes: 23 additions & 0 deletions
23
src/components/PageDescription/PageDescriptionSkeleton/PageDescriptionSkeleton.stories.tsx
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 { Meta, StoryObj } from '@storybook/react' | ||
import { type FC } from 'react' | ||
|
||
import { PageDescriptionSkeleton } from '@/components/PageDescription/PageDescriptionSkeleton/PageDescriptionSkeleton' | ||
|
||
const StorybookWrapper: FC = () => { | ||
return ( | ||
<div> | ||
<PageDescriptionSkeleton /> | ||
</div> | ||
) | ||
} | ||
|
||
const meta = { | ||
title: 'shared/PageDescriptionSkeleton', | ||
component: StorybookWrapper, | ||
tags: ['autodocs'] | ||
} satisfies Meta<typeof StorybookWrapper> | ||
|
||
export default meta | ||
type Story = StoryObj<typeof meta> | ||
|
||
export const Default: Story = {} |
15 changes: 15 additions & 0 deletions
15
src/components/PageDescription/PageDescriptionSkeleton/PageDescriptionSkeleton.tsx
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,15 @@ | ||
import { type FC } from 'react' | ||
import Skeleton from 'react-loading-skeleton' | ||
|
||
import styles from '@/components/PageDescription/PageDescriptionSkeleton/PageDescriptionSkeleton.module.scss' | ||
|
||
export const PageDescriptionSkeleton: FC = () => { | ||
return ( | ||
<div className={styles['sk-content__description']}> | ||
<div> | ||
<Skeleton className={styles['sk-content']} inline={true} /> | ||
</div> | ||
<Skeleton className={styles['sk-content__breadcrumbs']} inline={true} /> | ||
</div> | ||
) | ||
} |
6 changes: 6 additions & 0 deletions
6
src/features/CategoryItem/CategoryItemSkeleton/CategoryItemSkeleton.module.scss
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,6 @@ | ||
.sk-category-list__item { | ||
display: flex; | ||
min-height: 45px; | ||
border-radius: 5px; | ||
margin-bottom: 5px; | ||
} |
23 changes: 23 additions & 0 deletions
23
src/features/CategoryItem/CategoryItemSkeleton/CategoryItemSkeleton.stories.tsx
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 { Meta, StoryObj } from '@storybook/react' | ||
import { type FC } from 'react' | ||
|
||
import { CategoryItemSkeleton } from '@/features/CategoryItem/CategoryItemSkeleton/CategoryItemSkeleton' | ||
|
||
const StorybookWrapper: FC = () => { | ||
return ( | ||
<div> | ||
<CategoryItemSkeleton /> | ||
</div> | ||
) | ||
} | ||
|
||
const meta = { | ||
title: 'features/CategoryItemSkeleton', | ||
component: StorybookWrapper, | ||
tags: ['autodocs'] | ||
} satisfies Meta<typeof StorybookWrapper> | ||
|
||
export default meta | ||
type Story = StoryObj<typeof meta> | ||
|
||
export const Default: Story = {} |
8 changes: 8 additions & 0 deletions
8
src/features/CategoryItem/CategoryItemSkeleton/CategoryItemSkeleton.tsx
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,8 @@ | ||
import { type FC } from 'react' | ||
import Skeleton from 'react-loading-skeleton' | ||
|
||
import styles from '@/features/CategoryItem/CategoryItemSkeleton/CategoryItemSkeleton.module.scss' | ||
|
||
export const CategoryItemSkeleton: FC = () => { | ||
return <Skeleton className={styles['sk-category-list__item']} inline={true} /> | ||
} |
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,5 +1,10 @@ | ||
import { StateSchema } from '@/app/providers/StoreProvider' | ||
import { RootState } from '@/app/providers/StoreProvider/config/store' | ||
|
||
export const getProductsOfCategorySelector = (state: StateSchema) => { | ||
return state.categoryProduct.productsData | ||
} | ||
|
||
export const getLoading = (state: RootState) => { | ||
return state.categoryProduct.isLoading | ||
} |
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
Oops, something went wrong.