Merge pull request #3216 from bluewave-labs/fix/latest-incident-overflow
fix: latest incidents panel overflow text on smaller devices
This commit is contained in:
1 file changed
+38
-19
@@ -6,6 +6,7 @@ import { getHumanReadableDuration } from "@/Utils/timeUtilsLegacy.js";
|
|||||||
import Icon from "@/Components/v1/Icon";
|
import Icon from "@/Components/v1/Icon";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import useGetIncidentsDuration from "../../hooks/useGetIncidentsDuration";
|
import useGetIncidentsDuration from "../../hooks/useGetIncidentsDuration";
|
||||||
|
import { Grid } from "@mui/material";
|
||||||
|
|
||||||
const IncidentItem = ({ incident }) => {
|
const IncidentItem = ({ incident }) => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
@@ -28,20 +29,24 @@ const IncidentItem = ({ incident }) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Box
|
<Grid
|
||||||
|
container
|
||||||
|
alignItems="center"
|
||||||
|
spacing={2}
|
||||||
sx={{
|
sx={{
|
||||||
display: "grid",
|
|
||||||
gridTemplateColumns: "1fr 100px 80px",
|
|
||||||
alignItems: "center",
|
|
||||||
gap: theme.spacing(2),
|
|
||||||
width: "100%",
|
width: "100%",
|
||||||
py: theme.spacing(0.5),
|
py: theme.spacing(0.5),
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Stack
|
<Grid
|
||||||
direction="row"
|
item
|
||||||
alignItems="center"
|
xs={12}
|
||||||
gap={theme.spacing(2)}
|
lg={5}
|
||||||
|
sx={{
|
||||||
|
display: "flex",
|
||||||
|
alignItems: "center",
|
||||||
|
gap: theme.spacing(2),
|
||||||
|
}}
|
||||||
>
|
>
|
||||||
<Box sx={iconWrapperStyle}>
|
<Box sx={iconWrapperStyle}>
|
||||||
<Icon
|
<Icon
|
||||||
@@ -56,9 +61,18 @@ const IncidentItem = ({ incident }) => {
|
|||||||
>
|
>
|
||||||
{incident.monitorName || t("incidentsPage.unknownMonitor")}
|
{incident.monitorName || t("incidentsPage.unknownMonitor")}
|
||||||
</Typography>
|
</Typography>
|
||||||
</Stack>
|
</Grid>
|
||||||
|
|
||||||
<Box sx={{ display: "flex", justifyContent: "center" }}>
|
<Grid
|
||||||
|
item
|
||||||
|
xs={12}
|
||||||
|
md={6}
|
||||||
|
lg={3}
|
||||||
|
sx={{
|
||||||
|
display: "flex",
|
||||||
|
justifyContent: { xs: "flex-start", md: "center" },
|
||||||
|
}}
|
||||||
|
>
|
||||||
<StatusLabel
|
<StatusLabel
|
||||||
status={isActive ? "down" : "up"}
|
status={isActive ? "down" : "up"}
|
||||||
text={isActive ? t("incidentsPage.active") : t("incidentsPage.resolved")}
|
text={isActive ? t("incidentsPage.active") : t("incidentsPage.resolved")}
|
||||||
@@ -66,16 +80,21 @@ const IncidentItem = ({ incident }) => {
|
|||||||
textTransform: "capitalize",
|
textTransform: "capitalize",
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</Box>
|
</Grid>
|
||||||
|
|
||||||
<Typography
|
<Grid
|
||||||
variant="body1"
|
item
|
||||||
fontWeight={500}
|
xs={12}
|
||||||
textAlign="right"
|
md={6}
|
||||||
|
lg={4}
|
||||||
|
sx={{
|
||||||
|
textAlign: { xs: "left", md: "right" },
|
||||||
|
fontWeight: 500,
|
||||||
|
}}
|
||||||
>
|
>
|
||||||
{duration}
|
<Typography variant="body1">{duration}</Typography>
|
||||||
</Typography>
|
</Grid>
|
||||||
</Box>
|
</Grid>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user