Skip to content

Commit

Permalink
feat: show gif when form building
Browse files Browse the repository at this point in the history
  • Loading branch information
tshuli committed Jan 30, 2024
1 parent a3a296d commit 0d94479
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
Binary file added frontend/public/magicBuilderLoading.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { ModalBody } from '@chakra-ui/react'

export const MagicFormBuilderGifLoadingScreen = (): JSX.Element => {
return (
<>
<ModalBody whiteSpace="pre-wrap">
<img src="/magicBuilderLoading.gif" alt="loading gif" />
</ModalBody>
</>
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
useMagicFormBuilderWizard,
} from '../MagicFormBuilderWizardContext'

import { MagicFormBuilderGifLoadingScreen } from './GifLoadingScreen'
import { MagicFormBuilderLandingScreen } from './LandingScreen'
import { MagicFormBuilderPdfDetailsScreen } from './PdfDetailsScreen'
import { MagicFormBuilderPromptDetailsScreen } from './PromptDetailsScreen'
Expand All @@ -18,9 +19,11 @@ export const MagicFormBuilderModalContent = ({
}: {
onClose: () => void
}) => {
const { direction, currentStep } = useMagicFormBuilderWizard()
const { direction, currentStep, isLoading } = useMagicFormBuilderWizard()

return (
return isLoading ? (
<MagicFormBuilderGifLoadingScreen />
) : (
<XMotionBox keyProp={currentStep} custom={direction}>
{currentStep === MagicFormBuilderFlowStates.Landing && (
<MagicFormBuilderLandingScreen onClose={onClose} />
Expand Down

0 comments on commit 0d94479

Please sign in to comment.