-
Notifications
You must be signed in to change notification settings - Fork 11
YH-2049: add skeleton for CollectionCreatePage #1282
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
4d78c9e
5a2d0e4
0c618b0
116ae2f
6e75216
3c15ff6
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 |
|---|---|---|
| @@ -0,0 +1,84 @@ | ||
| import { Flex } from '@/shared/ui/Flex'; | ||
| import { FormControlSkeleton } from '@/shared/ui/FormControl'; | ||
| import { FormFieldSkeleton } from '@/shared/ui/FormField'; | ||
| import { ImageLoaderWithoutCropperSkeleton } from '@/shared/ui/ImageLoaderWithoutCropper'; | ||
| import { InputSkeleton } from '@/shared/ui/Input'; | ||
| import { KeywordInputSkeleton } from '@/shared/ui/KeywordInput'; | ||
| import { KeywordSelectSkeleton } from '@/shared/ui/KeywordSelect'; | ||
| import { RadioSkeleton } from '@/shared/ui/Radio'; | ||
| import { TextSkeleton } from '@/shared/ui/Text'; | ||
| import { TextAreaSkeleton } from '@/shared/ui/TextArea'; | ||
|
|
||
| import { CompanySelectSkeleton } from '@/entities/company/@x/collection'; | ||
| import { ChooseQuestionsDrawerSkeleton } from '@/entities/question/@x/collection'; | ||
| import { SpecializationSelectSkeleton } from '@/entities/specialization/@x/collection'; | ||
| import { ChooseTasksDrawerSkeleton } from '@/entities/task/@x/collection'; | ||
|
|
||
| import styles from './CollectionForm.module.css'; | ||
|
|
||
| export const CollectionFormSkeleton = () => { | ||
| return ( | ||
| <> | ||
| <TextSkeleton width={160} variant="body5" /> | ||
|
|
||
| <Flex direction="column" gap="60"> | ||
| <FormFieldSkeleton> | ||
| <FormControlSkeleton className={styles['skeleton-form-field']}> | ||
| <InputSkeleton size="L" /> | ||
| </FormControlSkeleton> | ||
| </FormFieldSkeleton> | ||
|
|
||
| <FormFieldSkeleton countTextFields={2}> | ||
| <FormControlSkeleton> | ||
| <CompanySelectSkeleton /> | ||
| </FormControlSkeleton> | ||
| </FormFieldSkeleton> | ||
|
|
||
| <FormFieldSkeleton direction="column"> | ||
| <FormControlSkeleton> | ||
| <TextAreaSkeleton | ||
| className={styles['skeleton-textarea']} | ||
| width={225} | ||
| height={80} | ||
| borderRadius={24} | ||
| /> | ||
| </FormControlSkeleton> | ||
| </FormFieldSkeleton> | ||
|
|
||
| <FormFieldSkeleton> | ||
| <ImageLoaderWithoutCropperSkeleton /> | ||
| </FormFieldSkeleton> | ||
|
|
||
| <FormFieldSkeleton> | ||
| <Flex gap="56"> | ||
| <RadioSkeleton /> | ||
| <RadioSkeleton /> | ||
| </Flex> | ||
| </FormFieldSkeleton> | ||
|
|
||
| <FormFieldSkeleton countTextFields={2}> | ||
| <FormControlSkeleton> | ||
| <SpecializationSelectSkeleton /> | ||
| </FormControlSkeleton> | ||
| </FormFieldSkeleton> | ||
|
|
||
| <FormFieldSkeleton> | ||
| <FormControlSkeleton className={styles['skeleton-keywords-control']}> | ||
| <Flex direction="column" gap="26" maxHeight={true}> | ||
| <KeywordSelectSkeleton /> | ||
| <KeywordInputSkeleton /> | ||
| </Flex> | ||
| </FormControlSkeleton> | ||
| </FormFieldSkeleton> | ||
|
|
||
| <FormControlSkeleton> | ||
| <ChooseQuestionsDrawerSkeleton /> | ||
| </FormControlSkeleton> | ||
|
|
||
| <FormControlSkeleton> | ||
| <ChooseTasksDrawerSkeleton /> | ||
| </FormControlSkeleton> | ||
| </Flex> | ||
| </> | ||
| ); | ||
| }; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,3 @@ | ||
| export type { Company } from '../model/types/companyTypes'; | ||
| export { CompanySelect } from '../ui/CompanySelect/CompanySelect'; | ||
| export { CompanySelectSkeleton } from '../ui/CompanySelect/CompanySelect.skeleton'; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| import { SelectWithChipsSkeleton } from '@/shared/ui/SelectWithChips'; | ||
|
|
||
| export const CompanySelectSkeleton = () => { | ||
| return <SelectWithChipsSkeleton />; | ||
| }; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,4 @@ | ||
| export type { Question, GeneratedQuestionDto } from '../model/types/question'; | ||
| export { ChooseQuestionsDrawer } from '../ui/ChooseQuestionsDrawer/ChooseQuestionsDrawer'; | ||
| export { ChooseQuestionsDrawerSkeleton } from '../ui/ChooseQuestionsDrawer/ChooseQuestionsDrawer.skeleton'; | ||
| export { GENERATED_QUESTIONS_LS_KEY } from '../model/constants/question'; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| import { ButtonSkeleton } from '@/shared/ui/Button'; | ||
| import { Flex } from '@/shared/ui/Flex'; | ||
| import { TextSkeleton } from '@/shared/ui/Text'; | ||
|
|
||
| import styles from './ChooseQuestionsDrawer.module.css'; | ||
|
|
||
| export const ChooseQuestionsDrawerSkeleton = () => { | ||
| return ( | ||
| <Flex justify="between"> | ||
| <Flex gap="120"> | ||
| <Flex direction="column" gap="8"> | ||
| <TextSkeleton variant="body4" width={170} /> | ||
| <TextSkeleton variant="body2" width={230} /> | ||
| </Flex> | ||
| <Flex direction="column" gap="24"> | ||
| <TextSkeleton variant="body3-accent" width={220} /> | ||
| </Flex> | ||
| </Flex> | ||
| <ButtonSkeleton className={styles['add-button']} width={174} size="medium" /> | ||
| </Flex> | ||
| ); | ||
| }; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,3 @@ | ||
| export type { Specialization } from '../model/types/specialization'; | ||
| export { SpecializationSelect } from '../ui/SpecializationSelect/SpecializationSelect'; | ||
| export { SpecializationSelectSkeleton } from '../ui/SpecializationSelect/SpecializationSelect.skeleton'; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,3 @@ | ||
| export { ChooseTasksDrawer } from '../ui/ChooseTasksDrawer'; | ||
| export { ChooseTasksDrawerSkeleton } from '../ui/ChooseTasksDrawer/ChooseTasksDrawer.skeleton'; | ||
| export type { Task } from '../model/types/task'; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| import { Flex } from "@/shared/ui/Flex"; | ||
| import { TextSkeleton } from "@/shared/ui/Text"; | ||
| import { ButtonSkeleton } from "@/shared/ui/Button"; | ||
|
|
||
| import styles from './ChooseTasksDrawer.module.css'; | ||
|
|
||
| export const ChooseTasksDrawerSkeleton = () => { | ||
| return ( | ||
| <Flex justify="between"> | ||
| <Flex gap="120"> | ||
| <Flex direction="column" gap="8"> | ||
| <TextSkeleton variant="body4" width={170} /> | ||
| <TextSkeleton variant="body2" width={230} /> | ||
| </Flex> | ||
| <Flex direction="column" gap="24"> | ||
| <TextSkeleton variant="body3-accent" width={220} /> | ||
| </Flex> | ||
| </Flex> | ||
| <ButtonSkeleton className={styles['add-button']} width={174} size='medium' /> | ||
| </Flex> | ||
| ); | ||
| }; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,2 @@ | ||
| export { ChooseTasksDrawer } from './ChooseTasksDrawer'; | ||
| export { ChooseTasksDrawerSkeleton } from './ChooseTasksDrawer.skeleton'; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,4 @@ | ||
| export { CollectionCreateForm } from './ui/CollectionCreateForm/CollectionCreateForm'; | ||
| export { CollectionCreateFormSkeleton } from './ui/CollectionCreateForm/CollectionCreateForm.skeleton'; | ||
| export { getCreateCollectionsApiErrorMessage } from './lib/utils/getCreateCollectionsApiErrorMessage'; | ||
| export { createCollectionHandlers } from './api/__mocks__'; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| import { CardSkeleton } from '@/shared/ui/Card'; | ||
| import { Flex } from '@/shared/ui/Flex'; | ||
|
|
||
| import { CollectionFormSkeleton } from '@/entities/collection'; | ||
|
|
||
| import { CollectionCreateFormHeaderSkeleton } from '../../ui/CollectionCreateFormHeader/CollectionCreateFormHeader.skeleton'; | ||
|
|
||
| export const CollectionCreateFormSkeleton = () => { | ||
| return ( | ||
| <Flex componentType="main" direction="column" gap="24"> | ||
| <CollectionCreateFormHeaderSkeleton /> | ||
| <CardSkeleton> | ||
| <CollectionFormSkeleton /> | ||
| </CardSkeleton> | ||
| </Flex> | ||
| ); | ||
| }; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| import { BackButtonSkeleton } from '@/shared/ui/BackButton'; | ||
| import { ButtonSkeleton } from '@/shared/ui/Button'; | ||
| import { Flex } from '@/shared/ui/Flex'; | ||
|
|
||
| export const CollectionCreateFormHeaderSkeleton = () => { | ||
| return ( | ||
| <Flex align="center" gap="8" justify="between"> | ||
| <BackButtonSkeleton /> | ||
| <ButtonSkeleton width={148} /> | ||
| </Flex> | ||
| ); | ||
| }; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,17 @@ | ||
| import { CollectionCreateForm } from '@/features/collections/createCollection'; | ||
| import { CollectionCreateFormSkeleton } from '@/features/collections/createCollection'; | ||
|
|
||
| import { PageWrapper } from '@/widgets/PageWrapper'; | ||
|
|
||
| const CollectionCreatePage = () => { | ||
| return ( | ||
| <PageWrapper roles={['admin', 'author']} hasData stubs={{}} content={<CollectionCreateForm />}> | ||
| <PageWrapper | ||
| roles={['admin', 'author']} | ||
| hasData | ||
| stubs={{}} | ||
| skeleton={<CollectionCreateFormSkeleton />} | ||
|
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] - Сюда скелетон нет смысла указыать так как мы не загружаем ничего здесь. skeleton работает в паре с isLoading. А isLoading мы тут не используем
Collaborator
Author
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. убрал |
||
| content={<CollectionCreateForm />} | ||
| > | ||
| {({ content }) => content} | ||
| </PageWrapper> | ||
| ); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[SUGGESTION] - Глуппый с моей стороны коммент, но подвинь этот импорт под основной компонент, чтобы было так
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
исправил