Skip to content

Commit

Permalink
Fix missing props (#243)
Browse files Browse the repository at this point in the history
  • Loading branch information
b-j-roberts authored Jun 29, 2024
1 parent a53f327 commit 05274a4
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 4 deletions.
3 changes: 3 additions & 0 deletions frontend/src/tabs/TabPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,9 @@ const TabPanel = (props) => {
{props.activeTab === 'NFTs' && (
<div>
<NFTs
address={props.address}
artPeaceContract={props.artPeaceContract}
canvasNftContract={props.canvasNftContract}
nftMintingMode={props.nftMintingMode}
setNftMintingMode={props.setNftMintingMode}
setActiveTab={props.setActiveTab}
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/tabs/factions/Factions.js
Original file line number Diff line number Diff line change
Expand Up @@ -317,15 +317,15 @@ const Factions = (props) => {
if (!props.address || !props.artPeaceContract) return;
if (chainId === 0) return;
setCalls(
props.usernameContract.populateTransaction['join_chain_faction'](chainId)
props.artPeaceContract.populateTransaction['join_chain_faction'](chainId)
);
};
const joinFactionCall = (factionId) => {
if (devnetMode) return;
if (!props.address || !props.artPeaceContract) return;
if (factionId === 0) return;
setCalls(
props.usernameContract.populateTransaction['join_faction'](factionId)
props.artPeaceContract.populateTransaction['join_faction'](factionId)
);
};

Expand Down
6 changes: 4 additions & 2 deletions frontend/src/tabs/nfts/NFTItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,14 @@ const NFTItem = (props) => {
const likeNftCall = (tokenId) => {
if (devnetMode) return;
if (!props.address || !props.canvasNftContract) return;
setCalls(props.usernameContract.populateTransaction['like_nft'](tokenId));
setCalls(props.canvasNftContract.populateTransaction['like_nft'](tokenId));
};
const unlikeNftCall = (tokenId) => {
if (devnetMode) return;
if (!props.address || !props.canvasNftContract) return;
setCalls(props.usernameContract.populateTransaction['unlike_nft'](tokenId));
setCalls(
props.canvasNftContract.populateTransaction['unlike_nft'](tokenId)
);
};

useEffect(() => {
Expand Down
9 changes: 9 additions & 0 deletions frontend/src/tabs/nfts/NFTs.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ const NFTsMainSection = (props) => {
return (
<NFTItem
key={index}
address={props.address}
artPeaceContract={props.artPeaceContract}
canvasNftContract={props.canvasNftContract}
tokenId={nft.tokenId}
position={nft.position}
image={imageURL + 'nft-' + nft.tokenId + '.png'}
Expand Down Expand Up @@ -108,6 +111,9 @@ const NFTsExpandedSection = (props) => {
return (
<NFTItem
key={index}
address={props.address}
artPeaceContract={props.artPeaceContract}
canvasNftContract={props.canvasNftContract}
tokenId={nft.tokenId}
position={nft.position}
image={imageURL + 'nft-' + nft.tokenId + '.png'}
Expand Down Expand Up @@ -285,6 +291,9 @@ const NFTs = (props) => {
mainSection={NFTsMainSection}
expandedSection={NFTsExpandedSection}
updateLikes={updateLikes}
address={props.address}
artPeaceContract={props.artPeaceContract}
canvasNftContract={props.canvasNftContract}
nftMintingMode={props.nftMintingMode}
setNftMintingMode={props.setNftMintingMode}
nftsCollection={myNFTs}
Expand Down

0 comments on commit 05274a4

Please sign in to comment.