remove extra checks to display vesting schedule(#1826)
This commit is contained in:
@@ -9,25 +9,9 @@ import { TransferModal } from './components/TransferModal';
|
||||
|
||||
export const Balance = () => {
|
||||
const [showTransferModal, setShowTransferModal] = useState(false);
|
||||
const [showVestingCard, setShowVestingCard] = useState(false);
|
||||
|
||||
const { userBalance } = useContext(AppContext);
|
||||
|
||||
useEffect(() => {
|
||||
const { originalVesting, currentVestingPeriod, tokenAllocation } = userBalance;
|
||||
if (
|
||||
originalVesting &&
|
||||
currentVestingPeriod === 'After' &&
|
||||
tokenAllocation?.locked === '0' &&
|
||||
tokenAllocation?.vesting === '0' &&
|
||||
tokenAllocation?.spendable === '0'
|
||||
) {
|
||||
setShowVestingCard(false);
|
||||
} else if (originalVesting) {
|
||||
setShowVestingCard(true);
|
||||
}
|
||||
}, [userBalance]);
|
||||
|
||||
const handleShowTransferModal = async () => {
|
||||
await userBalance.refreshBalances();
|
||||
setShowTransferModal(true);
|
||||
@@ -37,7 +21,7 @@ export const Balance = () => {
|
||||
<PageLayout>
|
||||
<Box display="flex" flexDirection="column" gap={2}>
|
||||
<BalanceCard />
|
||||
{showVestingCard && <VestingCard onTransfer={handleShowTransferModal} />}
|
||||
<VestingCard onTransfer={handleShowTransferModal} />
|
||||
{showTransferModal && <TransferModal onClose={() => setShowTransferModal(false)} />}
|
||||
</Box>
|
||||
</PageLayout>
|
||||
|
||||
Reference in New Issue
Block a user