From c9b9a75c1404251de9c68eef84e2b1caf8897207 Mon Sep 17 00:00:00 2001 From: konoart <91595347+konoart@users.noreply.github.com> Date: Mon, 9 May 2022 16:59:04 +0200 Subject: [PATCH 1/7] Solana: fixes after initial staking (#4964) * solana invert validator commision and total stake * solana conditionaly hide ledger by figment TC when staking * solana add use all amount stake warning * solana refactor delegation CTA * solana disable hover on non choosable validators * solana fix renamed useValidators in LLC * solana fix lint issues --- .../families/solana/Delegation/index.js | 132 ++++++++++-------- .../steps/StepValidator.js | 2 +- .../steps/StepValidator.js | 5 +- .../steps/StepValidator.js | 2 +- .../steps/StepValidator.js | 5 +- .../components/LedgerByFigmentTCLink.js | 24 +++- .../solana/shared/components/ValidatorRow.js | 43 +++--- .../solana/shared/fields/ValidatorsField.js | 7 +- static/i18n/en/app.json | 5 +- 9 files changed, 136 insertions(+), 89 deletions(-) diff --git a/src/renderer/families/solana/Delegation/index.js b/src/renderer/families/solana/Delegation/index.js index 7f59653a6d..a12a34b06c 100644 --- a/src/renderer/families/solana/Delegation/index.js +++ b/src/renderer/families/solana/Delegation/index.js @@ -43,7 +43,7 @@ const Delegation = ({ account }: Props) => { const onEarnRewards = useCallback(() => { dispatch( - openModal("MODAL_SOLANA_DELEGATE", { + openModal("MODAL_SOLANA_REWARDS_INFO", { account, }), ); @@ -90,69 +90,83 @@ const Delegation = ({ account }: Props) => { return ( <> - - }> - - - {hasStakes ? ( - <> -
- {stakesWithMeta.map(stakeWithMeta => ( - - ))} - - ) : ( - - - - - - - } - onClick={() => openURL(urls.solana.staking)} - /> - - - - - - - )} - + + + + +
+ {stakesWithMeta.map(stakeWithMeta => ( + + ))} + + ) : null} + + {!hasStakes && account.spendableBalance.gt(0) ? ( + + + + ) : null} ); }; +type EarnRewardsCTAProps = { + account: Account, + onEarnRewards: () => void, +}; + +function EarnRewardsCTA({ account, onEarnRewards }: EarnRewardsCTAProps) { + return ( + + + + + + + } + onClick={() => openURL(urls.solana.staking)} + /> + + + + + + + ); +} + const Delegations = ({ account }: Props) => { if (!account.solanaResources) return null; diff --git a/src/renderer/families/solana/DelegationActivateFlowModal/steps/StepValidator.js b/src/renderer/families/solana/DelegationActivateFlowModal/steps/StepValidator.js index f6f90f8bee..7efb5565be 100644 --- a/src/renderer/families/solana/DelegationActivateFlowModal/steps/StepValidator.js +++ b/src/renderer/families/solana/DelegationActivateFlowModal/steps/StepValidator.js @@ -79,7 +79,7 @@ export function StepValidatorFooter({ return ( <> - +