Skip to content

Commit

Permalink
update mainnet and testnet switcher
Browse files Browse the repository at this point in the history
  • Loading branch information
JayJay1024 committed Oct 8, 2023
1 parent 3c52cf0 commit b1fd9c5
Showing 1 changed file with 18 additions and 10 deletions.
28 changes: 18 additions & 10 deletions packages/apps/src/components/footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,25 @@ import { PropsWithChildren, useEffect, useState } from "react";
export default function Footer() {
const [mainnetOrTestnet, setMainnetOrTestnet] = useState<{ label: "Mainnet" | "Testnet"; link: string }>();

// useEffect(() => {
// if (window.location.hostname === "helixbridge.app") {
// setMainnetOrTestnet({ label: "Testnet", link: "https://helix-apps-test.vercel.app" });
// } else if (window.location.hostname === "helix-apps-test.vercel.app") {
// setMainnetOrTestnet({ label: "Mainnet", link: "https://helixbridge.app" });
// } else if (window.location.hostname === "helix-stg.vercel.app") {
// setMainnetOrTestnet({ label: "Testnet", link: "https://helix-stg-test.vercel.app" });
// } else if (window.location.hostname === "helix-stg-test.vercel.app") {
// setMainnetOrTestnet({ label: "Mainnet", link: "https://helix-stg.vercel.app" });
// } else if (window.location.hostname === "helix-v2.vercel.app") {
// setMainnetOrTestnet({ label: "Mainnet", link: "https://helixbridge.app" });
// }
// }, []);

useEffect(() => {
if (window.location.hostname === "helixbridge.app") {
setMainnetOrTestnet({ label: "Testnet", link: "https://helix-apps-test.vercel.app" });
} else if (window.location.hostname === "helix-apps-test.vercel.app") {
setMainnetOrTestnet({ label: "Mainnet", link: "https://helixbridge.app" });
} else if (window.location.hostname === "helix-stg.vercel.app") {
setMainnetOrTestnet({ label: "Testnet", link: "https://helix-stg-test.vercel.app" });
} else if (window.location.hostname === "helix-stg-test.vercel.app") {
setMainnetOrTestnet({ label: "Mainnet", link: "https://helix-stg.vercel.app" });
} else if (window.location.hostname === "helix-v2.vercel.app") {
setMainnetOrTestnet({ label: "Mainnet", link: "https://helixbridge.app" });
if (window.location.hostname === "helix-v2.vercel.app") {
setMainnetOrTestnet({ label: "Testnet", link: "helix-v2-test.vercel.app" });
} else if (window.location.hostname === "helix-v2-test.vercel.app") {
setMainnetOrTestnet({ label: "Mainnet", link: "helix-v2.vercel.app" });
}
}, []);

Expand Down

0 comments on commit b1fd9c5

Please sign in to comment.