Skip to content

Commit

Permalink
chore: rename hook data var
Browse files Browse the repository at this point in the history
  • Loading branch information
meness committed Mar 28, 2024
1 parent 9829dae commit 9ff6608
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/app/listing/@nft/(.)nft/[id]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { useNFT } from '~hooks';
const NFTModal = () => {
const { id: nftID } = useParams<{ id: string }>();
const { back } = useRouter();
const { data: nft, isPending: isPendingNFT } = useNFT(BigInt(nftID));
const { nft, isPending: isPendingNFT } = useNFT(BigInt(nftID));

const handleClose = () => {
back();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { useNFT } from '~hooks';
export const NFTCard = () => {
const { push } = useRouter();
const { id: nftID } = useParams<{ id: string }>();
const { data: nft, isPending: isPendingNFT } = useNFT(BigInt(nftID));
const { nft, isPending: isPendingNFT } = useNFT(BigInt(nftID));

const handleCancelClick = () => {
push(routeConst.listing);
Expand Down
4 changes: 2 additions & 2 deletions src/hooks/use-nft.hook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { useMetadata } from './use-metadata.hook';

export const useNFT = (tokenID: bigint) => {
const [tokenURI, setTokenURI] = useState('');
const { isPending: isPendingMetadata, ...rest } = useMetadata(tokenURI);
const { isPending: isPendingMetadata, data: nft, ...rest } = useMetadata(tokenURI);

const { isPending: isPendingTokenURI, data: readTokenURI } = useReadContract({
abi: musharka721ContractABI,
Expand All @@ -21,5 +21,5 @@ export const useNFT = (tokenID: bigint) => {
}
}, [readTokenURI]);

return { isPending: isPendingMetadata || isPendingTokenURI, ...rest };
return { isPending: isPendingMetadata || isPendingTokenURI, nft, ...rest };
};

0 comments on commit 9ff6608

Please sign in to comment.