diff --git a/components/LinkTab.tsx b/components/LinkTab.tsx index f9878d3..dbd4e54 100644 --- a/components/LinkTab.tsx +++ b/components/LinkTab.tsx @@ -1,5 +1,6 @@ import clsx from 'clsx' import { Anchor } from 'components/Anchor' +import { useRouter } from 'next/router' export interface LinkTabProps { title: string @@ -11,6 +12,10 @@ export interface LinkTabProps { export const LinkTab = (props: LinkTabProps) => { const { title, description, href, isActive } = props + // get contract address from the router + const router = useRouter() + const { contractAddress } = router.query + return ( { isActive ? 'border-plumbus' : 'border-transparent', isActive ? 'bg-plumbus/5 hover:bg-plumbus/10' : 'hover:bg-white/5', )} - href={href} + href={href + (contractAddress ? `?contractAddress=${contractAddress as string}` : '')} >

{title}

{description} diff --git a/pages/collections/myCollections.tsx b/pages/collections/myCollections.tsx index 6a62f33..b9b4994 100644 --- a/pages/collections/myCollections.tsx +++ b/pages/collections/myCollections.tsx @@ -14,7 +14,7 @@ import { Tooltip } from 'components/Tooltip' import type { NextPage } from 'next' import { NextSeo } from 'next-seo' import { useCallback, useEffect, useState } from 'react' -import { FaCopy, FaRocket, FaSlidersH, FaStore } from 'react-icons/fa' +import { FaCopy, FaList, FaRocket, FaSlidersH, FaStore } from 'react-icons/fa' import { copy } from 'utils/clipboard' import { API_URL, STARGAZE_URL } from 'utils/constants' import { withMetadata } from 'utils/layout' @@ -48,10 +48,16 @@ const CollectionList: NextPage = () => { if (myCollections.length > 0) { myCollections.map(async (collection: any) => { await getMinterContractType(collection.minter) - .then((contractType) => { + .then(async (contractType) => { if (contractType?.includes('sg-base-minter')) { setMyOneOfOneCollections((prevState) => [...prevState, collection]) } else if (contractType?.includes('sg-minter') || contractType?.includes('flex')) { + const minterConfig = await (await wallet.getCosmWasmClient()) + .queryContractSmart(collection.minter, { config: {} }) + .catch(() => { + console.log('Unable to retrieve minter config') + }) + if (minterConfig?.whitelist) collection.whitelist = minterConfig.whitelist setMyStandardCollections((prevState) => [...prevState, collection]) } else if (contractType?.includes('open-edition')) { setMyOpenEditionCollections((prevState) => [...prevState, collection]) @@ -171,6 +177,31 @@ const CollectionList: NextPage = () => { + +
+ Whitelist: + + + + + +
+
@@ -187,6 +218,14 @@ const CollectionList: NextPage = () => { > + + + + +
diff --git a/pages/contracts/badgeHub/execute.tsx b/pages/contracts/badgeHub/execute.tsx index a7efabc..885e3d8 100644 --- a/pages/contracts/badgeHub/execute.tsx +++ b/pages/contracts/badgeHub/execute.tsx @@ -489,6 +489,9 @@ const BadgeHubExecutePage: NextPage = () => { if (contractAddress.length > 0) { void router.replace({ query: { contractAddress } }) } + if (contractAddress.length === 0) { + void router.replace({ query: {} }) + } // eslint-disable-next-line react-hooks/exhaustive-deps }, [contractAddress]) diff --git a/pages/contracts/badgeHub/migrate.tsx b/pages/contracts/badgeHub/migrate.tsx index 813318f..dd3c58f 100644 --- a/pages/contracts/badgeHub/migrate.tsx +++ b/pages/contracts/badgeHub/migrate.tsx @@ -81,6 +81,9 @@ const BadgeHubMigratePage: NextPage = () => { if (contractAddress.length > 0) { void router.replace({ query: { contractAddress } }) } + if (contractAddress.length === 0) { + void router.replace({ query: {} }) + } // eslint-disable-next-line react-hooks/exhaustive-deps }, [contractAddress]) useEffect(() => { diff --git a/pages/contracts/badgeHub/query.tsx b/pages/contracts/badgeHub/query.tsx index 515630b..a9d47ad 100644 --- a/pages/contracts/badgeHub/query.tsx +++ b/pages/contracts/badgeHub/query.tsx @@ -116,6 +116,9 @@ const BadgeHubQueryPage: NextPage = () => { if (contractAddress.length > 0) { void router.replace({ query: { contractAddress } }) } + if (contractAddress.length === 0) { + void router.replace({ query: {} }) + } // eslint-disable-next-line react-hooks/exhaustive-deps }, [contractAddress]) useEffect(() => { diff --git a/pages/contracts/baseMinter/execute.tsx b/pages/contracts/baseMinter/execute.tsx index df939ae..2aacdf5 100644 --- a/pages/contracts/baseMinter/execute.tsx +++ b/pages/contracts/baseMinter/execute.tsx @@ -96,6 +96,9 @@ const BaseMinterExecutePage: NextPage = () => { if (contractAddress.length > 0) { void router.replace({ query: { contractAddress } }) } + if (contractAddress.length === 0) { + void router.replace({ query: {} }) + } // eslint-disable-next-line react-hooks/exhaustive-deps }, [contractAddress]) useEffect(() => { diff --git a/pages/contracts/baseMinter/migrate.tsx b/pages/contracts/baseMinter/migrate.tsx index fb1c7d5..4471aa5 100644 --- a/pages/contracts/baseMinter/migrate.tsx +++ b/pages/contracts/baseMinter/migrate.tsx @@ -81,6 +81,9 @@ const BaseMinterMigratePage: NextPage = () => { if (contractAddress.length > 0) { void router.replace({ query: { contractAddress } }) } + if (contractAddress.length === 0) { + void router.replace({ query: {} }) + } // eslint-disable-next-line react-hooks/exhaustive-deps }, [contractAddress]) useEffect(() => { diff --git a/pages/contracts/baseMinter/query.tsx b/pages/contracts/baseMinter/query.tsx index 0e9b384..6c8ac85 100644 --- a/pages/contracts/baseMinter/query.tsx +++ b/pages/contracts/baseMinter/query.tsx @@ -68,6 +68,9 @@ const BaseMinterQueryPage: NextPage = () => { if (contractAddress.length > 0) { void router.replace({ query: { contractAddress } }) } + if (contractAddress.length === 0) { + void router.replace({ query: {} }) + } // eslint-disable-next-line react-hooks/exhaustive-deps }, [contractAddress]) useEffect(() => { diff --git a/pages/contracts/openEditionMinter/execute.tsx b/pages/contracts/openEditionMinter/execute.tsx index 4c4bc61..63cb7e2 100644 --- a/pages/contracts/openEditionMinter/execute.tsx +++ b/pages/contracts/openEditionMinter/execute.tsx @@ -188,6 +188,9 @@ const OpenEditionMinterExecutePage: NextPage = () => { if (contractAddress.length > 0) { void router.replace({ query: { contractAddress } }) } + if (contractAddress.length === 0) { + void router.replace({ query: {} }) + } // eslint-disable-next-line react-hooks/exhaustive-deps }, [contractAddress]) useEffect(() => { diff --git a/pages/contracts/openEditionMinter/migrate.tsx b/pages/contracts/openEditionMinter/migrate.tsx index 41b0de4..cf0e552 100644 --- a/pages/contracts/openEditionMinter/migrate.tsx +++ b/pages/contracts/openEditionMinter/migrate.tsx @@ -81,6 +81,9 @@ const OpenEditionMinterMigratePage: NextPage = () => { if (contractAddress.length > 0) { void router.replace({ query: { contractAddress } }) } + if (contractAddress.length === 0) { + void router.replace({ query: {} }) + } // eslint-disable-next-line react-hooks/exhaustive-deps }, [contractAddress]) useEffect(() => { diff --git a/pages/contracts/openEditionMinter/query.tsx b/pages/contracts/openEditionMinter/query.tsx index 19ac09a..63d1a08 100644 --- a/pages/contracts/openEditionMinter/query.tsx +++ b/pages/contracts/openEditionMinter/query.tsx @@ -73,6 +73,9 @@ const OpenEditionMinterQueryPage: NextPage = () => { if (contractAddress.length > 0) { void router.replace({ query: { contractAddress } }) } + if (contractAddress.length === 0) { + void router.replace({ query: {} }) + } // eslint-disable-next-line react-hooks/exhaustive-deps }, [contractAddress]) useEffect(() => { diff --git a/pages/contracts/sg721/execute.tsx b/pages/contracts/sg721/execute.tsx index 52b9f85..ff0e091 100644 --- a/pages/contracts/sg721/execute.tsx +++ b/pages/contracts/sg721/execute.tsx @@ -141,6 +141,9 @@ const Sg721ExecutePage: NextPage = () => { if (contractAddress.length > 0) { void router.replace({ query: { contractAddress } }) } + if (contractAddress.length === 0) { + void router.replace({ query: {} }) + } // eslint-disable-next-line react-hooks/exhaustive-deps }, [contractAddress]) useEffect(() => { diff --git a/pages/contracts/sg721/migrate.tsx b/pages/contracts/sg721/migrate.tsx index a2c2032..d8bd73a 100644 --- a/pages/contracts/sg721/migrate.tsx +++ b/pages/contracts/sg721/migrate.tsx @@ -81,6 +81,9 @@ const Sg721MigratePage: NextPage = () => { if (contractAddress.length > 0) { void router.replace({ query: { contractAddress } }) } + if (contractAddress.length === 0) { + void router.replace({ query: {} }) + } // eslint-disable-next-line react-hooks/exhaustive-deps }, [contractAddress]) useEffect(() => { diff --git a/pages/contracts/sg721/query.tsx b/pages/contracts/sg721/query.tsx index 4a57596..0b8ed15 100644 --- a/pages/contracts/sg721/query.tsx +++ b/pages/contracts/sg721/query.tsx @@ -85,6 +85,9 @@ const Sg721QueryPage: NextPage = () => { if (contractAddress.length > 0) { void router.replace({ query: { contractAddress } }) } + if (contractAddress.length === 0) { + void router.replace({ query: {} }) + } // eslint-disable-next-line react-hooks/exhaustive-deps }, [contractAddress]) useEffect(() => { diff --git a/pages/contracts/splits/execute.tsx b/pages/contracts/splits/execute.tsx index 2a2e047..79ef9f6 100644 --- a/pages/contracts/splits/execute.tsx +++ b/pages/contracts/splits/execute.tsx @@ -89,6 +89,9 @@ const SplitsExecutePage: NextPage = () => { if (contractAddress.length > 0) { void router.replace({ query: { contractAddress } }) } + if (contractAddress.length === 0) { + void router.replace({ query: {} }) + } // eslint-disable-next-line react-hooks/exhaustive-deps }, [contractAddress]) useEffect(() => { diff --git a/pages/contracts/splits/migrate.tsx b/pages/contracts/splits/migrate.tsx index d191fc0..2d52da7 100644 --- a/pages/contracts/splits/migrate.tsx +++ b/pages/contracts/splits/migrate.tsx @@ -82,6 +82,9 @@ const SplitsMigratePage: NextPage = () => { if (contractAddress.length > 0) { void router.replace({ query: { contractAddress } }) } + if (contractAddress.length === 0) { + void router.replace({ query: {} }) + } // eslint-disable-next-line react-hooks/exhaustive-deps }, [contractAddress]) useEffect(() => { diff --git a/pages/contracts/splits/query.tsx b/pages/contracts/splits/query.tsx index 41341cd..317d263 100644 --- a/pages/contracts/splits/query.tsx +++ b/pages/contracts/splits/query.tsx @@ -99,6 +99,9 @@ const SplitsQueryPage: NextPage = () => { if (contractAddress.length > 0) { void router.replace({ query: { contractAddress } }) } + if (contractAddress.length === 0) { + void router.replace({ query: {} }) + } // eslint-disable-next-line react-hooks/exhaustive-deps }, [contractAddress]) useEffect(() => { diff --git a/pages/contracts/vendingMinter/execute.tsx b/pages/contracts/vendingMinter/execute.tsx index 35d11b0..b7083fb 100644 --- a/pages/contracts/vendingMinter/execute.tsx +++ b/pages/contracts/vendingMinter/execute.tsx @@ -196,6 +196,9 @@ const VendingMinterExecutePage: NextPage = () => { if (contractAddress.length > 0) { void router.replace({ query: { contractAddress } }) } + if (contractAddress.length === 0) { + void router.replace({ query: {} }) + } // eslint-disable-next-line react-hooks/exhaustive-deps }, [contractAddress]) useEffect(() => { diff --git a/pages/contracts/vendingMinter/migrate.tsx b/pages/contracts/vendingMinter/migrate.tsx index c60a9eb..4a3e698 100644 --- a/pages/contracts/vendingMinter/migrate.tsx +++ b/pages/contracts/vendingMinter/migrate.tsx @@ -81,6 +81,9 @@ const VendingMinterMigratePage: NextPage = () => { if (contractAddress.length > 0) { void router.replace({ query: { contractAddress } }) } + if (contractAddress.length === 0) { + void router.replace({ query: {} }) + } // eslint-disable-next-line react-hooks/exhaustive-deps }, [contractAddress]) useEffect(() => { diff --git a/pages/contracts/vendingMinter/query.tsx b/pages/contracts/vendingMinter/query.tsx index 2b42592..b3013f1 100644 --- a/pages/contracts/vendingMinter/query.tsx +++ b/pages/contracts/vendingMinter/query.tsx @@ -73,6 +73,9 @@ const VendingMinterQueryPage: NextPage = () => { if (contractAddress.length > 0) { void router.replace({ query: { contractAddress } }) } + if (contractAddress.length === 0) { + void router.replace({ query: {} }) + } // eslint-disable-next-line react-hooks/exhaustive-deps }, [contractAddress]) useEffect(() => { diff --git a/pages/contracts/whitelist/execute.tsx b/pages/contracts/whitelist/execute.tsx index 9b13ede..f1023bc 100644 --- a/pages/contracts/whitelist/execute.tsx +++ b/pages/contracts/whitelist/execute.tsx @@ -168,6 +168,9 @@ const WhitelistExecutePage: NextPage = () => { if (contractAddress.length > 0) { void router.replace({ query: { contractAddress } }) } + if (contractAddress.length === 0) { + void router.replace({ query: {} }) + } // eslint-disable-next-line react-hooks/exhaustive-deps }, [contractAddress]) diff --git a/pages/contracts/whitelist/query.tsx b/pages/contracts/whitelist/query.tsx index 8f9f3b7..efa30ef 100644 --- a/pages/contracts/whitelist/query.tsx +++ b/pages/contracts/whitelist/query.tsx @@ -115,6 +115,9 @@ const WhitelistQueryPage: NextPage = () => { if (contractAddress.length > 0) { void router.replace({ query: { contractAddress } }) } + if (contractAddress.length === 0) { + void router.replace({ query: {} }) + } // eslint-disable-next-line react-hooks/exhaustive-deps }, [contractAddress]) useEffect(() => {