From 7381a84ae4cf5fdd2135f138744d0cb131163b8d Mon Sep 17 00:00:00 2001 From: Amir Ekbatanifard Date: Sun, 3 Nov 2024 12:17:53 +0330 Subject: [PATCH 1/2] fix: displaying locked amount btn --- .../delegate/partial/AmountWithOptionsAndLockAmount.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/extension-polkagate/src/fullscreen/governance/delegate/partial/AmountWithOptionsAndLockAmount.tsx b/packages/extension-polkagate/src/fullscreen/governance/delegate/partial/AmountWithOptionsAndLockAmount.tsx index 70f098e5c..1411987d3 100644 --- a/packages/extension-polkagate/src/fullscreen/governance/delegate/partial/AmountWithOptionsAndLockAmount.tsx +++ b/packages/extension-polkagate/src/fullscreen/governance/delegate/partial/AmountWithOptionsAndLockAmount.tsx @@ -103,7 +103,7 @@ export default function AmountWithOptionsAndLockAmount({ accountLocks, amount, b label={t('Amount ({{token}})', { replace: { token } })} onChangeAmount={onValueChange} onPrimary={onMaxAmount} - onSecondary={onLockedAmount} + onSecondary={lockedAmount && !lockedAmount?.isZero() ? onLockedAmount : undefined} primaryBtnText={t('Max amount')} secondaryBtnText={t('Locked amount')} style={{ From cf41c382265904043043478b4ee88be3ed02ea11 Mon Sep 17 00:00:00 2001 From: Amir Ekbatanifard Date: Sun, 3 Nov 2024 15:51:14 +0330 Subject: [PATCH 2/2] fix: confilict --- .../AmountWithOptionsAndLockAmount.tsx | 71 ++++++++++--------- 1 file changed, 36 insertions(+), 35 deletions(-) diff --git a/packages/extension-polkagate/src/fullscreen/governance/delegate/partial/AmountWithOptionsAndLockAmount.tsx b/packages/extension-polkagate/src/fullscreen/governance/delegate/partial/AmountWithOptionsAndLockAmount.tsx index 41a90d1fc..7977d20c6 100644 --- a/packages/extension-polkagate/src/fullscreen/governance/delegate/partial/AmountWithOptionsAndLockAmount.tsx +++ b/packages/extension-polkagate/src/fullscreen/governance/delegate/partial/AmountWithOptionsAndLockAmount.tsx @@ -40,40 +40,41 @@ interface AlreadyLockedTooltipTextProps { const AlreadyLockedTooltipText = ({ accountLocks, currentBlock, decimal, token }: AlreadyLockedTooltipTextProps) => { const { t } = useTranslation(); - return ( - - - - {t('Ref.')} - - - {t('Amount')} - - - {t('Multiplier')} - - - {t('Expires')} + return ( + + + + + {t('Ref.')} + + + {t('Amount')} + + + {t('Multiplier')} + + + {t('Expires')} + + {accountLocks.map((l, index) => + + + {isBn(l.refId) ? l.refId.toNumber() : 'N/A'} + + + {amountToHuman(l.total, decimal)} {token} + + + {l.locked === 'None' ? 'N/A' : l.locked.replace('Locked', '')} + + + {getLockedUntil(l.endBlock, currentBlock)} + + + )} - {accountLocks.map((l, index) => - - - {isBn(l.refId) ? l.refId.toNumber() : 'N/A'} - - - {amountToHuman(l.total, decimal)} {token} - - - {l.locked === 'None' ? 'N/A' : l.locked.replace('Locked', '')} - - - {getLockedUntil(l.endBlock, currentBlock)} - - - )} - - - + + ); }; @@ -133,8 +134,8 @@ export default function AmountWithOptionsAndLockAmount ({ accountLocks, amount, onChangeAmount={onValueChange} onPrimary={onMaxAmount} onSecondary={lockedAmount && !lockedAmount?.isZero() ? onLockedAmount : undefined} - primaryBtnText={t('Max amount')} - secondaryBtnText={t('Locked amount')} + primaryBtnText={t('Max amount')} + secondaryBtnText={t('Locked amount')} style={{ '> div div div': { fontSize: '16px', fontWeight: 400 }, fontSize: '16px',