update fallback component
This commit is contained in:
1 parent
66de46f695
commit
e67b9ecb09
1 file changed
+58
-47
@@ -26,58 +26,69 @@ const Fallback = ({ title, checks, link = "/", isAdmin, vowelStart = false }) =>
|
|||||||
const mode = useSelector((state) => state.ui.mode);
|
const mode = useSelector((state) => state.ui.mode);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Stack
|
<Box
|
||||||
className={`fallback__${title.trim().split(" ")[0]}`}
|
className="page-speed"
|
||||||
alignItems="center"
|
position="relative"
|
||||||
gap={theme.spacing(20)}
|
border={1}
|
||||||
|
borderColor={theme.palette.primary.lowContrast}
|
||||||
|
borderRadius={theme.shape.borderRadius}
|
||||||
|
borderStyle="dashed"
|
||||||
|
backgroundColor={theme.palette.primary.main}
|
||||||
|
overflow="hidden"
|
||||||
>
|
>
|
||||||
{mode === "light" ? (
|
|
||||||
<Skeleton style={{ zIndex: 1 }} />
|
|
||||||
) : (
|
|
||||||
<SkeletonDark style={{ zIndex: 1 }} />
|
|
||||||
)}
|
|
||||||
<Box
|
|
||||||
className="background-pattern-svg"
|
|
||||||
sx={{
|
|
||||||
"& svg g g:last-of-type path": {
|
|
||||||
stroke: theme.palette.primary.lowContrast,
|
|
||||||
},
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<Background style={{ width: "100%" }} />
|
|
||||||
</Box>
|
|
||||||
<Stack
|
<Stack
|
||||||
gap={theme.spacing(4)}
|
className={`fallback__${title.trim().split(" ")[0]}`}
|
||||||
maxWidth={"300px"}
|
alignItems="center"
|
||||||
zIndex={1}
|
gap={theme.spacing(20)}
|
||||||
>
|
>
|
||||||
<Typography
|
{mode === "light" ? (
|
||||||
component="h1"
|
<Skeleton style={{ zIndex: 1 }} />
|
||||||
marginY={theme.spacing(4)}
|
) : (
|
||||||
color={theme.palette.primary.contrastTextTertiary}
|
<SkeletonDark style={{ zIndex: 1 }} />
|
||||||
|
)}
|
||||||
|
<Box
|
||||||
|
className="background-pattern-svg"
|
||||||
|
sx={{
|
||||||
|
"& svg g g:last-of-type path": {
|
||||||
|
stroke: theme.palette.primary.lowContrast,
|
||||||
|
},
|
||||||
|
}}
|
||||||
>
|
>
|
||||||
{vowelStart ? "An" : "A"} {title} is used to:
|
<Background style={{ width: "100%" }} />
|
||||||
</Typography>
|
</Box>
|
||||||
{checks.map((check, index) => (
|
<Stack
|
||||||
<Check
|
gap={theme.spacing(4)}
|
||||||
text={check}
|
maxWidth={"300px"}
|
||||||
key={`${title.trim().split(" ")[0]}-${index}`}
|
zIndex={1}
|
||||||
outlined={true}
|
>
|
||||||
/>
|
<Typography
|
||||||
))}
|
component="h1"
|
||||||
|
marginY={theme.spacing(4)}
|
||||||
|
color={theme.palette.primary.contrastTextTertiary}
|
||||||
|
>
|
||||||
|
{vowelStart ? "An" : "A"} {title} is used to:
|
||||||
|
</Typography>
|
||||||
|
{checks.map((check, index) => (
|
||||||
|
<Check
|
||||||
|
text={check}
|
||||||
|
key={`${title.trim().split(" ")[0]}-${index}`}
|
||||||
|
outlined={true}
|
||||||
|
/>
|
||||||
|
))}
|
||||||
|
</Stack>
|
||||||
|
{/* TODO - display a different fallback if user is not an admin*/}
|
||||||
|
{isAdmin && (
|
||||||
|
<Button
|
||||||
|
variant="contained"
|
||||||
|
color="accent"
|
||||||
|
sx={{ alignSelf: "center" }}
|
||||||
|
onClick={() => navigate(link)}
|
||||||
|
>
|
||||||
|
Let's create your first{title}
|
||||||
|
</Button>
|
||||||
|
)}
|
||||||
</Stack>
|
</Stack>
|
||||||
{/* TODO - display a different fallback if user is not an admin*/}
|
</Box>
|
||||||
{isAdmin && (
|
|
||||||
<Button
|
|
||||||
variant="contained"
|
|
||||||
color="accent"
|
|
||||||
sx={{ alignSelf: "center" }}
|
|
||||||
onClick={() => navigate(link)}
|
|
||||||
>
|
|
||||||
Let's create your {title}
|
|
||||||
</Button>
|
|
||||||
)}
|
|
||||||
</Stack>
|
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user