Hi, I am trying to render the nfts present in the wallet however I am having some troubles.
I would like a button in the div to be be clicked and not all clicked together to activate another function.
second bug, on bsc testnet, we can’t see ipfs or image we can only see collection name using moralis server.
//nft contract
const options = {
chain: 97,
address: account,
token_address: "0x0cb6F4fE6b7F3f57460Bd968D6EF72019928c854",
// token_id: 4,
};
const { getNFTBalances, data } = useNFTBalances();
// const transfersNFT = async () => {
// const res = await Moralis.Web3API.account.getNFTTransfers(options);
// };
useEffect(() => {
getNFTBalances(options);
}, []);
in the return section
{data &&
data.result.map((nft, i) => (
<div key={i} className={styles.card}>
{nft.image && (
<Image
preview={false}
src={nft?.image || "error"}
alt=""
width={500}
height={500}
/>
)}
<p>
{nft.name}# {nft.token_id}
</p>
<button
className={styles.stake_btn}
// value={nft.token_id}
onClick={console.log(i)} //() => runContractFunction(nft.token_id)
>
Stake# {nft.token_id}
</button>
</div>
))}