Removed url button link, tweaked typography and paddings

This commit is contained in:
Daniel Cojocea committed 2024-08-24 11:49:28 -04:00
1 parent 3a9a169a3d
commit 63ae25c16b
6 files changed
+141 -43

No files matched your search

+14 -2
View File
@@ -5,8 +5,7 @@
white-space: nowrap; white-space: nowrap;
} }
.MuiTable-root .host span { .MuiTable-root .host span {
font-size: var(--env-var-font-size-small); font-size: 11px;
margin-left: 8px;
} }
.MuiTable-root .label { .MuiTable-root .label {
@@ -180,3 +179,16 @@ body:has(.pagination-dropdown) p:has(+ .MuiTablePagination-root) {
body:has(.pagination-dropdown) p:has(+ .MuiTablePagination-root) { body:has(.pagination-dropdown) p:has(+ .MuiTablePagination-root) {
font-size: var(--env-var-font-size-small-plus); font-size: var(--env-var-font-size-small-plus);
} }
.monitors .MuiTable-root .MuiTableHead-root .MuiTableCell-root {
text-transform: uppercase;
color: var(--env-var-color-5);
opacity: 0.8;
font-size: var(--env-var-font-size-small-plus);
font-weight: 400;
}
.monitors .MuiTableCell-root:not(:first-of-type):not(:last-of-type),
.monitors .MuiTableCell-root:not(:first-of-type):not(:last-of-type) {
padding-left: var(--env-var-spacing-1);
padding-right: var(--env-var-spacing-1);
}
+5 -1
View File
@@ -233,6 +233,7 @@ const BasicTable = ({ data, paginated, reversed, table }) => {
direction="row" direction="row"
alignItems="center" alignItems="center"
justifyContent="space-between" justifyContent="space-between"
px={theme.gap.small}
> >
<Typography sx={{ opacity: 0.7 }}> <Typography sx={{ opacity: 0.7 }}>
Showing {getRange()} of {data.rows.length} monitor(s) Showing {getRange()} of {data.rows.length} monitor(s)
@@ -277,7 +278,10 @@ const BasicTable = ({ data, paginated, reversed, table }) => {
}, },
}, },
}} }}
sx={{ mt: theme.gap.medium }} sx={{
mt: theme.gap.medium,
color: theme.palette.otherColors.bluishGray,
}}
/> />
</Stack> </Stack>
)} )}
+3
View File
@@ -15,6 +15,9 @@ aside span.MuiTypography-root {
font-size: var(--env-var-font-size-medium); font-size: var(--env-var-font-size-medium);
line-height: 1; line-height: 1;
} }
aside .MuiStack-root + span.MuiTypography-root {
font-size: var(--env-var-font-size-medium-plus);
}
aside .MuiListSubheader-root { aside .MuiListSubheader-root {
font-size: var(--env-var-font-size-small); font-size: var(--env-var-font-size-small);
font-weight: 500; font-weight: 500;
@@ -98,7 +98,7 @@ const CreateMonitor = () => {
monitor.type === "http" monitor.type === "http"
? `http${https ? "s" : ""}://` + monitor.url ? `http${https ? "s" : ""}://` + monitor.url
: monitor.url, : monitor.url,
name: monitor.name === "" ? monitor.url : monitor.name, name: monitor.name,
type: monitor.type, type: monitor.type,
interval: monitor.interval * MS_PER_MINUTE, interval: monitor.interval * MS_PER_MINUTE,
}; };
+10 -4
View File
@@ -1,7 +1,10 @@
.monitors h1.MuiTypography-root, .monitors h1.MuiTypography-root {
.monitors h2.MuiTypography-root {
color: var(--env-var-color-1); color: var(--env-var-color-1);
font-weight: 600; font-weight: 500;
}
.monitors h2.MuiTypography-root {
color: var(--env-var-color-5);
font-weight: 500;
} }
.monitors h1.MuiTypography-root { .monitors h1.MuiTypography-root {
font-size: var(--env-var-font-size-large-plus); font-size: var(--env-var-font-size-large-plus);
@@ -13,6 +16,9 @@
font-size: var(--env-var-font-size-medium); font-size: var(--env-var-font-size-medium);
color: var(--env-var-color-5); color: var(--env-var-color-5);
} }
.monitors h1.MuiTypography-root + p.MuiTypography-root {
font-size: var(--env-var-font-size-medium-plus);
}
.monitors .MuiStack-root > button:not(.MuiIconButton-root) { .monitors .MuiStack-root > button:not(.MuiIconButton-root) {
font-size: var(--env-var-font-size-medium); font-size: var(--env-var-font-size-medium);
height: var(--env-var-height-2); height: var(--env-var-height-2);
@@ -31,7 +37,7 @@
border-radius: 50%; border-radius: 50%;
font-size: var(--env-var-font-size-medium); font-size: var(--env-var-font-size-medium);
font-weight: 500; font-weight: 500;
color: var(--env-var-color-5); color: var(--env-var-color-1);
margin-left: 10px; margin-left: 10px;
line-height: 0.8; line-height: 0.8;
} }
+108 -35
View File
@@ -1,4 +1,3 @@
import "./index.css";
import { useEffect, useState } from "react"; import { useEffect, useState } from "react";
import { useSelector, useDispatch } from "react-redux"; import { useSelector, useDispatch } from "react-redux";
import { import {
@@ -6,11 +5,7 @@ import {
getUptimeMonitorsByUserId, getUptimeMonitorsByUserId,
} from "../../Features/UptimeMonitors/uptimeMonitorsSlice"; } from "../../Features/UptimeMonitors/uptimeMonitorsSlice";
import { useNavigate } from "react-router-dom"; import { useNavigate } from "react-router-dom";
import Button from "../../Components/Button";
import ServerStatus from "../../Components/Charts/Servers/ServerStatus";
import { useTheme } from "@emotion/react"; import { useTheme } from "@emotion/react";
import ArrowDownwardRoundedIcon from "@mui/icons-material/ArrowDownwardRounded";
import BasicTable from "../../Components/BasicTable";
import { StatusLabel } from "../../Components/Label"; import { StatusLabel } from "../../Components/Label";
import { createToast } from "../../Utils/toastUtils"; import { createToast } from "../../Utils/toastUtils";
import { import {
@@ -23,10 +18,15 @@ import {
Stack, Stack,
Typography, Typography,
} from "@mui/material"; } from "@mui/material";
import BasicTable from "../../Components/BasicTable";
import Button from "../../Components/Button";
import ServerStatus from "../../Components/Charts/Servers/ServerStatus";
import Settings from "../../assets/icons/settings-bold.svg?react"; import Settings from "../../assets/icons/settings-bold.svg?react";
import PropTypes from "prop-types"; import PropTypes from "prop-types";
import BarChart from "../../Components/Charts/BarChart"; import BarChart from "../../Components/Charts/BarChart";
import Breadcrumbs from "../../Components/Breadcrumbs";
import ArrowDownwardRoundedIcon from "@mui/icons-material/ArrowDownwardRounded";
import "./index.css";
const ActionsMenu = ({ monitor }) => { const ActionsMenu = ({ monitor }) => {
const [anchorEl, setAnchorEl] = useState(null); const [anchorEl, setAnchorEl] = useState(null);
@@ -177,7 +177,10 @@ const ActionsMenu = ({ monitor }) => {
<Button <Button
level="tertiary" level="tertiary"
label="Cancel" label="Cancel"
onClick={() => setIsOpen(false)} onClick={(e) => {
e.stopPropagation();
setIsOpen(false);
}}
/> />
<Button <Button
level="error" level="error"
@@ -212,12 +215,39 @@ ActionsMenu.propTypes = {
*/ */
const Host = ({ params }) => { const Host = ({ params }) => {
return ( return (
<Stack direction="row" alignItems="baseline" className="host"> <Box className="host">
{params.title} <Box
<Typography component="span" sx={{ color: params.percentageColor }}> display="inline-block"
position="relative"
sx={{
fontWeight: 500,
"&:before": {
position: "absolute",
content: `""`,
width: "4px",
height: "4px",
borderRadius: "50%",
backgroundColor: "gray",
opacity: 0.8,
right: "-10px",
top: "42%",
},
}}
>
{params.title}
</Box>
<Typography
component="span"
sx={{
color: params.percentageColor,
fontWeight: 500,
ml: "15px",
}}
>
{params.percentage}% {params.percentage}%
</Typography> </Typography>
</Stack> <Box sx={{ opacity: 0.6 }}>{params.url}</Box>
</Box>
); );
}; };
@@ -301,6 +331,7 @@ const Monitors = () => {
data.rows = monitorState.monitors.map((monitor, idx) => { data.rows = monitorState.monitors.map((monitor, idx) => {
const params = { const params = {
url: monitor.url,
title: monitor.name, title: monitor.name,
percentage: 100, percentage: 100,
percentageColor: percentageColor:
@@ -348,34 +379,73 @@ const Monitors = () => {
let loading = monitorState.isLoading && monitorState.monitors.length === 0; let loading = monitorState.isLoading && monitorState.monitors.length === 0;
const now = new Date();
const hour = now.getHours();
let greeting = "";
let emoji = "";
if (hour < 12) {
greeting = "morning";
emoji = "🌅";
} else if (hour < 18) {
greeting = "afternoon";
emoji = "🌞";
} else {
greeting = "evening";
emoji = "🌙";
}
return ( return (
<Stack className="monitors" gap={theme.gap.large}> <Stack className="monitors" gap={theme.gap.large}>
{loading ? ( {loading ? (
<SkeletonLayout /> <SkeletonLayout />
) : ( ) : (
<> <>
<Stack <Box>
direction="row" <Breadcrumbs list={[{ name: `monitors`, path: "/monitors" }]} />
justifyContent="space-between" <Stack
alignItems="center" direction="row"
> justifyContent="space-between"
<Typography alignItems="center"
component="h1" mt={theme.gap.medium}
sx={{ lineHeight: 1, alignSelf: "flex-end" }}
> >
Hello, {authState.user.firstName} <Box>
</Typography> <Typography component="h1" lineHeight={1}>
{monitorState.monitors?.length !== 0 && ( <Typography
<Button component="span"
level="primary" fontSize="inherit"
label="Create monitor" color={theme.palette.otherColors.bluishGray}
onClick={() => { >
navigate("/monitors/create"); Good {greeting},{" "}
}} </Typography>
sx={{ fontWeight: 500 }} <Typography
/> component="span"
)} fontSize="inherit"
</Stack> fontWeight="inherit"
>
{authState.user.firstName} {emoji}
</Typography>
</Typography>
<Typography
sx={{ opacity: 0.8 }}
lineHeight={1}
fontWeight={300}
>
Here’s an overview of your uptime monitors.
</Typography>
</Box>
{monitorState.monitors?.length !== 0 && (
<Button
level="primary"
label="Create monitor"
onClick={() => {
navigate("/monitors/create");
}}
sx={{ fontWeight: 500, alignSelf: "flex-end" }}
/>
)}
</Stack>
</Box>
{monitorState.monitors?.length === 0 ? ( {monitorState.monitors?.length === 0 ? (
<Stack <Stack
alignItems="center" alignItems="center"
@@ -412,7 +482,8 @@ const Monitors = () => {
</Stack> </Stack>
<Box <Box
flex={1} flex={1}
p={theme.gap.lgplus} py={theme.gap.large}
px={theme.gap.lgplus}
border={1} border={1}
borderColor={theme.palette.otherColors.graishWhite} borderColor={theme.palette.otherColors.graishWhite}
backgroundColor={theme.palette.otherColors.white} backgroundColor={theme.palette.otherColors.white}
@@ -420,8 +491,10 @@ const Monitors = () => {
borderRadius: `${theme.shape.borderRadius}px`, borderRadius: `${theme.shape.borderRadius}px`,
}} }}
> >
<Stack direction="row" alignItems="center" mb={theme.gap.large}> <Stack direction="row" alignItems="center" mb={theme.gap.ml}>
<Typography component="h2">Current monitors</Typography> <Typography component="h2" letterSpacing={-0.5}>
Actively monitoring
</Typography>
<Box className="current-monitors-counter"> <Box className="current-monitors-counter">
{monitorState.monitors.length} {monitorState.monitors.length}
</Box> </Box>