Skip to content

Commit

Permalink
fixup! feat(eth-staking): apply redesign changes
Browse files Browse the repository at this point in the history
  • Loading branch information
shotgunofdeath committed Feb 22, 2024
1 parent 521430a commit 0ecfcff
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
8 changes: 5 additions & 3 deletions packages/suite/src/hooks/wallet/useStakeEthForm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ export const useStakeEthForm = ({ selectedAccount }: UseStakeFormsProps): StakeC

const composedFee = useMemo(() => {
const transactionInfo = composedLevels?.[selectedFee];

return transactionInfo !== undefined && transactionInfo.type !== 'error'
? new BigNumber(fromWei(transactionInfo.fee))
: new BigNumber('0');
Expand Down Expand Up @@ -200,7 +201,7 @@ export const useStakeEthForm = ({ selectedAccount }: UseStakeFormsProps): StakeC

if (currentRate) {
const fiatValue = toFiatCurrency(amount, localCurrency, {
[currentRate.locale]: currentRate?.rate,
[localCurrency]: currentRate?.rate,
});
setValue(FIAT_INPUT, fiatValue || '', { shouldValidate: true });
}
Expand Down Expand Up @@ -232,7 +233,7 @@ export const useStakeEthForm = ({ selectedAccount }: UseStakeFormsProps): StakeC
amount,
localCurrency,
{
[currentRate.locale]: currentRate?.rate,
[localCurrency]: currentRate?.rate,
},
network.decimals,
);
Expand Down Expand Up @@ -312,7 +313,7 @@ export const useStakeEthForm = ({ selectedAccount }: UseStakeFormsProps): StakeC

const fiatValue = currentRate
? toFiatCurrency(max, localCurrency, {
[currentRate.locale]: currentRate?.rate,
[localCurrency]: currentRate?.rate,
})
: '';
setValue(FIAT_INPUT, fiatValue || '', { shouldValidate: true, shouldDirty: true });
Expand Down Expand Up @@ -391,5 +392,6 @@ export const useStakeEthForm = ({ selectedAccount }: UseStakeFormsProps): StakeC
export const useStakeEthFormContext = () => {
const ctx = useContext(StakeEthFormContext);
if (ctx === null) throw Error('useStakeEthFormContext used without Context');

return ctx;
};
5 changes: 3 additions & 2 deletions packages/suite/src/hooks/wallet/useUnstakeEthForm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ export const useUnstakeEthForm = ({
async (amount: string) => {
if (currentRate) {
const fiatValue = toFiatCurrency(amount, localCurrency, {
[currentRate.locale]: currentRate?.rate,
[localCurrency]: currentRate?.rate,
});
setValue(FIAT_INPUT, fiatValue || '', { shouldValidate: true });
}
Expand All @@ -184,7 +184,7 @@ export const useUnstakeEthForm = ({
const cryptoValue = fromFiatCurrency(
amount,
localCurrency,
{ [currentRate.locale]: currentRate?.rate },
{ [localCurrency]: currentRate?.rate },
network.decimals,
);
setValue(CRYPTO_INPUT, cryptoValue || '', { shouldDirty: true, shouldValidate: true });
Expand Down Expand Up @@ -253,5 +253,6 @@ export const useUnstakeEthForm = ({
export const useUnstakeEthFormContext = () => {
const ctx = useContext(UnstakeEthFormContext);
if (ctx === null) throw Error('useUnstakeEthFormContext used without Context');

return ctx;
};

0 comments on commit 0ecfcff

Please sign in to comment.