From 68354aac063554f8f8afc277c9b1bc045c586da7 Mon Sep 17 00:00:00 2001 From: nbgslv Date: Mon, 14 Apr 2025 21:04:24 +0300 Subject: [PATCH] Add Breadcrumbs component to status page for improved navigation --- src/Pages/StatusPage/Create/index.jsx | 15 +++++++++++++++ src/Pages/StatusPage/Status/index.jsx | 7 ++++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/src/Pages/StatusPage/Create/index.jsx b/src/Pages/StatusPage/Create/index.jsx index 1fa65d38f..034073174 100644 --- a/src/Pages/StatusPage/Create/index.jsx +++ b/src/Pages/StatusPage/Create/index.jsx @@ -3,6 +3,7 @@ import { Stack, Button, Typography } from "@mui/material"; import Tabs from "./Components/Tabs"; import GenericFallback from "../../../Components/GenericFallback"; import SkeletonLayout from "./Components/Skeleton"; +import Breadcrumbs from "../../../Components/Breadcrumbs/index.jsx"; //Utils import { useTheme } from "@emotion/react"; import { useState, useEffect, useRef, useCallback } from "react"; @@ -58,6 +59,19 @@ const CreateStatusPage = () => { const [statusPage, statusPageMonitors, statusPageIsLoading, statusPageNetworkError] = useStatusPageFetch(isCreate, url); + + // Breadcrumbs + const crumbs = [ + { name: "status pages", path: "/status" }, + ]; + if (isCreate) { + crumbs.push({ name: "create", path: "/status/create" }); + } else { + crumbs.push( + { name: "details", path: `/status/uptime/${statusPage?.url}` }, + { name: "configure", path: "" } + ); + } // Handlers const handleFormChange = (e) => { @@ -218,6 +232,7 @@ const CreateStatusPage = () => { // Load fields return ( + { const { t } = useTranslation(); const location = useLocation(); const navigate = useNavigate(); + const crumbs = [ + { name: "status pages", path: "/status" }, + { name: "details", path: "" }, + ]; const [statusPage, monitors, isLoading, networkError, fetchStatusPage] = useStatusPageFetch(false, url); @@ -123,9 +128,9 @@ const PublicStatus = () => { return ( + {!isPublic && }