Responsive

This commit is contained in:
Alex Holliday committed 2026-01-28 19:00:34 +00:00
1 parent 975d134dd8
commit 5a468d717a
2 files changed
+18 -7

No files matched your search

@@ -1,10 +1,11 @@
import Stack from "@mui/material/Stack"; import Stack from "@mui/material/Stack";
import Box from "@mui/material/Box";
import Typography from "@mui/material/Typography"; import Typography from "@mui/material/Typography";
import { ToggleButtonGroup, ToggleButton } from "@/Components/v2/inputs"; import { ToggleButtonGroup, ToggleButton } from "@/Components/v2/inputs";
import { useTheme } from "@mui/material/styles"; import { useTheme } from "@mui/material/styles";
import CircularProgress from "@mui/material/CircularProgress"; import CircularProgress from "@mui/material/CircularProgress";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import Box from "@mui/material/Box"; import { useMediaQuery } from "@mui/material";
interface MonitorTimeFrameHeaderProps { interface MonitorTimeFrameHeaderProps {
isLoading?: boolean; isLoading?: boolean;
@@ -21,6 +22,7 @@ export const HeaderTimeRange = ({
}: MonitorTimeFrameHeaderProps) => { }: MonitorTimeFrameHeaderProps) => {
const theme = useTheme(); const theme = useTheme();
const { t } = useTranslation(); const { t } = useTranslation();
const isSmallScreen = useMediaQuery(theme.breakpoints.down("md"));
const handleChange = ( const handleChange = (
_event: React.MouseEvent<HTMLElement>, _event: React.MouseEvent<HTMLElement>,
newValue: string | null newValue: string | null
@@ -35,10 +37,12 @@ export const HeaderTimeRange = ({
if (hasDateRange) { if (hasDateRange) {
timeFramePicker = ( timeFramePicker = (
<ToggleButtonGroup <ToggleButtonGroup
orientation={isSmallScreen ? "vertical" : "horizontal"}
value={dateRange} value={dateRange}
exclusive exclusive
onChange={handleChange} onChange={handleChange}
size="small" size="small"
fullWidth={isSmallScreen}
> >
<ToggleButton value="recent"> <ToggleButton value="recent">
{t("components.headerTimeRange.labels.recent")} {t("components.headerTimeRange.labels.recent")}
@@ -58,12 +62,17 @@ export const HeaderTimeRange = ({
return ( return (
<Stack <Stack
direction="row" direction={{ xs: "column", sm: "row" }}
justifyContent="flex-end" justifyContent="flex-end"
alignItems="center" alignItems="center"
gap={theme.spacing(4)} gap={theme.spacing(4)}
> >
{isLoading && <CircularProgress size={16} />} <Box
width={16}
height={16}
>
{isLoading && <CircularProgress size={16} />}
</Box>
<Typography variant="body2"> <Typography variant="body2">
{t(`components.headerTimeRange.description.${dateRange}`)} {t(`components.headerTimeRange.description.${dateRange}`)}
</Typography> </Typography>
+6 -4
View File
@@ -1,4 +1,5 @@
import Stack from "@mui/material/Stack"; import Stack from "@mui/material/Stack";
import Box from "@mui/material/Box";
import { import {
BasePage, BasePage,
TotalChecksBox, TotalChecksBox,
@@ -9,7 +10,7 @@ import { HeaderTimeRange } from "@/Components/v2/common";
import { Select } from "@/Components/v2/inputs"; import { Select } from "@/Components/v2/inputs";
import { ChecksTable } from "./Components/ChecksTable"; import { ChecksTable } from "./Components/ChecksTable";
import { MenuItem, useTheme } from "@mui/material"; import { MenuItem } from "@mui/material";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { useState, useMemo } from "react"; import { useState, useMemo } from "react";
import { useParams } from "react-router-dom"; import { useParams } from "react-router-dom";
@@ -115,15 +116,16 @@ const Checks = () => {
<Stack <Stack
direction={{ xs: "column", md: "row" }} direction={{ xs: "column", md: "row" }}
justifyContent={"space-between"} justifyContent="space-between"
alignItems={"center"} alignItems={{ xs: "stretch", md: "center" }}
gap={2} gap={2}
> >
<Stack <Stack
direction={{ xs: "column", md: "row" }}
gap={2} gap={2}
direction={{ xs: "column", md: "row" }}
> >
<Select <Select
fullWidth
value={selectedMonitor} value={selectedMonitor}
onChange={(e: any) => { onChange={(e: any) => {
setSelectedMonitor(e.target.value); setSelectedMonitor(e.target.value);