diff --git a/components/LinkTabs.data.ts b/components/LinkTabs.data.ts index e5664b7..70c22d6 100644 --- a/components/LinkTabs.data.ts +++ b/components/LinkTabs.data.ts @@ -171,3 +171,16 @@ export const authzLinkTabs: LinkTabProps[] = [ href: '/authz/revoke', }, ] + +export const snapshotLinkTabs: LinkTabProps[] = [ + { + title: 'Collection Holders', + description: `Take a snapshot of collection holders`, + href: '/snapshots/holders', + }, + { + title: 'Chain Snapshots', + description: `Export a list of users fulfilling a given condition`, + href: '/snapshots/chain', + }, +] diff --git a/pages/snapshots/chain.tsx b/pages/snapshots/chain.tsx new file mode 100644 index 0000000..5fdd6cf --- /dev/null +++ b/pages/snapshots/chain.tsx @@ -0,0 +1,98 @@ +/* eslint-disable eslint-comments/disable-enable-pair */ +/* eslint-disable @typescript-eslint/no-unsafe-call */ +/* eslint-disable @typescript-eslint/no-unsafe-member-access */ +/* eslint-disable @typescript-eslint/restrict-template-expressions */ +/* eslint-disable tailwindcss/classnames-order */ + +import { Button } from 'components/Button' +import { ContractPageHeader } from 'components/ContractPageHeader' +import { LinkTabs } from 'components/LinkTabs' +import { snapshotLinkTabs } from 'components/LinkTabs.data' +import type { NextPage } from 'next' +import { NextSeo } from 'next-seo' +import { useState } from 'react' +import toast from 'react-hot-toast' +// import Brand from 'public/brand/brand.svg' +import { withMetadata } from 'utils/layout' +import { links } from 'utils/links' + +export interface ChainDataType { + type: 'active-users' + endpoint: string +} + +const Chain: NextPage = () => { + const activeUsersEndpoint = `https://metabase.constellations.zone/public/question/cc17fce5-3cc4-4b03-b100-81bdf982f391.json` + const [chainDataType, setChainDataType] = useState({ + type: 'active-users', + endpoint: activeUsersEndpoint, + }) + const [isLoading, setIsLoading] = useState(false) + + const download = (content: string, fileName: string, contentType: string) => { + const a = document.createElement('a') + const file = new Blob([content], { type: contentType }) + a.href = URL.createObjectURL(file) + a.download = fileName + a.click() + } + + return ( +
+ + + +
+ Chain Data Type + +
+ + +
+ ) +} + +export default withMetadata(Chain, { center: false }) diff --git a/pages/snapshots/snapshot.tsx b/pages/snapshots/holders.tsx similarity index 92% rename from pages/snapshots/snapshot.tsx rename to pages/snapshots/holders.tsx index df07b9f..4ed360f 100644 --- a/pages/snapshots/snapshot.tsx +++ b/pages/snapshots/holders.tsx @@ -8,6 +8,8 @@ import { ContractPageHeader } from 'components/ContractPageHeader' import { AddressInput } from 'components/forms/FormInput' import { useInputState } from 'components/forms/FormInput.hooks' +import { LinkTabs } from 'components/LinkTabs' +import { snapshotLinkTabs } from 'components/LinkTabs.data' import { SelectCollection } from 'components/SelectCollection' import type { NextPage } from 'next' import { NextSeo } from 'next-seo' @@ -17,7 +19,7 @@ import toast from 'react-hot-toast' import { withMetadata } from 'utils/layout' import { links } from 'utils/links' -const Snapshots: NextPage = () => { +const Holders: NextPage = () => { const [collectionAddress, setCollectionAddress] = useState('') const collectionAddressState = useInputState({ id: 'collection-address', @@ -52,14 +54,14 @@ const Snapshots: NextPage = () => { link={links.Documentation} title="Snapshots" /> - +

Snapshot Options