From b2d9b5ee4e2fd919be8fde6e82672eba5a69b267 Mon Sep 17 00:00:00 2001 From: Nicolas Molina Date: Fri, 24 Oct 2025 15:00:38 -0300 Subject: [PATCH 1/3] chore: Adding reference polkadot monitor --- src/navigation/polkadot.json | 62 ++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) diff --git a/src/navigation/polkadot.json b/src/navigation/polkadot.json index f08dc386..eaa76cc0 100644 --- a/src/navigation/polkadot.json +++ b/src/navigation/polkadot.json @@ -353,5 +353,67 @@ ] } ] + }, + { + "type": "folder", + "name": "Monitor", + "index": { + "type": "page", + "name": "Overview", + "url": "/monitor/1.1.x" + }, + "children": [ + { + "type": "page", + "name": "Quickstart", + "url": "/monitor/1.1.x/quickstart" + }, + { + "type": "page", + "name": "Architecture Guide", + "url": "/monitor/1.1.x/architecture" + }, + { + "type": "page", + "name": "Project Structure", + "url": "/monitor/1.1.x/project-structure" + }, + { + "type": "page", + "name": "RPC Client", + "url": "/monitor/1.1.x/rpc" + }, + { + "type": "page", + "name": "Custom scripts", + "url": "/monitor/1.1.x/scripts" + }, + { + "type": "page", + "name": "Error Handling", + "url": "/monitor/1.1.x/error" + }, + { + "type": "page", + "name": "Testing", + "url": "/monitor/1.1.x/testing" + }, + { + "type": "page", + "name": "Contribution guidelines", + "url": "/monitor/1.1.x/contribution" + }, + { + "type": "page", + "name": "Changelog", + "url": "/monitor/1.1.x/changelog" + }, + { + "type": "page", + "name": "Rust Book", + "url": "https://docs-v1-1--openzeppelin-monitor.netlify.app/openzeppelin_monitor/", + "external": true + } + ] } ] From 37a5e3f03d0dbb65654d7f7e238981698789cee3 Mon Sep 17 00:00:00 2001 From: Nicolas Molina Date: Fri, 24 Oct 2025 15:35:37 -0300 Subject: [PATCH 2/3] chore: Fixing polkadot navigation --- src/components/layout/docs-layout-client.tsx | 7 + src/hooks/use-navigation-tree.ts | 128 ++++++++++--------- src/navigation/polkadot.json | 4 + 3 files changed, 77 insertions(+), 62 deletions(-) diff --git a/src/components/layout/docs-layout-client.tsx b/src/components/layout/docs-layout-client.tsx index 409b22eb..b817c362 100644 --- a/src/components/layout/docs-layout-client.tsx +++ b/src/components/layout/docs-layout-client.tsx @@ -40,6 +40,12 @@ export function DocsLayoutClient({ children }: DocsLayoutClientProps) { ? new Set(["/stellar-contracts", "/monitor", "/relayer"]) : new Set(["/stellar-contracts"]); + // Include shared paths in Polkadot tab only if coming from Polkadot context + const polkadotUrls = + isSharedPath && lastEcosystem === "polkadot" + ? new Set(["/substrate-runtimes", "/monitor"]) + : new Set(["/substrate-runtimes"]); + return [ { title: "Ethereum & EVM", @@ -83,6 +89,7 @@ export function DocsLayoutClient({ children }: DocsLayoutClientProps) { title: "Polkadot", url: "/substrate-runtimes", icon: , + urls: polkadotUrls, }, { title: "Uniswap Hooks", diff --git a/src/hooks/use-navigation-tree.ts b/src/hooks/use-navigation-tree.ts index 2f0a0e3f..e18589e8 100644 --- a/src/hooks/use-navigation-tree.ts +++ b/src/hooks/use-navigation-tree.ts @@ -3,75 +3,79 @@ import { usePathname } from "next/navigation"; import { useEffect } from "react"; import { - arbitrumStylusTree, - ethereumEvmTree, - midnightTree, - polkadotTree, - starknetTree, - stellarTree, - uniswapTree, - zamaTree, + arbitrumStylusTree, + ethereumEvmTree, + midnightTree, + polkadotTree, + starknetTree, + stellarTree, + uniswapTree, + zamaTree, } from "@/navigation"; export function useNavigationTree() { - const pathname = usePathname(); + const pathname = usePathname(); - // Track ecosystem changes in sessionStorage - useEffect(() => { - if (typeof window === "undefined") return; + // Track ecosystem changes in sessionStorage + useEffect(() => { + if (typeof window === "undefined") return; - if (pathname.startsWith("/stellar-contracts")) { - sessionStorage.setItem("lastEcosystem", "stellar"); - } else if ( - pathname.startsWith("/contracts") || - pathname.startsWith("/community-contracts") || - pathname.startsWith("/upgrades-plugins") || - pathname.startsWith("/wizard") || - pathname.startsWith("/ui-builder") || - pathname.startsWith("/upgrades") || - pathname.startsWith("/defender") || - pathname.startsWith("/tools") - ) { - sessionStorage.setItem("lastEcosystem", "ethereum"); - } - }, [pathname]); + if (pathname.startsWith("/stellar-contracts")) { + sessionStorage.setItem("lastEcosystem", "stellar"); + } else if (pathname.startsWith("/substrate-runtimes")) { + sessionStorage.setItem("lastEcosystem", "polkadot"); + } else if ( + pathname.startsWith("/contracts") || + pathname.startsWith("/community-contracts") || + pathname.startsWith("/upgrades-plugins") || + pathname.startsWith("/wizard") || + pathname.startsWith("/ui-builder") || + pathname.startsWith("/upgrades") || + pathname.startsWith("/defender") || + pathname.startsWith("/tools") + ) { + sessionStorage.setItem("lastEcosystem", "ethereum"); + } + }, [pathname]); - // Determine which navigation tree to use based on the current path - if (pathname.startsWith("/contracts-stylus")) { - return arbitrumStylusTree; - } else if (pathname.startsWith("/contracts-cairo")) { - return starknetTree; - } else if (pathname.startsWith("/stellar-contracts")) { - return stellarTree; - } else if (pathname.startsWith("/contracts-compact")) { - return midnightTree; - } else if (pathname.startsWith("/confidential-contracts")) { - return zamaTree; - } else if (pathname.startsWith("/uniswap-hooks")) { - return uniswapTree; - } else if (pathname.startsWith("/substrate-runtimes")) { - return polkadotTree; - } else if (pathname.startsWith("/tools")) { - return ethereumEvmTree; - } + // Determine which navigation tree to use based on the current path + if (pathname.startsWith("/contracts-stylus")) { + return arbitrumStylusTree; + } else if (pathname.startsWith("/contracts-cairo")) { + return starknetTree; + } else if (pathname.startsWith("/stellar-contracts")) { + return stellarTree; + } else if (pathname.startsWith("/contracts-compact")) { + return midnightTree; + } else if (pathname.startsWith("/confidential-contracts")) { + return zamaTree; + } else if (pathname.startsWith("/uniswap-hooks")) { + return uniswapTree; + } else if (pathname.startsWith("/substrate-runtimes")) { + return polkadotTree; + } else if (pathname.startsWith("/tools")) { + return ethereumEvmTree; + } - // For shared paths like /monitor and /relayer, check sessionStorage to see - // which ecosystem was last active, defaulting to ethereumEvmTree - if (typeof window !== "undefined") { - const lastEcosystem = sessionStorage.getItem("lastEcosystem"); + // For shared paths like /monitor and /relayer, check sessionStorage to see + // which ecosystem was last active, defaulting to ethereumEvmTree + if (typeof window !== "undefined") { + const lastEcosystem = sessionStorage.getItem("lastEcosystem"); - if (pathname.startsWith("/monitor") || pathname.startsWith("/relayer")) { - switch (lastEcosystem) { - case "stellar": - return stellarTree; - case "ethereum": - return ethereumEvmTree; - default: - return ethereumEvmTree; - } - } - } + if (pathname.startsWith("/monitor") || pathname.startsWith("/relayer")) { + switch (lastEcosystem) { + case "stellar": + return stellarTree; + case "polkadot": + return polkadotTree; + case "ethereum": + return ethereumEvmTree; + default: + return ethereumEvmTree; + } + } + } - // Default to ethereumEvmTree for other paths - return ethereumEvmTree; + // Default to ethereumEvmTree for other paths + return ethereumEvmTree; } diff --git a/src/navigation/polkadot.json b/src/navigation/polkadot.json index eaa76cc0..70c1c520 100644 --- a/src/navigation/polkadot.json +++ b/src/navigation/polkadot.json @@ -354,6 +354,10 @@ } ] }, + { + "type": "separator", + "name": "Open Source Tools" + }, { "type": "folder", "name": "Monitor", From 51cb6d3086416b9ad849f23d28a80c00291e3f22 Mon Sep 17 00:00:00 2001 From: Nicolas Molina Date: Fri, 24 Oct 2025 15:46:45 -0300 Subject: [PATCH 3/3] chore: Fixing lint issue --- src/hooks/use-navigation-tree.ts | 132 +++++++++++++++---------------- 1 file changed, 66 insertions(+), 66 deletions(-) diff --git a/src/hooks/use-navigation-tree.ts b/src/hooks/use-navigation-tree.ts index e18589e8..0cdb10f8 100644 --- a/src/hooks/use-navigation-tree.ts +++ b/src/hooks/use-navigation-tree.ts @@ -3,79 +3,79 @@ import { usePathname } from "next/navigation"; import { useEffect } from "react"; import { - arbitrumStylusTree, - ethereumEvmTree, - midnightTree, - polkadotTree, - starknetTree, - stellarTree, - uniswapTree, - zamaTree, + arbitrumStylusTree, + ethereumEvmTree, + midnightTree, + polkadotTree, + starknetTree, + stellarTree, + uniswapTree, + zamaTree, } from "@/navigation"; export function useNavigationTree() { - const pathname = usePathname(); + const pathname = usePathname(); - // Track ecosystem changes in sessionStorage - useEffect(() => { - if (typeof window === "undefined") return; + // Track ecosystem changes in sessionStorage + useEffect(() => { + if (typeof window === "undefined") return; - if (pathname.startsWith("/stellar-contracts")) { - sessionStorage.setItem("lastEcosystem", "stellar"); - } else if (pathname.startsWith("/substrate-runtimes")) { - sessionStorage.setItem("lastEcosystem", "polkadot"); - } else if ( - pathname.startsWith("/contracts") || - pathname.startsWith("/community-contracts") || - pathname.startsWith("/upgrades-plugins") || - pathname.startsWith("/wizard") || - pathname.startsWith("/ui-builder") || - pathname.startsWith("/upgrades") || - pathname.startsWith("/defender") || - pathname.startsWith("/tools") - ) { - sessionStorage.setItem("lastEcosystem", "ethereum"); - } - }, [pathname]); + if (pathname.startsWith("/stellar-contracts")) { + sessionStorage.setItem("lastEcosystem", "stellar"); + } else if (pathname.startsWith("/substrate-runtimes")) { + sessionStorage.setItem("lastEcosystem", "polkadot"); + } else if ( + pathname.startsWith("/contracts") || + pathname.startsWith("/community-contracts") || + pathname.startsWith("/upgrades-plugins") || + pathname.startsWith("/wizard") || + pathname.startsWith("/ui-builder") || + pathname.startsWith("/upgrades") || + pathname.startsWith("/defender") || + pathname.startsWith("/tools") + ) { + sessionStorage.setItem("lastEcosystem", "ethereum"); + } + }, [pathname]); - // Determine which navigation tree to use based on the current path - if (pathname.startsWith("/contracts-stylus")) { - return arbitrumStylusTree; - } else if (pathname.startsWith("/contracts-cairo")) { - return starknetTree; - } else if (pathname.startsWith("/stellar-contracts")) { - return stellarTree; - } else if (pathname.startsWith("/contracts-compact")) { - return midnightTree; - } else if (pathname.startsWith("/confidential-contracts")) { - return zamaTree; - } else if (pathname.startsWith("/uniswap-hooks")) { - return uniswapTree; - } else if (pathname.startsWith("/substrate-runtimes")) { - return polkadotTree; - } else if (pathname.startsWith("/tools")) { - return ethereumEvmTree; - } + // Determine which navigation tree to use based on the current path + if (pathname.startsWith("/contracts-stylus")) { + return arbitrumStylusTree; + } else if (pathname.startsWith("/contracts-cairo")) { + return starknetTree; + } else if (pathname.startsWith("/stellar-contracts")) { + return stellarTree; + } else if (pathname.startsWith("/contracts-compact")) { + return midnightTree; + } else if (pathname.startsWith("/confidential-contracts")) { + return zamaTree; + } else if (pathname.startsWith("/uniswap-hooks")) { + return uniswapTree; + } else if (pathname.startsWith("/substrate-runtimes")) { + return polkadotTree; + } else if (pathname.startsWith("/tools")) { + return ethereumEvmTree; + } - // For shared paths like /monitor and /relayer, check sessionStorage to see - // which ecosystem was last active, defaulting to ethereumEvmTree - if (typeof window !== "undefined") { - const lastEcosystem = sessionStorage.getItem("lastEcosystem"); + // For shared paths like /monitor and /relayer, check sessionStorage to see + // which ecosystem was last active, defaulting to ethereumEvmTree + if (typeof window !== "undefined") { + const lastEcosystem = sessionStorage.getItem("lastEcosystem"); - if (pathname.startsWith("/monitor") || pathname.startsWith("/relayer")) { - switch (lastEcosystem) { - case "stellar": - return stellarTree; - case "polkadot": - return polkadotTree; - case "ethereum": - return ethereumEvmTree; - default: - return ethereumEvmTree; - } - } - } + if (pathname.startsWith("/monitor") || pathname.startsWith("/relayer")) { + switch (lastEcosystem) { + case "stellar": + return stellarTree; + case "polkadot": + return polkadotTree; + case "ethereum": + return ethereumEvmTree; + default: + return ethereumEvmTree; + } + } + } - // Default to ethereumEvmTree for other paths - return ethereumEvmTree; + // Default to ethereumEvmTree for other paths + return ethereumEvmTree; }