Skip to content

Commit

Permalink
Hide delegate button from Staked NFTs
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryan-Ouyang committed Apr 17, 2024
1 parent a1f107f commit 0f3a2ac
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
13 changes: 9 additions & 4 deletions web/src/playerlist/PlayerEntry.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@ import { CTG_TOKEN_CHAIN, CTG_TOKEN_CONTRACT } from './getPlayers.js';
import { CTG_VAULT_ADDRESS } from './PlayerList.js';
import { CTG_TOKEN_ABI } from '../CTGTokenAbi.js';

export const PlayerEntry: FC<{ tokenId: string }> = ({ tokenId }) => {
export const PlayerEntry: FC<{
tokenId: string;
hideDelegateButton?: boolean;
}> = ({ tokenId, hideDelegateButton }) => {
const { data } = usePlayerMetadata(tokenId);

const { address } = useAccount();
Expand Down Expand Up @@ -40,9 +43,11 @@ export const PlayerEntry: FC<{ tokenId: string }> = ({ tokenId }) => {
<h3>#{tokenId}</h3>
</div>
{/* <div>Delegate Soon</div> */}
<div className="btn btn-small" onClick={transferToken}>
Delegate
</div>
{!hideDelegateButton && (
<div className="btn btn-small" onClick={transferToken}>
Delegate
</div>
)}
</div>
</div>
);
Expand Down
5 changes: 4 additions & 1 deletion web/src/playerlist/PlayerList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,10 @@ export const PlayerList = () => {
<div>
{stakedData &&
stakedData.map((player) => (
<PlayerEntry tokenId={player.toString()} />
<PlayerEntry
tokenId={player.toString()}
hideDelegateButton
/>
))}
{stakedData && stakedData.length === 0 && <p>No NFTs found</p>}
</div>
Expand Down

0 comments on commit 0f3a2ac

Please sign in to comment.