-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
FI-2454: Add landing page and suite options skeletons (#453)
* add landing page and selection skeletons * add suite options skeleton * remove testing null input * add skeleton render tests * Update client/src/components/App/Router.tsx Co-authored-by: Dylan Hall <dehall@mitre.org> * resolve lint error --------- Co-authored-by: Alyssa Wang <awang@mitre.org> Co-authored-by: Dylan Hall <dehall@mitre.org>
- Loading branch information
1 parent
4dbcdeb
commit 022aeaf
Showing
13 changed files
with
291 additions
and
32 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
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
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
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 |
---|---|---|
@@ -0,0 +1,65 @@ | ||
import React, { FC } from 'react'; | ||
import { Box, Container, Skeleton } from '@mui/material'; | ||
import { useAppStore } from '~/store/app'; | ||
import SelectionSkeleton from '~/components/Skeletons/SelectionSkeletion'; | ||
import useStyles from '~/components/LandingPage/styles'; | ||
import lightTheme from '~/styles/theme'; | ||
|
||
const LandingPageSkeleton: FC<Record<string, never>> = () => { | ||
const { classes } = useStyles(); | ||
const windowIsSmall = useAppStore((state) => state.windowIsSmall); | ||
|
||
return ( | ||
<Container className={classes.main} data-testid="landingPageSkeleton"> | ||
<Box | ||
display="flex" | ||
flexDirection="column" | ||
justifyContent={windowIsSmall ? 'center' : 'flex-end'} | ||
alignItems="center" | ||
px={2} | ||
> | ||
<Box | ||
display="flex" | ||
flexDirection="column" | ||
my={2} | ||
alignItems="center" | ||
justifyContent="center" | ||
> | ||
<Skeleton variant="rounded" height={70} width={250} style={{ margin: '32px' }} /> | ||
<Skeleton | ||
variant="rounded" | ||
height={40} | ||
width={windowIsSmall ? 200 : 400} | ||
style={{ margin: '8px' }} | ||
/> | ||
</Box> | ||
<Box mb={2} alignItems="center"> | ||
<Skeleton | ||
variant="rounded" | ||
height={20} | ||
width={windowIsSmall ? 250 : 500} | ||
style={{ margin: '8px' }} | ||
/> | ||
<Skeleton | ||
variant="rounded" | ||
height={20} | ||
width={windowIsSmall ? 250 : 500} | ||
style={{ margin: '8px' }} | ||
/> | ||
</Box> | ||
</Box> | ||
<Box | ||
display="flex" | ||
flexDirection="column" | ||
alignItems="center" | ||
width="100%" | ||
py={4} | ||
sx={{ backgroundColor: lightTheme.palette.common.grayLightest }} | ||
> | ||
<SelectionSkeleton /> | ||
</Box> | ||
</Container> | ||
); | ||
}; | ||
|
||
export default LandingPageSkeleton; |
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,48 @@ | ||
import React, { FC } from 'react'; | ||
import { Box, Paper, Skeleton } from '@mui/material'; | ||
import { useAppStore } from '~/store/app'; | ||
import useStyles from '~/components/_common/SelectionPanel/styles'; | ||
|
||
const SelectionSkeleton: FC<Record<string, never>> = () => { | ||
const { classes } = useStyles(); | ||
const windowIsSmall = useAppStore((state) => state.windowIsSmall); | ||
const optionCount = 3; | ||
|
||
const optionSkeleton = ( | ||
<Skeleton | ||
variant="rounded" | ||
height={10} | ||
width={windowIsSmall ? 200 : 300} | ||
style={{ margin: '32px' }} | ||
/> | ||
); | ||
|
||
const skeletonList = []; | ||
for (let index = 0; index < optionCount; index++) { | ||
skeletonList.push(<div key={index}>{optionSkeleton}</div>); | ||
} | ||
|
||
return ( | ||
<Box display="flex" data-testid="selectionSkeleton"> | ||
<Paper | ||
elevation={0} | ||
className={classes.optionsList} | ||
sx={{ width: windowIsSmall ? 'auto' : '400px', maxWidth: '400px' }} | ||
> | ||
<Box display="flex" alignItems="center" justifyContent={'center'} mx={1}> | ||
<Skeleton variant="rounded" height={30} width={150} style={{ marginTop: '16px' }} /> | ||
</Box> | ||
|
||
<Box px={2} pb={2}> | ||
{skeletonList} | ||
</Box> | ||
|
||
<Box px={2}> | ||
<Skeleton variant="rounded" height={40} /> | ||
</Box> | ||
</Paper> | ||
</Box> | ||
); | ||
}; | ||
|
||
export default SelectionSkeleton; |
64 changes: 64 additions & 0 deletions
64
client/src/components/Skeletons/SuiteOptionsPageSkeleton.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,64 @@ | ||
import React, { FC } from 'react'; | ||
import { Box, Container, Skeleton } from '@mui/material'; | ||
import { useAppStore } from '~/store/app'; | ||
import SelectionSkeleton from '~/components/Skeletons/SelectionSkeletion'; | ||
import useStyles from '~/components/SuiteOptionsPage/styles'; | ||
import lightTheme from '~/styles/theme'; | ||
|
||
const SuiteOptionsPageSkeleton: FC<Record<string, never>> = () => { | ||
const { classes } = useStyles(); | ||
const windowIsSmall = useAppStore((state) => state.windowIsSmall); | ||
const textLineCount = 10; | ||
|
||
const textLineSkeleton = ( | ||
<Skeleton | ||
variant="rounded" | ||
height={10} | ||
width={windowIsSmall ? 300 : 400} | ||
style={{ margin: '8px' }} | ||
/> | ||
); | ||
|
||
const skeletonList = []; | ||
for (let index = 0; index < textLineCount; index++) { | ||
skeletonList.push(<div key={index}>{textLineSkeleton}</div>); | ||
} | ||
|
||
return ( | ||
<Container | ||
className={classes.main} | ||
sx={{ flexDirection: windowIsSmall ? '' : 'column' }} | ||
data-testid="suiteOptionsPageSkeleton" | ||
> | ||
<Box | ||
display="flex" | ||
flexDirection="column" | ||
justifyContent="center" | ||
alignItems="center" | ||
px={windowIsSmall ? 0 : 8} | ||
my={3} | ||
> | ||
<Box display="flex" alignItems="center" m={4}> | ||
<Skeleton variant="rounded" height={40} width={windowIsSmall ? 200 : 350} /> | ||
</Box> | ||
<Box display="flex" flexDirection="column" justifyContent="center" px={2} mb={3}> | ||
{skeletonList} | ||
</Box> | ||
</Box> | ||
<Box | ||
display="flex" | ||
height={windowIsSmall ? 'none' : '100%'} | ||
width={windowIsSmall ? '100%' : 'none'} | ||
justifyContent="center" | ||
alignItems="center" | ||
sx={{ backgroundColor: lightTheme.palette.common.grayLightest }} | ||
> | ||
<Box display="flex" justifyContent="center" m={3}> | ||
<SelectionSkeleton /> | ||
</Box> | ||
</Box> | ||
</Container> | ||
); | ||
}; | ||
|
||
export default SuiteOptionsPageSkeleton; |
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.