From 960e5b4016ee5df01b65d3b2bb901a23f0a61715 Mon Sep 17 00:00:00 2001 From: devsalmon <54852257+devsalmon@users.noreply.github.com> Date: Mon, 26 Sep 2022 09:47:17 +0100 Subject: [PATCH] Your account panel (#1057) * update my account panel * update for plugins * ui update your account details added dao image and conditionally display the withdraw button on the panel * ui updates VSR plugin DAOs * deposit change to secondary button * rename label to 'my governance power' * fix deposit button not appearing * Revert "fix deposit button not appearing" This reverts commit 32185d150083c731f19e4686b978e43d862013ec. * deposit button fix * max width for buttons * Update TokenBalanceCard.tsx * Update TokenBalanceCard.tsx * governance power panel logic * fix governance power bug * availabletokens change * change realm to dao Co-authored-by: Bruno Ceccolini <34370581+BrunoCecco@users.noreply.github.com> --- .../components/Account/Account.tsx | 54 +++-- .../components/Account/LockTokensAccount.tsx | 21 +- .../DepositCommunityTokensBtn.tsx | 21 +- .../LockPluginTokenBalanceCard.tsx | 95 +++++--- .../TokenBalance/VotingPowerBox.tsx | 55 +++-- .../WithdrawCommunityTokensBtn.tsx | 6 +- components/TokenBalance/TokenBalanceCard.tsx | 215 +++++++++++++----- .../TokenBalance/TokenBalanceCardWrapper.tsx | 15 +- 8 files changed, 346 insertions(+), 136 deletions(-) diff --git a/VoteStakeRegistry/components/Account/Account.tsx b/VoteStakeRegistry/components/Account/Account.tsx index 0c90ad9f92..9ac5797e37 100644 --- a/VoteStakeRegistry/components/Account/Account.tsx +++ b/VoteStakeRegistry/components/Account/Account.tsx @@ -3,9 +3,18 @@ import { LinkIcon } from '@heroicons/react/outline' import MyProposalsBtn from 'pages/dao/[symbol]/proposal/components/MyProposalsBtn' import useWalletStore from 'stores/useWalletStore' import DelegateCard from '@components/DelegateCard' +import TokenBalanceCardWrapper from '@components/TokenBalance/TokenBalanceCardWrapper' +import useRealm from '@hooks/useRealm' -const AccountInner = ({ withHeader = true }: { withHeader?: boolean }) => { +const AccountInner = ({ + displayPanel, + withHeader = true, +}: { + displayPanel?: boolean + withHeader?: boolean +}) => { const connected = useWalletStore((s) => s.connected) + const { realmInfo } = useRealm() return (
- {depositTokenName} Deposited - - {availableTokens} - -
-- {depositTokenName} Locked - {lockTokensFmt} -
-- You have {tokensToShow} tokens available to {canExecuteAction}. -
*/} - + {votingPower.toNumber() > 0 && ( ++ {depositTokenName} Deposited + + {availableTokens} + +
+ )} + {availableTokens != '0' && ( ++ {depositTokenName} Locked + + {lockTokensFmt} + +
+ )} +Votes
- - {votingPowerFmt}{' '} - {!votingPowerFromDeposits.isZero() && !votingPower.isZero() && ( -Votes
+ + {votingPowerFmt}{' '} + {!votingPowerFromDeposits.isZero() && !votingPower.isZero() && ( +{depositTokenName} Votes
-- {availableTokens} -
+{depositTokenName} Votes
++ {availableTokens} +
+