Some checks failed
No response / noResponse (push) Has been cancelled
CI / Continuous releases (push) Has been cancelled
CI / test-dev (macos-latest) (push) Has been cancelled
CI / test-dev (ubuntu-latest) (push) Has been cancelled
CI / test-dev (windows-latest) (push) Has been cancelled
Maintenance / main (push) Has been cancelled
Scorecards supply-chain security / Scorecards analysis (push) Has been cancelled
CodeQL / Analyze (push) Has been cancelled
38 lines
828 B
TypeScript
38 lines
828 B
TypeScript
import Typography, { TypographyProps } from '@mui/material/Typography';
|
|
import Skeleton from '@mui/material/Skeleton';
|
|
import Grid from '@mui/material/Grid';
|
|
|
|
const variants = [
|
|
'h1',
|
|
'h3',
|
|
'body1',
|
|
'caption',
|
|
] as readonly TypographyProps['variant'][];
|
|
|
|
function TypographyDemo(props: { loading?: boolean }) {
|
|
const { loading = false } = props;
|
|
|
|
return (
|
|
<div>
|
|
{variants.map((variant) => (
|
|
<Typography component="div" key={variant} variant={variant}>
|
|
{loading ? <Skeleton /> : variant}
|
|
</Typography>
|
|
))}
|
|
</div>
|
|
);
|
|
}
|
|
|
|
export default function SkeletonTypography() {
|
|
return (
|
|
<Grid container spacing={8}>
|
|
<Grid size="grow">
|
|
<TypographyDemo loading />
|
|
</Grid>
|
|
<Grid size="grow">
|
|
<TypographyDemo />
|
|
</Grid>
|
|
</Grid>
|
|
);
|
|
}
|