Iām trying to list Items using the āgetItemsā cloud function.
Iām getting the data back in ādataā.
But how to fetch data from token_uri of each object in ādataā.
I want to replace these exclamation marks in the code snippet with a logic which fetches data from token_uri of each object which I got from āgetItemsā cloud function
MarketCard is a react component that renders cards for each NFT. Iām passing src, NFTname and description as a prop.
const Item is an array of Javascript object which will store details of each object from ādataā
import React, { useState, useEffect } from 'react'
import { useMoralisCloudFunction } from 'react-moralis'
import MarketCard from './components/MarketCard'
const MarketPlace = () => {
const {data} = useMoralisCloudFunction("getItems");
const item = [{
"myId":"",
"owner":"",
"name":"No NFTs",
"desc":"No Description",
"price":"",
"source":"./random.svg",
}];
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
console.log(item);
return (
<div className="relative bg-gradient-to-r from-primary to-secondary">
<h1 className="px-4 py-4 text-my-black-color">1 results</h1>
<div className="grid sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 h-screen ">
{item.map(one => (
<MarketCard
key={one.myId}
name={one.name}
description={one.desc}
source={one.source}
/>
))}
</div>
</div>
)
}
export default MarketPlace