Merge pull request #2557 from bluewave-labs/fix/placeholder-center-align

Fix/placeholder center align
This commit is contained in:
Alexander Holliday authored and GitHub committed 2025-07-04 14:57:37 -07:00
commit 5fdf8431da
2 files changed
+115 -89

No files matched your search

+5 -1
View File
@@ -1,19 +1,22 @@
[class*="fallback__"] { [class*="fallback__"] {
width: fit-content; width: fit-content;
margin: auto; margin: auto;
margin-top: 100px;
} }
[class*="fallback__"] h1.MuiTypography-root { [class*="fallback__"] h1.MuiTypography-root {
font-size: var(--env-var-font-size-large); font-size: var(--env-var-font-size-large);
font-weight: 600; font-weight: 600;
} }
[class*="fallback__"] button.MuiButtonBase-root, [class*="fallback__"] button.MuiButtonBase-root,
[class*="fallback__"] .check { [class*="fallback__"] .check {
width: max-content; width: max-content;
} }
[class*="fallback__"] button.MuiButtonBase-root { [class*="fallback__"] button.MuiButtonBase-root {
min-height: 34px; min-height: 34px;
} }
[class*="fallback__"] .check span.MuiTypography-root, [class*="fallback__"] .check span.MuiTypography-root,
[class*="fallback__"] button.MuiButtonBase-root { [class*="fallback__"] button.MuiButtonBase-root {
font-size: var(--env-var-font-size-medium); font-size: var(--env-var-font-size-medium);
@@ -35,6 +38,7 @@
background-size: cover; background-size: cover;
background-repeat: no-repeat; background-repeat: no-repeat;
} }
.fallback__status > .MuiStack-root { .fallback__status > .MuiStack-root {
margin-left: var(--env-var-spacing-2); margin-left: var(--env-var-spacing-2);
} }
+110 -88
View File
@@ -67,113 +67,135 @@ const Fallback = ({
</> </>
); );
}; };
return ( return (
<Box <Box
position="relative" position="relative"
border={1}
borderColor={theme.palette.primary.lowContrast}
borderRadius={theme.shape.borderRadius}
backgroundColor={theme.palette.primary.main}
overflow="hidden"
sx={{ sx={{
borderStyle: "dashed", height: "100%",
minHeight: "calc(100vh - var(--env-var-spacing-2) * 2)", width: "100%",
display: "flex",
justifyContent: "center",
alignItems: "center",
}} }}
> >
<Stack <Box
className={`fallback__${title?.trim().split(" ")[0]}`} border={1}
alignItems="center" borderColor={theme.palette.primary.lowContrast}
gap={theme.spacing(20)} borderRadius={theme.shape.borderRadius}
backgroundColor={theme.palette.primary.main}
overflow="hidden"
sx={{
display: "flex",
borderStyle: "dashed",
height: {
sm: "50vh",
md: "70vh",
lg: "60vh",
xl: "55vh",
},
width: {
sm: "90%",
md: "50%",
lg: "40%",
},
padding: theme.spacing(10),
}}
> >
{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={theme.spacing(180)}
key={`${title.trim().split(" ")[0]}-${index}`} zIndex={1}
outlined={true} >
/> <Typography
))} alignSelf="center"
</Stack> component="h1"
{/* TODO - display a different fallback if user is not an admin*/} marginY={theme.spacing(4)}
{isAdmin && ( color={theme.palette.primary.contrastTextTertiary}
<>
<Button
variant="contained"
color="accent"
sx={{ alignSelf: "center" }}
onClick={() => navigate(link)}
> >
Let's create your first {title} {vowelStart ? "An" : "A"} {title} is used to:
</Button> </Typography>
{/* Bulk create of uptime monitors */} {checks?.map((check, index) => (
{title === "uptime monitor" && ( <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 <Button
variant="contained" variant="contained"
color="accent" color="accent"
sx={{ alignSelf: "center" }} sx={{ alignSelf: "center" }}
onClick={() => navigate("/uptime/bulk-import")} onClick={() => navigate(link)}
> >
{t("bulkImport.fallbackPage")} Let's create your first {title}
</Button> </Button>
)} {/* Bulk create of uptime monitors */}
{title === "uptime monitor" && (
{/* Warning box for PageSpeed monitor */} <Button
{title === "pagespeed monitor" && showPageSpeedWarning && ( variant="contained"
<Box sx={{ width: "80%", maxWidth: "600px", zIndex: 1 }}> color="accent"
<Box sx={{ alignSelf: "center" }}
sx={{ onClick={() => navigate("/uptime/bulk-import")}
"& .alert.row-stack": {
backgroundColor: theme.palette.warningSecondary.main,
borderColor: theme.palette.warningSecondary.lowContrast,
"& .MuiTypography-root": {
color: theme.palette.warningSecondary.contrastText,
},
"& .MuiBox-root > svg": {
color: theme.palette.warningSecondary.contrastText,
},
},
}}
> >
{settingsData?.pagespeedKeySet === false && ( {t("bulkImport.fallbackPage")}
<Alert </Button>
variant="warning" )}
hasIcon={true}
body={renderWarningMessage()} {/* Warning box for PageSpeed monitor */}
/> {title === "pagespeed monitor" && showPageSpeedWarning && (
)} <Box sx={{ width: "80%", maxWidth: "600px", zIndex: 1 }}>
<Box
sx={{
"& .alert.row-stack": {
backgroundColor: theme.palette.warningSecondary.main,
borderColor: theme.palette.warningSecondary.lowContrast,
"& .MuiTypography-root": {
color: theme.palette.warningSecondary.contrastText,
},
"& .MuiBox-root > svg": {
color: theme.palette.warningSecondary.contrastText,
},
},
}}
>
{settingsData?.pagespeedKeySet === false && (
<Alert
variant="warning"
hasIcon={true}
body={renderWarningMessage()}
/>
)}
</Box>
</Box> </Box>
</Box> )}
)} </>
</> )}
)} </Stack>
</Stack> </Box>
</Box> </Box>
); );
}; };