From b8b2ae0e4948271628a2834e94e5e722f8a85c8c Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Tue, 5 Nov 2024 13:03:39 -0500 Subject: [PATCH] fixed rebalancer config action initial funds detection --- .../actions/ConfigureRebalancer/Component.tsx | 103 +++++++++--------- .../actions/ConfigureRebalancer/index.tsx | 5 +- 2 files changed, 57 insertions(+), 51 deletions(-) diff --git a/packages/stateful/actions/core/actions/ConfigureRebalancer/Component.tsx b/packages/stateful/actions/core/actions/ConfigureRebalancer/Component.tsx index 6b3ef761e..4f4b5b82e 100644 --- a/packages/stateful/actions/core/actions/ConfigureRebalancer/Component.tsx +++ b/packages/stateful/actions/core/actions/ConfigureRebalancer/Component.tsx @@ -1,4 +1,5 @@ import { Close, InfoOutlined } from '@mui/icons-material' +import clsx from 'clsx' import { ComponentType, useEffect, useState } from 'react' import { useFieldArray, useFormContext } from 'react-hook-form' import { useTranslation } from 'react-i18next' @@ -318,58 +319,62 @@ export const ConfigureRebalancerComponent: ActionComponent< > {t('button.addToken')} + + )} -
- +
+ -

- setValue( - (fieldNamePrefix + - 'newValenceAccount.acknowledgedServiceFee') as 'newValenceAccount.acknowledgedServiceFee', - !acknowledgedServiceFee - ) - } - > - {t('info.acknowledgeServiceFee', { - fee: serviceFee.loading - ? '...' - : serviceFee.errored - ? '' - : serviceFee.data - ? t('format.token', { - amount: HugeDecimal.from( - serviceFee.data.balance - ).toInternationalizedHumanReadableString({ - decimals: serviceFee.data.token.decimals, - }), - symbol: serviceFee.data.token.symbol, - }) - : '', - context: - serviceFee.loading || - serviceFee.errored || - serviceFee.data - ? undefined - : 'none', - })} -

-
+

+ setValue( + (fieldNamePrefix + + 'newValenceAccount.acknowledgedServiceFee') as 'newValenceAccount.acknowledgedServiceFee', + !acknowledgedServiceFee + ) + } + > + {t('info.acknowledgeServiceFee', { + fee: serviceFee.loading + ? '...' + : serviceFee.errored + ? '' + : serviceFee.data + ? t('format.token', { + amount: HugeDecimal.from( + serviceFee.data.balance + ).toInternationalizedHumanReadableString({ + decimals: serviceFee.data.token.decimals, + }), + symbol: serviceFee.data.token.symbol, + }) + : '', + context: + serviceFee.loading || serviceFee.errored || serviceFee.data + ? undefined + : 'none', + })} +

+
- - - )} + )} diff --git a/packages/stateful/actions/core/actions/ConfigureRebalancer/index.tsx b/packages/stateful/actions/core/actions/ConfigureRebalancer/index.tsx index 2cb011d60..063c866ae 100644 --- a/packages/stateful/actions/core/actions/ConfigureRebalancer/index.tsx +++ b/packages/stateful/actions/core/actions/ConfigureRebalancer/index.tsx @@ -750,8 +750,7 @@ export class ConfigureRebalancerAction extends ActionBase { @@ -772,11 +771,13 @@ export class ConfigureRebalancerAction extends ActionBase