Skip to content

Commit

Permalink
Fix footer Mainnet and Testnet switch (#535)
Browse files Browse the repository at this point in the history
  • Loading branch information
JayJay1024 authored Oct 18, 2023
1 parent 747427a commit 5f74ddf
Showing 1 changed file with 12 additions and 18 deletions.
30 changes: 12 additions & 18 deletions packages/apps/src/components/footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,19 @@ 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 === "helix-v2.vercel.app") {
setMainnetOrTestnet({ label: "Testnet", link: "https://helix-v2-test.vercel.app" });
} else if (window.location.hostname === "helix-v2-test.vercel.app") {
setMainnetOrTestnet({ label: "Mainnet", link: "https://helix-v2.vercel.app" });
if (window.location.hostname === "helixbridge.app") {
setMainnetOrTestnet({ label: "Testnet", link: "https://testnet.helixbridge.app" });
} else if (window.location.hostname === "testnet.helixbridge.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-dev.vercel.app") {
setMainnetOrTestnet({ label: "Mainnet", link: "https://helix-dev-test.vercel.app" });
} else if (window.location.hostname === "helix-dev-test.vercel.app") {
setMainnetOrTestnet({ label: "Mainnet", link: "https://helix-dev.vercel.app" });
}
}, []);

Expand Down

0 comments on commit 5f74ddf

Please sign in to comment.