diff --git a/abi/CurationManager.json b/abi/CurationManager.json new file mode 100644 index 0000000..79c7d28 --- /dev/null +++ b/abi/CurationManager.json @@ -0,0 +1,314 @@ +{ + "abi": [ + { + "inputs": [ + { "internalType": "string", "name": "_title", "type": "string" }, + { + "internalType": "contract IERC721", + "name": "_curationPass", + "type": "address" + }, + { "internalType": "uint256", "name": "_curationLimit", "type": "uint256" }, + { "internalType": "bool", "name": "_isActive", "type": "bool" } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { "inputs": [], "name": "Access_MissingPass", "type": "error" }, + { "inputs": [], "name": "Access_Unauthorized", "type": "error" }, + { "inputs": [], "name": "CurationLimitExceeded", "type": "error" }, + { "inputs": [], "name": "Finalized", "type": "error" }, + { "inputs": [], "name": "Inactive", "type": "error" }, + { "inputs": [], "name": "ListingAlreadyExists", "type": "error" }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "CurationFinalized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "curationLimit", + "type": "uint256" + } + ], + "name": "CurationLimitUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "curationPass", + "type": "address" + } + ], + "name": "CurationPassUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "CurationPaused", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "CurationResumed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "curator", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "listingAddress", + "type": "address" + } + ], + "name": "ListingAdded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "curator", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "listingAddress", + "type": "address" + } + ], + "name": "ListingRemoved", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { "indexed": false, "internalType": "string", "name": "title", "type": "string" } + ], + "name": "TitleUpdated", + "type": "event" + }, + { + "inputs": [{ "internalType": "address", "name": "listing", "type": "address" }], + "name": "addListing", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "curationLimit", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "curationPass", + "outputs": [{ "internalType": "contract IERC721", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "finalizeCuration", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "flipIsActiveBool", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "isActive", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "isFinalized", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "", "type": "address" }], + "name": "listingCurators", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "name": "listings", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "listing", "type": "address" }], + "name": "onwerAddListing", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "listing", "type": "address" }], + "name": "ownerRemoveListing", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "listing", "type": "address" }], + "name": "removeListing", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "title", + "outputs": [{ "internalType": "string", "name": "", "type": "string" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "newOwner", "type": "address" }], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint256", "name": "_newLimit", "type": "uint256" }], + "name": "updateCurationLimit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "contract IERC721", "name": "_curationPass", "type": "address" } + ], + "name": "updateCurationPass", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "string", "name": "_title", "type": "string" }], + "name": "updateTitle", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "viewAllListings", + "outputs": [{ "internalType": "address[]", "name": "", "type": "address[]" }], + "stateMutability": "view", + "type": "function" + } + ] +} diff --git a/components/DropMintTest.tsx b/components/DropMintTest.tsx new file mode 100644 index 0000000..9d8c325 --- /dev/null +++ b/components/DropMintTest.tsx @@ -0,0 +1,135 @@ +// @ts-nocheck +import React from "react"; +import { + DropsContractProvider, + useDropsContractProvider, + addIPFSGateway +} from "@public-assembly/zora-drops-utils"; +import { useEnsName } from 'wagmi' + +function MintUI() { + const { + collectionData: data, + collectionAddress, + mintQuantity, + totalPrice, + transaction: { + purchaseLoading, + purchaseSuccess, + txHash, + }, + errors: { + insufficientFunds + }, + purchaseLimit: { + maxAmount, + prettyMaxAmount, + }, + inventory: { + prettyInventory + }, + balance: { + walletBalance, + walletLimit + }, + mintStatus: { + isActive, + isEnded, + startDate, + endDate, + }, + setMintQuantity, + purchase + } = useDropsContractProvider() + + const src = React.useMemo(() => + data?.editionMetadata?.imageURI ? addIPFSGateway(data?.editionMetadata?.imageURI) : '', + [data, data?.editionMetadata?.imageURI]) + + const creator = React.useMemo(() => data?.creator && data?.creator,[data]) + + const { data: ensName } = useEnsName({ + address: data?.creator, + }) + + return ( +
+
+ +
+
+
+

