Skip to content

Commit 51cb6d3

Browse files
committed
chore: Fixing lint issue
1 parent 37a5e3f commit 51cb6d3

File tree

1 file changed

+66
-66
lines changed

1 file changed

+66
-66
lines changed

src/hooks/use-navigation-tree.ts

Lines changed: 66 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -3,79 +3,79 @@
33
import { usePathname } from "next/navigation";
44
import { useEffect } from "react";
55
import {
6-
arbitrumStylusTree,
7-
ethereumEvmTree,
8-
midnightTree,
9-
polkadotTree,
10-
starknetTree,
11-
stellarTree,
12-
uniswapTree,
13-
zamaTree,
6+
arbitrumStylusTree,
7+
ethereumEvmTree,
8+
midnightTree,
9+
polkadotTree,
10+
starknetTree,
11+
stellarTree,
12+
uniswapTree,
13+
zamaTree,
1414
} from "@/navigation";
1515

1616
export function useNavigationTree() {
17-
const pathname = usePathname();
17+
const pathname = usePathname();
1818

19-
// Track ecosystem changes in sessionStorage
20-
useEffect(() => {
21-
if (typeof window === "undefined") return;
19+
// Track ecosystem changes in sessionStorage
20+
useEffect(() => {
21+
if (typeof window === "undefined") return;
2222

23-
if (pathname.startsWith("/stellar-contracts")) {
24-
sessionStorage.setItem("lastEcosystem", "stellar");
25-
} else if (pathname.startsWith("/substrate-runtimes")) {
26-
sessionStorage.setItem("lastEcosystem", "polkadot");
27-
} else if (
28-
pathname.startsWith("/contracts") ||
29-
pathname.startsWith("/community-contracts") ||
30-
pathname.startsWith("/upgrades-plugins") ||
31-
pathname.startsWith("/wizard") ||
32-
pathname.startsWith("/ui-builder") ||
33-
pathname.startsWith("/upgrades") ||
34-
pathname.startsWith("/defender") ||
35-
pathname.startsWith("/tools")
36-
) {
37-
sessionStorage.setItem("lastEcosystem", "ethereum");
38-
}
39-
}, [pathname]);
23+
if (pathname.startsWith("/stellar-contracts")) {
24+
sessionStorage.setItem("lastEcosystem", "stellar");
25+
} else if (pathname.startsWith("/substrate-runtimes")) {
26+
sessionStorage.setItem("lastEcosystem", "polkadot");
27+
} else if (
28+
pathname.startsWith("/contracts") ||
29+
pathname.startsWith("/community-contracts") ||
30+
pathname.startsWith("/upgrades-plugins") ||
31+
pathname.startsWith("/wizard") ||
32+
pathname.startsWith("/ui-builder") ||
33+
pathname.startsWith("/upgrades") ||
34+
pathname.startsWith("/defender") ||
35+
pathname.startsWith("/tools")
36+
) {
37+
sessionStorage.setItem("lastEcosystem", "ethereum");
38+
}
39+
}, [pathname]);
4040

41-
// Determine which navigation tree to use based on the current path
42-
if (pathname.startsWith("/contracts-stylus")) {
43-
return arbitrumStylusTree;
44-
} else if (pathname.startsWith("/contracts-cairo")) {
45-
return starknetTree;
46-
} else if (pathname.startsWith("/stellar-contracts")) {
47-
return stellarTree;
48-
} else if (pathname.startsWith("/contracts-compact")) {
49-
return midnightTree;
50-
} else if (pathname.startsWith("/confidential-contracts")) {
51-
return zamaTree;
52-
} else if (pathname.startsWith("/uniswap-hooks")) {
53-
return uniswapTree;
54-
} else if (pathname.startsWith("/substrate-runtimes")) {
55-
return polkadotTree;
56-
} else if (pathname.startsWith("/tools")) {
57-
return ethereumEvmTree;
58-
}
41+
// Determine which navigation tree to use based on the current path
42+
if (pathname.startsWith("/contracts-stylus")) {
43+
return arbitrumStylusTree;
44+
} else if (pathname.startsWith("/contracts-cairo")) {
45+
return starknetTree;
46+
} else if (pathname.startsWith("/stellar-contracts")) {
47+
return stellarTree;
48+
} else if (pathname.startsWith("/contracts-compact")) {
49+
return midnightTree;
50+
} else if (pathname.startsWith("/confidential-contracts")) {
51+
return zamaTree;
52+
} else if (pathname.startsWith("/uniswap-hooks")) {
53+
return uniswapTree;
54+
} else if (pathname.startsWith("/substrate-runtimes")) {
55+
return polkadotTree;
56+
} else if (pathname.startsWith("/tools")) {
57+
return ethereumEvmTree;
58+
}
5959

60-
// For shared paths like /monitor and /relayer, check sessionStorage to see
61-
// which ecosystem was last active, defaulting to ethereumEvmTree
62-
if (typeof window !== "undefined") {
63-
const lastEcosystem = sessionStorage.getItem("lastEcosystem");
60+
// For shared paths like /monitor and /relayer, check sessionStorage to see
61+
// which ecosystem was last active, defaulting to ethereumEvmTree
62+
if (typeof window !== "undefined") {
63+
const lastEcosystem = sessionStorage.getItem("lastEcosystem");
6464

65-
if (pathname.startsWith("/monitor") || pathname.startsWith("/relayer")) {
66-
switch (lastEcosystem) {
67-
case "stellar":
68-
return stellarTree;
69-
case "polkadot":
70-
return polkadotTree;
71-
case "ethereum":
72-
return ethereumEvmTree;
73-
default:
74-
return ethereumEvmTree;
75-
}
76-
}
77-
}
65+
if (pathname.startsWith("/monitor") || pathname.startsWith("/relayer")) {
66+
switch (lastEcosystem) {
67+
case "stellar":
68+
return stellarTree;
69+
case "polkadot":
70+
return polkadotTree;
71+
case "ethereum":
72+
return ethereumEvmTree;
73+
default:
74+
return ethereumEvmTree;
75+
}
76+
}
77+
}
7878

79-
// Default to ethereumEvmTree for other paths
80-
return ethereumEvmTree;
79+
// Default to ethereumEvmTree for other paths
80+
return ethereumEvmTree;
8181
}

0 commit comments

Comments
 (0)