-
Notifications
You must be signed in to change notification settings - Fork 11
YH-2029: update skeleton for CollectionPage #1277
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Changes from all commits
35ec77b
f578806
da85942
2290186
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,2 @@ | ||
| export { CollectionPage } from './ui/CollectionPage/CollectionPage'; | ||
| export { CollectionPageContentSkeleton } from './ui/CollectionPageContent/CollectionPageContent.skeleton'; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -140,5 +140,4 @@ | |
| width: 360px; | ||
| height: auto; | ||
| } | ||
| } | ||
|
|
||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,139 +1,49 @@ | ||
| import classNames from 'classnames'; | ||
|
|
||
| import { useScreenSize } from '@/shared/libs'; | ||
| import { Card } from '@/shared/ui/Card'; | ||
| import { Skeleton } from '@/shared/ui/Skeleton'; | ||
| import { BackHeaderSkeleton } from '@/shared/ui/BackHeader'; | ||
| import { ButtonSkeleton } from '@/shared/ui/Button'; | ||
|
|
||
| import { DeleteQuestionButtonSkeleton } from '@/features/question/deleteQuestion'; | ||
|
|
||
| import { | ||
| AdditionalInfoSkeleton, | ||
| CollectionBodySkeleton, | ||
| CollectionHeaderSkeleton, | ||
| } from '@/widgets/Collection'; | ||
| import { TasksControllerSkeleton } from '@/widgets/task/TasksList'; | ||
|
|
||
| import styles from './CollectionPage.module.css'; | ||
|
|
||
| export const CollectionPageSkeleton = () => { | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [ISSUE] - Сейчас скелетон не отрабатывает корректно, так как в CollectionPage стоит проверка на наличие коллекции. Ее нужно убрать, так как до получения коллекции показывается заглушка, которой не должно быть |
||
| const { isMobile } = useScreenSize(); | ||
| const { isSmallScreen } = useScreenSize(); | ||
|
|
||
| if (isMobile) { | ||
| if (isSmallScreen) { | ||
| return ( | ||
| <section className={classNames(styles.wrapper, styles.mobile)}> | ||
| <Card> | ||
| <div className={styles.header}> | ||
| <Skeleton width={54} height={56} borderRadius={16} style={{ flexShrink: 0 }} /> | ||
| <div className={styles['title-wrapper']}> | ||
| <Skeleton width="80%" height={22} /> | ||
| <Skeleton width="40%" height={22} /> | ||
| </div> | ||
| <Skeleton width={54} height={19} borderRadius={30} style={{ marginLeft: 'auto' }} /> | ||
| </div> | ||
| </Card> | ||
| <Card> | ||
| <Skeleton width={120} height={22} style={{ marginBottom: '16px' }} /> | ||
| <Skeleton width="60%" height={22} style={{ marginBottom: '10px' }} /> | ||
| <Skeleton width="100%" height={16} /> | ||
| </Card> | ||
| <Card> | ||
| <div className={styles.info}> | ||
| <Skeleton width={50} height={22} /> | ||
| <div className={styles.params}> | ||
| <Skeleton width={100} height={30} /> | ||
| <Skeleton width={150} height={30} /> | ||
| </div> | ||
| </div> | ||
| <div className={styles.info}> | ||
| <Skeleton width={50} height={22} /> | ||
| <div className={styles.params}> | ||
| <Skeleton width={100} height={42} /> | ||
| <Skeleton width={140} height={42} /> | ||
| <Skeleton width={90} height={42} /> | ||
| </div> | ||
| </div> | ||
| <div className={styles.info}> | ||
| <Skeleton width={50} height={22} /> | ||
| <div className={styles.params}> | ||
| <Skeleton width={100} height={22} /> | ||
| <Skeleton width={160} height={22} /> | ||
| <Skeleton width={110} height={22} /> | ||
| </div> | ||
| </div> | ||
| </Card> | ||
| <Skeleton width={150} height={22} style={{ marginInline: 'auto' }} /> | ||
| <Card className={styles['actions-wrapper']}> | ||
| <div className={styles.actions}> | ||
| <Skeleton width={130} height={48} borderRadius={16} /> | ||
| <Skeleton width={130} height={48} borderRadius={16} /> | ||
| <Skeleton width={130} height={48} borderRadius={16} /> | ||
| </div> | ||
| </Card> | ||
| <Card> | ||
| <Skeleton width={140} height={22} style={{ marginBottom: '20px' }} /> | ||
| <Skeleton height={200} width="100%" /> | ||
| </Card> | ||
| <Card> | ||
| <Skeleton width={140} height={22} style={{ marginBottom: '20px' }} /> | ||
| <Skeleton height={200} /> | ||
| </Card> | ||
| <BackHeaderSkeleton> | ||
| <DeleteQuestionButtonSkeleton isDetailPage /> | ||
| <ButtonSkeleton width={180} /> | ||
| </BackHeaderSkeleton> | ||
| <CollectionHeaderSkeleton /> | ||
| <CollectionBodySkeleton /> | ||
| <TasksControllerSkeleton /> | ||
| </section> | ||
| ); | ||
| } | ||
|
|
||
| return ( | ||
| <section className={styles.wrapper}> | ||
| <div className={styles.main}> | ||
| <Card> | ||
| <div className={styles.header}> | ||
| <Skeleton width={170} height={114} borderRadius={24} style={{ flexShrink: 0 }} /> | ||
| <div className={styles['title-wrapper']}> | ||
| <Skeleton width="80%" height={44} /> | ||
| <Skeleton width="50%" height={22} /> | ||
| </div> | ||
| <Skeleton style={{ marginLeft: 'auto' }} width={78} height={19} borderRadius={30} /> | ||
| </div> | ||
| </Card> | ||
| <Card className={styles['actions-wrapper']}> | ||
| <div className={styles.actions}> | ||
| <Skeleton width={130} height={48} borderRadius={16} /> | ||
| <Skeleton width={130} height={48} borderRadius={16} /> | ||
| <Skeleton width={130} height={48} borderRadius={16} /> | ||
| </div> | ||
| </Card> | ||
| <Card> | ||
| <Skeleton width={140} height={22} style={{ marginBottom: '20px' }} /> | ||
| <Skeleton height={200} /> | ||
| </Card> | ||
| <Card> | ||
| <Skeleton width={170} height={22} style={{ marginBottom: '20px' }} /> | ||
| <Skeleton height={350} /> | ||
| </Card> | ||
| </div> | ||
| <div className={styles.additional}> | ||
| <Card> | ||
| <Skeleton width={120} height={22} style={{ marginBottom: '16px' }} /> | ||
| <Skeleton width="60%" height={22} style={{ marginBottom: '10px' }} /> | ||
| <Skeleton height={16} /> | ||
| </Card> | ||
| <Card> | ||
| <div className={styles.info}> | ||
| <Skeleton width={50} height={22} /> | ||
| <div className={styles.params}> | ||
| <Skeleton width={100} height={30} /> | ||
| <Skeleton width={150} height={30} /> | ||
| </div> | ||
| </div> | ||
| <div className={styles.info}> | ||
| <Skeleton width={50} height={22} /> | ||
| <div className={styles.params}> | ||
| <Skeleton width={100} height={42} /> | ||
| <Skeleton width={140} height={42} /> | ||
| <Skeleton width={90} height={42} /> | ||
| </div> | ||
| </div> | ||
| <div className={styles.info}> | ||
| <Skeleton width={50} height={22} /> | ||
| <div className={styles.params}> | ||
| <Skeleton width={100} height={22} /> | ||
| <Skeleton width={160} height={22} /> | ||
| <Skeleton width={110} height={22} /> | ||
| </div> | ||
| </div> | ||
| </Card> | ||
| <Skeleton width={150} height={22} style={{ marginInline: 'auto' }} /> | ||
| <BackHeaderSkeleton> | ||
| <DeleteQuestionButtonSkeleton isDetailPage /> | ||
| <ButtonSkeleton width={180} /> | ||
| </BackHeaderSkeleton> | ||
| <CollectionHeaderSkeleton /> | ||
| <CollectionBodySkeleton /> | ||
| <TasksControllerSkeleton /> | ||
| </div> | ||
| <AdditionalInfoSkeleton /> | ||
| </section> | ||
| ); | ||
| }; | ||
Uh oh!
There was an error while loading. Please reload this page.