conditional rendering for public status page
This commit is contained in:
1 parent
f3266e22e7
commit
b4c8171c70
1 file changed
+16
-1
@@ -20,8 +20,12 @@ import { useSubscribeToDetails } from "../Details/Hooks/useSubscribeToDetails";
|
|||||||
import { useStatusPageFetchByUrl } from "./Hooks/useStatusPageFetchByUrl";
|
import { useStatusPageFetchByUrl } from "./Hooks/useStatusPageFetchByUrl";
|
||||||
import { useStatusPageDelete } from "../../StatusPage/Status/Hooks/useStatusPageDelete";
|
import { useStatusPageDelete } from "../../StatusPage/Status/Hooks/useStatusPageDelete";
|
||||||
import { useNavigate } from "react-router-dom";
|
import { useNavigate } from "react-router-dom";
|
||||||
|
import { useLocation } from "react-router-dom";
|
||||||
const DistributedUptimeStatus = () => {
|
const DistributedUptimeStatus = () => {
|
||||||
const { url } = useParams();
|
const { url } = useParams();
|
||||||
|
const location = useLocation();
|
||||||
|
const isPublic = location.pathname.startsWith("/distributed-uptime/status/public");
|
||||||
|
|
||||||
// Local State
|
// Local State
|
||||||
const [dateRange, setDateRange] = useState("day");
|
const [dateRange, setDateRange] = useState("day");
|
||||||
const [isDeleteOpen, setIsDeleteOpen] = useState(false);
|
const [isDeleteOpen, setIsDeleteOpen] = useState(false);
|
||||||
@@ -45,6 +49,16 @@ const DistributedUptimeStatus = () => {
|
|||||||
{ name: "status", path: `` },
|
{ name: "status", path: `` },
|
||||||
];
|
];
|
||||||
|
|
||||||
|
let sx = {};
|
||||||
|
if (isPublic) {
|
||||||
|
sx = {
|
||||||
|
paddingTop: "10vh",
|
||||||
|
paddingRight: "10vw",
|
||||||
|
paddingBottom: "10vh",
|
||||||
|
paddingLeft: "10vw",
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
if (networkError) {
|
if (networkError) {
|
||||||
return (
|
return (
|
||||||
<GenericFallback>
|
<GenericFallback>
|
||||||
@@ -75,8 +89,9 @@ const DistributedUptimeStatus = () => {
|
|||||||
<Stack
|
<Stack
|
||||||
direction="column"
|
direction="column"
|
||||||
gap={theme.spacing(10)}
|
gap={theme.spacing(10)}
|
||||||
|
sx={sx}
|
||||||
>
|
>
|
||||||
<Breadcrumbs list={BREADCRUMBS} />
|
{!isPublic && <Breadcrumbs list={BREADCRUMBS} />}
|
||||||
<ControlsHeader
|
<ControlsHeader
|
||||||
statusPage={statusPage}
|
statusPage={statusPage}
|
||||||
isDeleting={isDeleting}
|
isDeleting={isDeleting}
|
||||||
|
|||||||
Reference in new issue
Block a user