{data?.name}

+

Artist: {ensName ? ensName : creator}

+

{data?.editionMetadata?.description}

+
+

Collection Address: {collectionAddress}

+

Maximum per address: {prettyMaxAmount}

+

Sold: {prettyInventory} NFTs

+

Price: {totalPrice?.pretty}Ξ

+ {!isEnded + ? <> +

Minting Starts: {startDate?.pretty}

+ {!endDate?.pretty ? null :

Minting Ends: {JSON.stringify(endDate, null, 2)}

} + + :

Sale has ended

+ } + {isActive &&

Minting Active

} +

You Own: {walletBalance} NFT{`${walletBalance > 1 || walletBalance === 0 ? 's' : ''}`}

+
+
+
+ {purchaseLoading ? 'Tx Processing' : ''} + {purchaseSuccess ? 'Minted!' : ''} +
+ {txHash ? txHash : ''} +
+ {!walletLimit + ?
+ + +
+ :
You have minted the maximum amount per wallet.
+ } +
+
+ ) +} + +export function DropMintTest({collectionAddress}: {collectionAddress: string}) { + const successCallback = React.useCallback(() => { + console.log('MINTED IT') + }, []) + console.log(collectionAddress) + return ( + + + + ) +} \ No newline at end of file diff --git a/components/Header.tsx b/components/Header.tsx index 2dc5a88..7e177ed 100644 --- a/components/Header.tsx +++ b/components/Header.tsx @@ -1,9 +1,10 @@ import { ConnectButton } from './ConnectButton' +import { Navigation } from './Navigation' export function Header() { return (
- Header +
) diff --git a/components/MintTrackListing.tsx b/components/MintTrackListing.tsx new file mode 100644 index 0000000..fb8bb6a --- /dev/null +++ b/components/MintTrackListing.tsx @@ -0,0 +1,32 @@ +import React from 'react' +import { useDropsContextProvider } from "@public-assembly/zora-drops-utils"; +import { useEnsName } from 'wagmi' +import { DropMintTest } from './DropMintTest'; + +export function TrackThumbnail({ data }: { data: any }) { + const creator = React.useMemo(() => data?.creator && data?.creator,[data]) + const name = React.useMemo(() => data?.name && data?.name,[data]) + + const { data: ensName } = useEnsName({ + address: data?.creator, + }) + + return ( +
+ {ensName ?? creator} - {name} +
+ ) +} + +export function MintTrackListing() { + const { data } = useDropsContextProvider() + return ( +
+ {data && data.map((edition: any) => + + )} +
+ ) +} \ No newline at end of file diff --git a/components/Navigation.tsx b/components/Navigation.tsx new file mode 100644 index 0000000..563eb03 --- /dev/null +++ b/components/Navigation.tsx @@ -0,0 +1,37 @@ +import Link from "next/link" +import { useRouter } from "next/router" + +const pages = [ + { + slug: '/', + title: 'Present.Material' + }, + { + slug: '/popular-mint', + title: 'Popular Mint' + }, + { + slug: '/dmbk-mint', + title: 'DMBK Mint' + }, + { + slug: '/mock-playlist', + title: 'Web2 Playlist' + }, +] + +export function Navigation() { + const router = useRouter() + + return ( +
+ {pages.map((page) => + + {page.title} + + )} +
+ ) +} \ No newline at end of file diff --git a/components/PageWrapper.tsx b/components/PageWrapper.tsx index d1d21a0..0f9e7af 100644 --- a/components/PageWrapper.tsx +++ b/components/PageWrapper.tsx @@ -5,7 +5,7 @@ export function PageWrapper({ children, ...props }: {children?: JSX.Element}) { return ( <>
-
+
{children}