Add conditional rendering to PageSpeed pages for non admin users

This commit is contained in:
Alex Holliday committed 2024-09-25 10:09:56 +08:00
1 parent 17deed8d43
commit e314def79a
4 files changed
+42 -34

No files matched your search

+10 -8
View File
@@ -87,14 +87,16 @@ const PageSpeed = ({ isAdmin }) => {
mt={theme.spacing(5)}
>
<Greeting type="pagespeed" />
<Button
variant="contained"
color="primary"
onClick={() => navigate("/pagespeed/create")}
sx={{ whiteSpace: "nowrap" }}
>
Create new
</Button>
{isAdmin && (
<Button
variant="contained"
color="primary"
onClick={() => navigate("/pagespeed/create")}
sx={{ whiteSpace: "nowrap" }}
>
Create new
</Button>
)}
</Stack>
</Box>
<Grid container spacing={theme.spacing(12)}>