Skip to content

Commit

Permalink
fixed linting...hopefully
Browse files Browse the repository at this point in the history
  • Loading branch information
JacobHomanics committed Feb 25, 2024
1 parent 3777717 commit 05c10de
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
12 changes: 8 additions & 4 deletions packages/nextjs/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@ const Home: NextPage = () => {

const { data: metadatas } = useFetches(tokenURIs);

const nfts = metadatas!.map((metadata, index) => <NftCard key={index} nft={metadata} />);
let nfts;

if (metadatas)
nfts = metadatas.map((metadata, index) => <NftCard key={index} nft={metadata} />);

const { data: sixthPartnershipNftContract } = useScaffoldContract({ contractName: "SixthStreetPartnershipNft" });
const { data: sixthMintCount } = useScaffoldContractRead({
Expand All @@ -41,15 +44,16 @@ const Home: NextPage = () => {
});
const { data: sixthTokenURIs } = useGetAllMetadatas(sixthPartnershipNftContract, sixthMintCount || BigInt(0));

console.log(sixthTokenURIs);

for (let i = 0; i < sixthTokenURIs.length; i++) {
if (sixthTokenURIs[i]) sixthTokenURIs[i] = sixthTokenURIs[i].replace("ipfs://", "https://ipfs.io/ipfs/");
}

const { data: sixthMetadatas } = useFetches(sixthTokenURIs);

const sixthNfts = sixthMetadatas!.map((metadata, index) => <NftCard key={index} nft={metadata} />);

let sixthNfts;
if (sixthMetadatas)
sixthNfts = sixthMetadatas.map((metadata, index) => <NftCard key={index} nft={metadata} />);

// async function onFormSubmit(event: any) {
// event.preventDefault()
Expand Down
3 changes: 2 additions & 1 deletion packages/nextjs/components/nft-card/Hooks.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ export function useGetAllMetadatas(contract: any, mintCount: bigint) {
setData([...arr]);
}
get();
}, [contract?.address, mintCount]);
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [contract?.address, mintCount]);

return { data };
}
Expand Down
6 changes: 4 additions & 2 deletions packages/nextjs/components/nft-card/nftCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,10 @@ export function NftCard(props: NftCardProps) {
<p className="m-0 font-bold">Name</p>
<p className="m-0 text-xl">{props.nft.name}</p>
</div>

<img className="rounded-lg" src={props.nft.image} width={128} height={128} />

{
// eslint-disable-next-line
} <img className="rounded-lg" src={props.nft.image} width={128} height={128} /> // eslint-disable-line
<div className="m-4">
<p className="m-0 font-bold text-size-xl">Description</p>
<p className="m-0 text-xs"> {props.nft.description}</p>
Expand Down

0 comments on commit 05c10de

Please sign in to comment.