Skip to content

Commit dda6f02

Browse files
committed
chore: fixes
1 parent 33f0fce commit dda6f02

File tree

1 file changed

+24
-4
lines changed

1 file changed

+24
-4
lines changed

components/NetworkResources.tsx

+24-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { useState } from "react";
1+
import React, { useState, useEffect } from "react";
22
import Link from "next/link";
33
import { BlockCopyButton } from "./ui/block-copy-button";
44
import {
@@ -94,7 +94,7 @@ const NETWORK_DATA = {
9494
testnet: [
9595
{ property: "Interfaces and Apps", value: "" },
9696
{
97-
property: "Tangle App",
97+
property: "Tangle dApp",
9898
value: {
9999
type: "link",
100100
url: "https://app.tangle.tools",
@@ -122,8 +122,8 @@ const NETWORK_DATA = {
122122
property: "Substrate Explorer",
123123
value: {
124124
type: "link",
125-
url: "https://tangle-testnet.statescan.io/",
126-
text: "tangle-testnet.statescan.io",
125+
url: "https://polkadot.js.org/apps/?rpc=wss://testnet-rpc.tangle.tools#/explorer",
126+
text: "polkadot.js.org/apps/?rpc=wss://testnet-rpc.tangle.tools",
127127
},
128128
},
129129
{ property: "Asset Details", value: "" },
@@ -173,8 +173,28 @@ const NETWORK_DATA = {
173173
const NetworkTabs = () => {
174174
const [activeTab, setActiveTab] = useState("mainnet");
175175

176+
// Set initial tab based on URL hash when component mounts
177+
useEffect(() => {
178+
// Get hash from URL (remove the # character)
179+
const hash = window.location.hash.substring(1);
180+
181+
// If hash matches one of our tabs, set it as active
182+
if (["mainnet", "testnet", "wallets", "evmToSubstrate"].includes(hash)) {
183+
setActiveTab(hash);
184+
} else {
185+
// Explicitly set to mainnet if no valid hash is present
186+
setActiveTab("mainnet");
187+
// If URL has no hash, we don't need to update it
188+
if (hash && hash !== "mainnet") {
189+
window.location.hash = "mainnet";
190+
}
191+
}
192+
}, []);
193+
176194
const handleTabClick = (tab) => {
177195
setActiveTab(tab);
196+
// Update URL hash when tab changes
197+
window.location.hash = tab;
178198
};
179199

180200
const renderValue = (value) => {

0 commit comments

Comments
 (0)