From b4c8171c704364836fdec9785484e7f86f70723a Mon Sep 17 00:00:00 2001 From: Alex Holliday Date: Fri, 7 Feb 2025 15:19:53 -0800 Subject: [PATCH] conditional rendering for public status page --- .../Pages/DistributedUptime/Status/index.jsx | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/Client/src/Pages/DistributedUptime/Status/index.jsx b/Client/src/Pages/DistributedUptime/Status/index.jsx index c2cee4c12..de71b51e3 100644 --- a/Client/src/Pages/DistributedUptime/Status/index.jsx +++ b/Client/src/Pages/DistributedUptime/Status/index.jsx @@ -20,8 +20,12 @@ import { useSubscribeToDetails } from "../Details/Hooks/useSubscribeToDetails"; import { useStatusPageFetchByUrl } from "./Hooks/useStatusPageFetchByUrl"; import { useStatusPageDelete } from "../../StatusPage/Status/Hooks/useStatusPageDelete"; import { useNavigate } from "react-router-dom"; +import { useLocation } from "react-router-dom"; const DistributedUptimeStatus = () => { const { url } = useParams(); + const location = useLocation(); + const isPublic = location.pathname.startsWith("/distributed-uptime/status/public"); + // Local State const [dateRange, setDateRange] = useState("day"); const [isDeleteOpen, setIsDeleteOpen] = useState(false); @@ -45,6 +49,16 @@ const DistributedUptimeStatus = () => { { name: "status", path: `` }, ]; + let sx = {}; + if (isPublic) { + sx = { + paddingTop: "10vh", + paddingRight: "10vw", + paddingBottom: "10vh", + paddingLeft: "10vw", + }; + } + if (networkError) { return ( @@ -75,8 +89,9 @@ const DistributedUptimeStatus = () => { - + {!isPublic && }