From 789c6d7a4adf9a5d15db64d12386d16a78391096 Mon Sep 17 00:00:00 2001 From: Alex Holliday Date: Wed, 26 Feb 2025 13:38:25 -0800 Subject: [PATCH] conditionally render subheader --- src/Components/Subheader/index.jsx | 8 ++++++++ src/Pages/DistributedUptimeStatus/Status/index.jsx | 1 + 2 files changed, 9 insertions(+) diff --git a/src/Components/Subheader/index.jsx b/src/Components/Subheader/index.jsx index 12e802a78..a76696567 100644 --- a/src/Components/Subheader/index.jsx +++ b/src/Components/Subheader/index.jsx @@ -8,6 +8,7 @@ import { Stack, Typography } from "@mui/material"; * @component * @example * + * @param {boolean} props.shouldRender - Whether to render the subheader * @param {string} props.direction - Direction of the subheader * @param {string} props.headerText - Header text * @param {number} props.headerLevel - Font characteristic of the header @@ -19,6 +20,7 @@ import { Stack, Typography } from "@mui/material"; */ const SubHeader = ({ + shouldRender = true, direction = "row", headerText, headerLevel = 1, @@ -29,6 +31,11 @@ const SubHeader = ({ ...props }) => { const theme = useTheme(); + + if (!shouldRender) { + return null; + } + return ( { /> 0} direction={{ s: "column", md: "row" }} headerText={t("distributedStatusServerMonitors")} subHeaderText={t("distributedStatusServerMonitorsDescription")}