From 44e751958697b8d109d00f4fc7e15d4d7eae7d56 Mon Sep 17 00:00:00 2001 From: Nikos Kontakis Date: Thu, 12 Sep 2024 16:49:53 +0300 Subject: [PATCH] Fix the card to expand seperatly (#111) Co-authored-by: Thibaut Sardan <33178835+Tbaut@users.noreply.github.com> --- .../DelegationByAmountConviction.tsx | 2 +- src/components/LocksCard.tsx | 159 +++++++++--------- src/components/MyDelegations.tsx | 43 ++--- src/components/ui/button.tsx | 6 +- src/header.tsx | 2 +- src/pages/Delegate/index.tsx | 4 +- src/pages/Home/index.tsx | 2 +- 7 files changed, 108 insertions(+), 110 deletions(-) diff --git a/src/components/DelegationByAmountConviction.tsx b/src/components/DelegationByAmountConviction.tsx index 6f06ba5..9cb46ae 100644 --- a/src/components/DelegationByAmountConviction.tsx +++ b/src/components/DelegationByAmountConviction.tsx @@ -31,7 +31,7 @@ export const DelegationByAmountConviction = ({ return (
{trackIds.length === 1 ? ( trackIds.map((trackId) => ( diff --git a/src/components/LocksCard.tsx b/src/components/LocksCard.tsx index beb9b38..61338af 100644 --- a/src/components/LocksCard.tsx +++ b/src/components/LocksCard.tsx @@ -29,9 +29,8 @@ import { TrackDisplay } from './TrackDisplay' export const LocksCard = () => { const [currentBlock, setCurrentBlock] = useState(0) const [expectedBlockTime, setExpectedBlockTime] = useState(0) - const { api } = useNetwork() + const { api, assetInfo } = useNetwork() const { voteLocks: locks, delegationLocks } = useLocks() - const { assetInfo } = useNetwork() const [ongoingVoteLocks, setOngoingVoteLocks] = useState([]) const [freeLocks, setFreeLocks] = useState>( [], @@ -129,88 +128,82 @@ export const LocksCard = () => { }, [api, freeLocks, getUnlockTx, selectedAccount]) return ( -
- {freeLocks.length > 0 && ( - -
-
- Unlockable - - - - - -

- Elapsed locks for votes casted on referenda, or tracks - delegation. Since locks can overlap, unlocking doesn't - necessarily mean the transferable balance will change. -

-
-
-
-
- {freeLocks.length} - -
- {freeLocks.length > 0 && ( - <> - -