-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fleshed out UI and integrated tiering system
- Loading branch information
1 parent
d4c725c
commit 9402922
Showing
12 changed files
with
1,029 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"name": "ATX DAO Partnership NFT", | ||
"description": "This NFT represents an outstanding partner with ATX DAO. If you are the owner, then upload a json file to IPFS that follows the NFT metadata standard and update this NFT's tokenURI!", | ||
"image": "ipfs://bafkreicxupdmf55oaivaf26de3r62kzw4lgmjigfswzlkxo4yk6lf67b2a" | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"networkName": "Anvil" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import { useEffect, useState } from "react"; | ||
|
||
export function useGetAllMetadatas(contract: any, mintCount: bigint) { | ||
const [data, setData] = useState<any[]>([]); | ||
|
||
useEffect(()=> { | ||
async function get() { | ||
const arr = []; | ||
for (let i = 0; i < mintCount; i++) { | ||
let result = await contract?.read.tokenURI([i]); | ||
arr.push(result); | ||
} | ||
|
||
setData([...arr]); | ||
} | ||
get(); | ||
}, [contract?.address, mintCount]) | ||
|
||
return { data } | ||
} | ||
|
||
export function useFetches(uris: string[]) { | ||
const [data, setData] = useState<any[]>([]); | ||
|
||
useEffect(() => { | ||
async function get() { | ||
const arr = []; | ||
for (let i = 0; i < uris.length; i++) { | ||
try { | ||
const response = await fetch(uris[i]); | ||
const responseJson = await response.json(); | ||
arr.push(responseJson); | ||
} | ||
catch (e) { | ||
console.log('Could not fetch URI'); | ||
arr.push({}); | ||
} | ||
} | ||
|
||
setData([...arr]); | ||
} | ||
get(); | ||
}, [uris]); | ||
|
||
return { data }; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
interface Nft { | ||
name?: string; | ||
description?: string; | ||
image?: string; | ||
} | ||
|
||
interface NftCardProps { | ||
nft: Nft; | ||
} | ||
|
||
export function NftCard (props: NftCardProps) { | ||
|
||
if (props.nft && props.nft.image){ | ||
props.nft.image = props.nft.image.replace("ipfs://", "https://ipfs.io/ipfs/"); | ||
} | ||
|
||
return ( | ||
<div className="flex flex-col items-center justify-center bg-black rounded"> | ||
<p>Name: { props.nft.name}</p> | ||
<p>Description: { props.nft.description}</p> | ||
<img src={props.nft.image} width={126} height={126}/> | ||
</div> | ||
) | ||
} |
Oops, something went wrong.