make status page responsive
This commit is contained in:
1 parent
4e7600067c
commit
9d2743798f
8 files changed
+58
-23
No files matched your search
@@ -1,14 +1,17 @@
|
||||
// Components
|
||||
import { Stack, Typography } from "@mui/material";
|
||||
import { useTheme } from "@emotion/react";
|
||||
import PulseDot from "../../../../../Components/Animated/PulseDot";
|
||||
import "flag-icons/css/flag-icons.min.css";
|
||||
import { ColContainer } from "../../../../../Components/StandardContainer";
|
||||
|
||||
const BASE_BOX_PADDING_VERTICAL = 16;
|
||||
const BASE_BOX_PADDING_HORIZONTAL = 8;
|
||||
|
||||
// Utils
|
||||
import { useMediaQuery } from "@mui/material";
|
||||
import { useTheme } from "@emotion/react";
|
||||
import { safelyParseFloat } from "../../../../../Utils/utils";
|
||||
const DeviceTicker = ({ data, width = "100%", connectionStatus }) => {
|
||||
const theme = useTheme();
|
||||
const isSmallScreen = useMediaQuery(theme.breakpoints.down("sm"));
|
||||
|
||||
const statusColor = {
|
||||
up: theme.palette.success.main,
|
||||
down: theme.palette.error.main,
|
||||
@@ -43,7 +46,7 @@ const DeviceTicker = ({ data, width = "100%", connectionStatus }) => {
|
||||
<Typography>RESPONSE</Typography>
|
||||
</th>
|
||||
<th style={{ textAlign: "right" }}>
|
||||
<Typography>UPT BURNED</Typography>
|
||||
<Typography>{isSmallScreen ? "UPT" : "UPT BURNED"}</Typography>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
@@ -68,7 +71,10 @@ const DeviceTicker = ({ data, width = "100%", connectionStatus }) => {
|
||||
</td>
|
||||
<td style={{ textAlign: "right" }}>
|
||||
<Typography color={theme.palette.warning.main}>
|
||||
+{dataPoint.uptBurnt}
|
||||
+
|
||||
{isSmallScreen
|
||||
? safelyParseFloat(dataPoint.uptBurnt).toFixed(4)
|
||||
: dataPoint.uptBurnt}
|
||||
</Typography>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -6,7 +6,12 @@ import maplibregl from "maplibre-gl";
|
||||
import { useSelector } from "react-redux";
|
||||
import buildStyle from "./buildStyle";
|
||||
|
||||
const DistributedUptimeMap = ({ width = "100%", checks }) => {
|
||||
const DistributedUptimeMap = ({
|
||||
width = "100%",
|
||||
checks,
|
||||
height,
|
||||
minHeight = "350px",
|
||||
}) => {
|
||||
const mapContainer = useRef(null);
|
||||
const map = useRef(null);
|
||||
const theme = useTheme();
|
||||
@@ -92,6 +97,8 @@ const DistributedUptimeMap = ({ width = "100%", checks }) => {
|
||||
ref={mapContainer}
|
||||
style={{
|
||||
width: width,
|
||||
height: height,
|
||||
minHeight: minHeight,
|
||||
borderRadius: theme.spacing(4),
|
||||
borderColor: theme.palette.primary.lowContrast,
|
||||
borderStyle: "solid",
|
||||
@@ -105,6 +112,7 @@ DistributedUptimeMap.propTypes = {
|
||||
checks: PropTypes.array,
|
||||
width: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
||||
height: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
||||
minHeight: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
||||
};
|
||||
|
||||
export default DistributedUptimeMap;
|
||||
@@ -2,7 +2,6 @@
|
||||
import { Stack } from "@mui/material";
|
||||
import InfoBox from "../../../../../Components/InfoBox";
|
||||
import LastUpdate from "../LastUpdate";
|
||||
import UptLogo from "../../../../../assets/icons/upt_logo.png";
|
||||
|
||||
// Utils
|
||||
import { useTheme } from "@mui/material/styles";
|
||||
@@ -15,6 +14,7 @@ const StatBoxes = ({ monitor, lastUpdateTrigger }) => {
|
||||
<Stack
|
||||
direction="row"
|
||||
justifyContent="space-between"
|
||||
flexWrap="wrap"
|
||||
gap={theme.spacing(8)}
|
||||
>
|
||||
<InfoBox
|
||||
|
||||
@@ -32,7 +32,7 @@ const StatusHeader = ({ monitor, connectionStatus, elementToCapture }) => {
|
||||
return (
|
||||
<ColContainer backgroundColor={bgColor}>
|
||||
<Stack
|
||||
direction="row"
|
||||
direction={{ s: "column", md: "row" }}
|
||||
justifyContent="space-between"
|
||||
gap={theme.spacing(8)}
|
||||
>
|
||||
|
||||
Reference in new issue
Block a user