From 90df2bf462e74f4c3e492791e26559b9ee5bc72f Mon Sep 17 00:00:00 2001 From: bigboydiamonds <57741810+bigboydiamonds@users.noreply.github.com> Date: Fri, 8 Mar 2024 13:03:08 -0800 Subject: [PATCH] feat(synapse-interface): update button states (#2214) * Add "Swap" button state * Stake button detects insufficient balance based on user input compared to balance * Disable Unstake button when input greater than staked balance * Unstake Button text when input too great * Update check for no lp token balance * Trim trailing zeroes after balances * Trim trailing zeroes off stake pool lp data * Rm unused var * Remove unused imports on Swap page * Add conditions for when Approve button label appears * Actions dropdown positioning * Trim zeroes when updating balance from Portfolio select button * Update Bridge Button State when necessary, reduce state changes when quote loading * Implement same for Swap * Update swap button disabled conditions to prevent flash post-approve * Update default WithdrawButton state * Withdraw Button state * Fix duplicate import --- .../components/Pools/PoolActionOptions.tsx | 15 ++- .../components/PortfolioTokenAsset.tsx | 7 +- .../BridgeTransactionButton.tsx | 2 +- .../SwapTransactionButton.tsx | 13 ++- .../pool/poolManagement/WithdrawButton.tsx | 16 +--- .../pages/stake/StakeCard.tsx | 91 ++++++++++++------- .../synapse-interface/pages/swap/index.tsx | 7 +- 7 files changed, 87 insertions(+), 64 deletions(-) diff --git a/packages/synapse-interface/components/Pools/PoolActionOptions.tsx b/packages/synapse-interface/components/Pools/PoolActionOptions.tsx index 33025fe6a2..a4b2bb9295 100644 --- a/packages/synapse-interface/components/Pools/PoolActionOptions.tsx +++ b/packages/synapse-interface/components/Pools/PoolActionOptions.tsx @@ -53,13 +53,12 @@ export const PoolActionOptions = ({ >