Skip to content

Commit f1cf40f

Browse files
Merge pull request #82 from OpenZeppelin/chore/add-builder-to-stellar
chore: added ui builder to stellar navigation tree
2 parents 8c01a03 + eb9a564 commit f1cf40f

3 files changed

Lines changed: 57 additions & 4 deletions

File tree

src/components/layout/docs-layout-client.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@ export function DocsLayoutClient({ children }: DocsLayoutClientProps) {
3333
}
3434

3535
const isSharedPath =
36-
pathname.startsWith("/monitor") || pathname.startsWith("/relayer");
36+
pathname.startsWith("/monitor") ||
37+
pathname.startsWith("/relayer") ||
38+
pathname.startsWith("/ui-builder");
3739
const lastEcosystem =
3840
typeof window !== "undefined"
3941
? sessionStorage.getItem("lastEcosystem")
@@ -42,7 +44,7 @@ export function DocsLayoutClient({ children }: DocsLayoutClientProps) {
4244
// Include shared paths in Stellar tab only if coming from Stellar context
4345
const stellarUrls =
4446
isSharedPath && lastEcosystem === "stellar"
45-
? new Set(["/stellar-contracts", "/monitor", "/relayer"])
47+
? new Set(["/stellar-contracts", "/monitor", "/relayer", "/ui-builder"])
4648
: new Set(["/stellar-contracts"]);
4749

4850
// Include shared paths in Polkadot tab only if coming from Polkadot context

src/hooks/use-navigation-tree.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,14 @@ export function useNavigationTree() {
3232
pathname.startsWith("/community-contracts") ||
3333
pathname.startsWith("/upgrades-plugins") ||
3434
pathname.startsWith("/wizard") ||
35-
pathname.startsWith("/ui-builder") ||
3635
pathname.startsWith("/upgrades") ||
3736
pathname.startsWith("/defender") ||
3837
pathname.startsWith("/tools")
3938
) {
4039
sessionStorage.setItem("lastEcosystem", "ethereum");
4140
}
41+
// Note: /ui-builder, /monitor, and /relayer paths are intentionally NOT set here
42+
// They inherit the lastEcosystem from whichever tab the user was in before navigating
4243
}, [pathname]);
4344

4445
// Determine which navigation tree to use based on the current path
@@ -67,7 +68,11 @@ export function useNavigationTree() {
6768
if (typeof window !== "undefined") {
6869
const lastEcosystem = sessionStorage.getItem("lastEcosystem");
6970

70-
if (pathname.startsWith("/monitor") || pathname.startsWith("/relayer")) {
71+
if (
72+
pathname.startsWith("/monitor") ||
73+
pathname.startsWith("/relayer") ||
74+
pathname.startsWith("/ui-builder")
75+
) {
7176
switch (lastEcosystem) {
7277
case "stellar":
7378
return stellarTree;

src/navigation/stellar.json

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -511,5 +511,51 @@
511511
"external": true
512512
}
513513
]
514+
},
515+
{
516+
"type": "folder",
517+
"name": "UI Builder",
518+
"children": [
519+
{
520+
"type": "page",
521+
"name": "Quickstart",
522+
"url": "/ui-builder"
523+
},
524+
{
525+
"type": "page",
526+
"name": "Networks",
527+
"url": "/ui-builder/networks"
528+
},
529+
{
530+
"type": "page",
531+
"name": "Loading Contracts",
532+
"url": "/ui-builder/loading-contracts"
533+
},
534+
{
535+
"type": "page",
536+
"name": "Functions",
537+
"url": "/ui-builder/functions"
538+
},
539+
{
540+
"type": "page",
541+
"name": "Customization",
542+
"url": "/ui-builder/customization"
543+
},
544+
{
545+
"type": "page",
546+
"name": "Exporting and History",
547+
"url": "/ui-builder/exporting-and-history"
548+
},
549+
{
550+
"type": "page",
551+
"name": "Building Adapters",
552+
"url": "/ui-builder/building-adapters"
553+
},
554+
{
555+
"type": "page",
556+
"name": "Changelog",
557+
"url": "/ui-builder/changelog"
558+
}
559+
]
514560
}
515561
]

0 commit comments

Comments
 (0)