diff --git a/components/TokenBalance/TokenDeposit.tsx b/components/TokenBalance/TokenDeposit.tsx index 0bf0f3b283..bc6dd1c7a1 100644 --- a/components/TokenBalance/TokenDeposit.tsx +++ b/components/TokenBalance/TokenDeposit.tsx @@ -7,7 +7,11 @@ import { import { PublicKey, Transaction, TransactionInstruction } from '@solana/web3.js' import BN from 'bn.js' import useRealm from '@hooks/useRealm' -import { getProposal, ProposalState } from '@solana/spl-governance' +import { + getProposal, + GoverningTokenType, + ProposalState, +} from '@solana/spl-governance' import { getUnrelinquishedVoteRecords } from '@models/api' import { withRelinquishVote } from '@solana/spl-governance' import { withWithdrawGoverningTokens } from '@solana/spl-governance' @@ -67,6 +71,13 @@ export const TokenDeposit = ({ const realm = useRealmQuery().data?.result const config = useRealmConfigQuery().data?.result + const relevantTokenConfig = + tokenRole === GoverningTokenRole.Community + ? config?.account.communityTokenConfig + : config?.account.councilTokenConfig + const isMembership = + relevantTokenConfig?.tokenType === GoverningTokenType.Membership + const { realmInfo, realmTokenAccount, @@ -345,24 +356,25 @@ export const TokenDeposit = ({ Deposit ) : null} - {(inAccountDetails || isVsr) && ( - - Withdraw - - )} + {!isMembership && // Membership tokens can't be withdrawn (that is their whole point, actually) + (inAccountDetails || isVsr) && ( + + Withdraw + + )} }