@@ -82,7 +87,7 @@ export const Options = ({ symbol }: OptionsProps) => {
if (isRewardsSelected) return;
setUnstakeOption('rewards');
- await onOptionChange(rewards.toString());
+ await onOptionChange(restakedReward);
}}
>
@@ -93,11 +98,11 @@ export const Options = ({ symbol }: OptionsProps) => {
-
+
-
+
@@ -109,7 +114,7 @@ export const Options = ({ symbol }: OptionsProps) => {
if (isAllSelected) return;
setUnstakeOption('all');
- await onOptionChange(stakeWithRewards.toString());
+ await onOptionChange(autocompoundBalance);
}}
>
@@ -119,16 +124,15 @@ export const Options = ({ symbol }: OptionsProps) => {
- +{' '}
+
+ {({ value }) => value && {value} + }
+
-
+
-
+
@@ -149,14 +153,19 @@ export const Options = ({ symbol }: OptionsProps) => {
- {' '}
-
+
+ {({ value }) =>
+ value && (
+ <>
+ {' '}
+ {value}
+ >
+ )
+ }
+
-
+
diff --git a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/UnstakeModal/UnstakeEthForm/UnstakeEthForm.tsx b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/UnstakeModal/UnstakeEthForm/UnstakeEthForm.tsx
index bab5698d01b1..9718d5d2e5e6 100644
--- a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/UnstakeModal/UnstakeEthForm/UnstakeEthForm.tsx
+++ b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/UnstakeModal/UnstakeEthForm/UnstakeEthForm.tsx
@@ -2,9 +2,12 @@ import styled from 'styled-components';
import { Button, P, variables, Warning } from '@trezor/components';
import { Translation } from 'src/components/suite';
import { FeesInfo } from 'src/components/wallet/FeesInfo';
+import { useSelector } from 'src/hooks/suite';
import { useUnstakeEthFormContext } from 'src/hooks/wallet/useUnstakeEthForm';
-import { Options } from './Options';
+import { useValidatorsQueue } from 'src/hooks/wallet/useValidatorsQueue';
+import { selectSelectedAccountEverstakeStakingPool } from 'src/reducers/wallet/selectedAccountReducer';
import { CRYPTO_INPUT, FIAT_INPUT } from 'src/types/wallet/stakeForms';
+import { Options } from './Options';
const GreyP = styled(P)`
color: ${({ theme }) => theme.TYPE_LIGHT_GREY};
@@ -19,11 +22,20 @@ const MaxWidthDivider = styled.div`
`;
const StyledWarning = styled(Warning)`
- margin-top: 12px;
- color: ${({ theme }) => theme.TYPE_RED};
justify-content: flex-start;
`;
+const StyledCriticalWarning = styled(StyledWarning)`
+ color: ${({ theme }) => theme.TYPE_RED};
+`;
+
+const WarningsWrapper = styled.div`
+ margin-top: 12px;
+ display: flex;
+ flex-direction: column;
+ gap: 16px;
+`;
+
const UpToDaysWrapper = styled.div`
display: flex;
justify-content: space-between;
@@ -35,8 +47,10 @@ const UpToDaysWrapper = styled.div`
`;
export const UnstakeEthForm = () => {
- // TODO: Replace with real data
- const unstakingPeriod = 7;
+ const {
+ validatorsQueue: { validatorWithdrawTime },
+ } = useValidatorsQueue();
+ const unstakingPeriod = Math.round(validatorWithdrawTime / 60 / 60 / 24);
const {
account,
@@ -55,6 +69,9 @@ export const UnstakeEthForm = () => {
const formIsValid = Object.keys(errors).length === 0;
const transactionInfo = composedLevels?.[selectedFee];
+ const { canClaim = false, claimableAmount = '0' } =
+ useSelector(selectSelectedAccountEverstakeStakingPool) ?? {};
+
return (