generated from gravity-ui/package-example
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ChangelogDialog): loading state
- Loading branch information
Showing
4 changed files
with
155 additions
and
14 deletions.
There are no files selected for viewing
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
68 changes: 68 additions & 0 deletions
68
src/components/ChangelogDialog/components/ItemSkeleton/ItemSkeleton.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,68 @@ | ||
@use '@gravity-ui/uikit/styles/mixins'; | ||
@use '../../../variables'; | ||
|
||
$block: '.#{variables.$ns}changelog-dialog-item'; | ||
$metaWidth: 80px; | ||
|
||
#{$block} { | ||
display: flex; | ||
|
||
&__meta { | ||
width: $metaWidth; | ||
} | ||
|
||
&__date { | ||
line-height: var(--g-text-subheader-3-line-height); | ||
} | ||
|
||
&__date-skeleton { | ||
width: 80px; | ||
height: 20px; | ||
} | ||
|
||
&__label-new-skeleton { | ||
margin-top: var(--g-spacing-2); | ||
width: 42px; | ||
height: 20px; | ||
} | ||
|
||
&__content { | ||
flex: 1; | ||
margin-left: var(--g-spacing-5); | ||
} | ||
|
||
&__title { | ||
margin: 0; | ||
} | ||
|
||
&__title-skeleton { | ||
width: 100%; | ||
height: 20px; | ||
} | ||
|
||
&__image-skeleton { | ||
width: 100%; | ||
height: 258px; | ||
margin-top: var(--g-spacing-3); | ||
border-radius: 16px; | ||
} | ||
|
||
&__description { | ||
margin-top: var(--g-spacing-3); | ||
} | ||
|
||
&__description-skeleton { | ||
width: 100%; | ||
height: 54px; | ||
} | ||
|
||
&__button-skeleton { | ||
margin-top: var(--g-spacing-4); | ||
width: 86px; | ||
height: 28px; | ||
} | ||
|
||
&__button-skeleton + &__button-skeleton { | ||
margin-left: var(--g-spacing-4); | ||
} | ||
} |
51 changes: 51 additions & 0 deletions
51
src/components/ChangelogDialog/components/ItemSkeleton/ItemSkeleton.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,51 @@ | ||
import React from 'react'; | ||
|
||
import {Skeleton} from '@gravity-ui/uikit'; | ||
|
||
import {block} from '../../../utils/cn'; | ||
|
||
import './ItemSkeleton.scss'; | ||
|
||
const b = block('changelog-dialog-item'); | ||
|
||
interface ItemSkeletonProps { | ||
className?: string; | ||
isNew?: boolean; | ||
withImage?: boolean; | ||
withDescription?: boolean; | ||
withLink?: boolean; | ||
withStory?: boolean; | ||
} | ||
|
||
export function ItemSkeleton({ | ||
className, | ||
withImage, | ||
isNew, | ||
withDescription, | ||
withLink, | ||
withStory, | ||
}: ItemSkeletonProps) { | ||
return ( | ||
<article className={b(null, className)}> | ||
<div className={b('meta')}> | ||
<div className={b('date')}> | ||
<Skeleton className={b('date-skeleton')} /> | ||
{isNew && <Skeleton className={b('label-new-skeleton')} />} | ||
</div> | ||
</div> | ||
<div className={b('content')}> | ||
<h3 className={b('title')}> | ||
<Skeleton className={b('title-skeleton')} /> | ||
</h3> | ||
{withImage && <Skeleton className={b('image-skeleton')} />} | ||
{withDescription && ( | ||
<div className={b('description')}> | ||
<Skeleton className={b('description-skeleton')} /> | ||
</div> | ||
)} | ||
{withLink && <Skeleton className={b('button-skeleton')} />} | ||
{withStory && <Skeleton className={b('button-skeleton')} />} | ||
</div> | ||
</article> | ||
); | ||
} |