Merge pull request #762 from bluewave-labs/feat/warning-palette-and-breadcrumbs

Password tab style and breadcrumbs
This commit is contained in:
Alexander Holliday authored and GitHub committed 2024-08-30 11:49:00 -07:00
commit f288182460
8 files changed
+142 -115

No files matched your search

+2 -11
View File
@@ -93,17 +93,8 @@ const ActionsMenu = ({ monitor, isAdmin }) => {
slotProps={{
paper: {
sx: {
"& ul": {
p: theme.spacing(2.5),
minWidth: "100px",
},
"& li": {
color: theme.palette.text.secondary,
fontSize: 13,
px: theme.spacing(4),
py: theme.spacing(2.5),
borderRadius: theme.shape.borderRadius,
},
"& ul": { p: theme.spacing(2.5) },
"& li": { m: 0 },
"& li:last-of-type": {
color: theme.palette.error.text,
},
+2 -30
View File
@@ -13,6 +13,7 @@ import Fallback from "./fallback";
import StatusBox from "./StatusBox";
import { buildData } from "./monitorData";
import Breadcrumbs from "../../../Components/Breadcrumbs";
import Greeting from "../../../Utils/greeting";
const Monitors = ({ isAdmin }) => {
const theme = useTheme();
@@ -73,36 +74,7 @@ const Monitors = ({ isAdmin }) => {
alignItems="center"
mt={theme.spacing(5)}
>
<Box>
<Typography
component="h1"
lineHeight={1}
color={theme.palette.text.primary}
>
<Typography
component="span"
fontSize="inherit"
color={theme.palette.text.secondary}
>
Good {greeting},{" "}
</Typography>
<Typography
component="span"
fontSize="inherit"
fontWeight="inherit"
>
{authState.user.firstName} {emoji}
</Typography>
</Typography>
<Typography
sx={{ opacity: 0.8 }}
lineHeight={1}
fontWeight={300}
color={theme.palette.text.secondary}
>
Here’s an overview of your uptime monitors.
</Typography>
</Box>
<Greeting type="uptime" />
{monitorState.monitors?.length !== 0 && (
<Button
level="primary"
+3 -5
View File
@@ -1,14 +1,13 @@
.page-speed h2.MuiTypography-root {
line-height: 1.1;
}
.page-speed h1.MuiTypography-root,
.page-speed h1.MuiTypography-root {
font-size: var(--env-var-font-size-large-plus);
}
.page-speed h2.MuiTypography-root {
font-size: var(--env-var-font-size-large);
font-weight: 600;
}
.page-speed p.MuiTypography-root {
font-size: var(--env-var-font-size-medium);
}
.page-speed p:has(> span.MuiTypography-root),
.page-speed p.MuiTypography-root > span.MuiTypography-root {
font-size: var(--env-var-font-size-small-plus);
@@ -20,5 +19,4 @@
}
.page-speed:not(:has([class*="fallback__"])) button {
height: 34px;
align-self: flex-end;
}
+30 -26
View File
@@ -12,6 +12,8 @@ import Button from "../../Components/Button";
import { useNavigate } from "react-router";
import { getLastChecked } from "../../Utils/monitorUtils";
import PropTypes from "prop-types";
import Breadcrumbs from "../../Components/Breadcrumbs";
import Greeting from "../../Utils/greeting";
const Card = ({ data }) => {
const theme = useTheme();
@@ -24,7 +26,7 @@ const Card = ({ data }) => {
flexGrow={1}
sx={{
"&:hover > .MuiStack-root": {
backgroundColor: "var(--primary-bg-accent)",
backgroundColor: theme.palette.background.accent,
},
}}
>
@@ -37,7 +39,10 @@ const Card = ({ data }) => {
borderColor={theme.palette.border.light}
borderRadius={theme.shape.borderRadius}
backgroundColor={theme.palette.background.main}
sx={{ cursor: "pointer" }}
sx={{
cursor: "pointer",
"& svg path": { stroke: theme.palette.other.icon, strokeWidth: 0.8 },
}}
>
<PageSpeedIcon
style={{ width: theme.spacing(8), height: theme.spacing(8) }}
@@ -56,7 +61,9 @@ const Card = ({ data }) => {
text={data.status ? "Live (collecting data)" : "Inactive"}
/>
</Stack>
<Typography>{data.url.replace(/^https?:\/\//, "")}</Typography>
<Typography fontSize={13}>
{data.url.replace(/^https?:\/\//, "")}
</Typography>
<Typography mt={theme.spacing(12)}>
<Typography component="span" fontWeight={600}>
Last checked:{" "}
@@ -142,7 +149,7 @@ const PageSpeed = ({ isAdmin }) => {
const dispatch = useDispatch();
const navigate = useNavigate();
const { authToken } = useSelector((state) => state.auth);
const { authToken, user } = useSelector((state) => state.auth);
const { monitors, isLoading } = useSelector(
(state) => state.pageSpeedMonitors
);
@@ -157,7 +164,6 @@ const PageSpeed = ({ isAdmin }) => {
return (
<Box
className="page-speed"
pt={theme.spacing(20)}
sx={{
':has(> [class*="fallback__"])': {
position: "relative",
@@ -173,37 +179,35 @@ const PageSpeed = ({ isAdmin }) => {
{isActuallyLoading ? (
<SkeletonLayout />
) : monitors?.length !== 0 ? (
<Stack
gap={theme.spacing(2)}
<Box
sx={{
"& h1, & span.MuiTypography-root, & p": {
"& p": {
color: theme.palette.text.secondary,
},
}}
>
<Stack
direction="row"
justifyContent="space-between"
mb={theme.spacing(12)}
>
<Box>
<Typography component="h1">All page speed monitors</Typography>
<Typography mt={theme.spacing(2)}>
Click on one of the monitors to get more site speed information.
</Typography>
</Box>
<Button
level="primary"
label="Create new"
onClick={() => navigate("/pagespeed/create")}
/>
</Stack>
<Box mb={theme.spacing(12)}>
<Breadcrumbs list={[{ name: `pagespeed`, path: "/pagespeed" }]} />
<Stack
direction="row"
justifyContent="space-between"
alignItems="center"
mt={theme.spacing(5)}
>
<Greeting type="pagespeed" />
<Button
level="primary"
label="Create new"
onClick={() => navigate("/pagespeed/create")}
/>
</Stack>
</Box>
<Grid container spacing={theme.spacing(12)}>
{monitors?.map((monitor) => (
<Card data={monitor} key={`monitor-${monitor._id}`} />
))}
</Grid>
</Stack>
</Box>
) : (
<Fallback
title="pagespeed monitor"