-
-
Save Daltonic/c6b354fad8a1340d93fd9cedf60e9468 to your computer and use it in GitHub Desktop.
Dapp Breeds
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
import React, { useEffect } from 'react' | |
import { useGlobalState } from '../store' | |
import Collection from '../components/Collection' | |
import { getMyNfts } from '../services/blockchain' | |
const Collections = () => { | |
const [collection] = useGlobalState('collection') | |
useEffect(() => { | |
const fetchData = async () => { | |
await getMyNfts() | |
} | |
fetchData() | |
}, []) | |
return collection.length > 0 ? ( | |
<div className="mt-4 p-10 flex flex-col w-full "> | |
<Collection collection={collection} title="Your Collection" /> | |
</div> | |
) : ( | |
<div className="mt-4 p-10 flex flex-col w-full "> | |
<h2 className="font-extrabold text-3xl md:text-5xl text-white text-center"> | |
You have no collection yet... | |
</h2> | |
</div> | |
) | |
} | |
export default Collections |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment