From f54d8474e33778a12bd1559513396c4592fd734b Mon Sep 17 00:00:00 2001 From: BrickheadJohnny Date: Tue, 28 Jan 2025 11:20:50 +0100 Subject: [PATCH] fix(Links): conditional `/token` or `/address` path --- .../[guild]/collect/components/Details/Details.tsx | 6 ++++-- src/components/[guild]/collect/components/Links.tsx | 7 ++++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/components/[guild]/collect/components/Details/Details.tsx b/src/components/[guild]/collect/components/Details/Details.tsx index 06f9bc8769..2162a6272f 100644 --- a/src/components/[guild]/collect/components/Details/Details.tsx +++ b/src/components/[guild]/collect/components/Details/Details.tsx @@ -6,7 +6,7 @@ import useNftDetails from "../../hooks/useNftDetails" import BlockExplorerLink from "./components/BlockExplorerLink" import InfoBlock from "./components/InfoBlock" -const ADDRESS_PATHS = ["IOTA"] as Chain[] +export const NFT_BLOCK_EXPLORER_ADDRESS_PATHS = ["IOTA"] as Chain[] const Details = () => { const { chain, nftAddress } = useCollectNftContext() @@ -21,7 +21,9 @@ const Details = () => { diff --git a/src/components/[guild]/collect/components/Links.tsx b/src/components/[guild]/collect/components/Links.tsx index 75f3f37f31..3953d66fc1 100644 --- a/src/components/[guild]/collect/components/Links.tsx +++ b/src/components/[guild]/collect/components/Links.tsx @@ -9,6 +9,7 @@ import capitalize from "utils/capitalize" import { openseaBaseUrl } from "utils/guildCheckout/constants" import { CHAIN_CONFIG } from "wagmiConfig/chains" import useNftDetails from "../hooks/useNftDetails" +import { NFT_BLOCK_EXPLORER_ADDRESS_PATHS } from "./Details/Details" const Links = () => { const { colorMode } = useColorMode() @@ -16,6 +17,10 @@ const Links = () => { const { totalSupply } = useNftDetails(chain, nftAddress) const { socialLinks } = useGuild() + const blockExplorerPath = NFT_BLOCK_EXPLORER_ADDRESS_PATHS.includes(chain) + ? "address" + : "token" + return (
@@ -46,7 +51,7 @@ const Links = () => { )}