From 399dbee9cc6fd400ccc8cb9b3c2547bdc071ca37 Mon Sep 17 00:00:00 2001 From: Anton Shalimov Date: Thu, 17 Oct 2024 13:11:15 +0300 Subject: [PATCH 1/3] fix(unwrap stats): hide allowance --- features/wsteth/unwrap/unwrap-form/unwrap-stats.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/features/wsteth/unwrap/unwrap-form/unwrap-stats.tsx b/features/wsteth/unwrap/unwrap-form/unwrap-stats.tsx index e27cb6ef..4da4a626 100644 --- a/features/wsteth/unwrap/unwrap-form/unwrap-stats.tsx +++ b/features/wsteth/unwrap/unwrap-form/unwrap-stats.tsx @@ -84,6 +84,7 @@ export const UnwrapStats = () => { allowance={BigNumber.from(allowance || '0')} loading={isAllowanceLoading} token={TOKENS.WSTETH} + isBlank={isWalletConnected && !isDappActiveAndNetworksMatched} /> )} From cf2f4fa15c3830237833aee2cb8d8e88f23aa703 Mon Sep 17 00:00:00 2001 From: Anton Shalimov Date: Thu, 17 Oct 2024 13:51:53 +0300 Subject: [PATCH 2/3] fix(wq stats): hide stats for l2 --- .../withdrawals/claim/form/transaction-info.tsx | 9 ++++++++- .../request/form/transaction-info.tsx | 16 +++++++++++++--- .../wsteth/unwrap/unwrap-form/unwrap-stats.tsx | 6 +++++- 3 files changed, 26 insertions(+), 5 deletions(-) diff --git a/features/withdrawals/claim/form/transaction-info.tsx b/features/withdrawals/claim/form/transaction-info.tsx index c349a0bd..787330f5 100644 --- a/features/withdrawals/claim/form/transaction-info.tsx +++ b/features/withdrawals/claim/form/transaction-info.tsx @@ -2,8 +2,11 @@ import { DataTableRow } from '@lidofinance/lido-ui'; import { useClaimFormData } from '../claim-form-context'; import { useClaimTxPrice } from 'features/withdrawals/hooks/useWithdrawTxPrice'; import { FormatPrice } from 'shared/formatters'; +import { useDappStatus } from 'shared/hooks/use-dapp-status'; export const TransactionInfo = () => { + const { isDappActive, isAccountActiveOnL2 } = useDappStatus(); + const { selectedRequests } = useClaimFormData(); const { claimTxPriceInUsd, loading: claimTxPriceLoading } = useClaimTxPrice(selectedRequests); @@ -13,7 +16,11 @@ export const TransactionInfo = () => { title="Max transaction cost" loading={claimTxPriceLoading} > - + {!isDappActive || isAccountActiveOnL2 ? ( + '-' + ) : ( + + )} ); }; diff --git a/features/withdrawals/request/form/transaction-info.tsx b/features/withdrawals/request/form/transaction-info.tsx index 1b0b53e8..4831bc37 100644 --- a/features/withdrawals/request/form/transaction-info.tsx +++ b/features/withdrawals/request/form/transaction-info.tsx @@ -17,7 +17,13 @@ import { } from '../request-form-context'; export const TransactionInfo = () => { - const { isDappActive } = useDappStatus(); + const { + isDappActive, + isWalletConnected, + isDappActiveAndNetworksMatched, + isAccountActiveOnL2, + } = useDappStatus(); + const { isApprovalFlow, isApprovalFlowLoading, allowance } = useRequestFormData(); const token = useWatch({ name: 'token' }); @@ -51,13 +57,17 @@ export const TransactionInfo = () => { data-testid="maxTxCost" loading={requestTxPriceLoading} > - + {isWalletConnected && !isDappActiveAndNetworksMatched ? ( + '-' + ) : ( + + )} {token === TOKENS.STETH ? ( diff --git a/features/wsteth/unwrap/unwrap-form/unwrap-stats.tsx b/features/wsteth/unwrap/unwrap-form/unwrap-stats.tsx index 4da4a626..ed33e064 100644 --- a/features/wsteth/unwrap/unwrap-form/unwrap-stats.tsx +++ b/features/wsteth/unwrap/unwrap-form/unwrap-stats.tsx @@ -17,6 +17,7 @@ import { useApproveGasLimit } from 'features/wsteth/wrap/hooks/use-approve-gas-l export const UnwrapStats = () => { const { + isDappActive, isWalletConnected, isAccountActiveOnL2, isDappActiveAndNetworksMatched, @@ -84,7 +85,10 @@ export const UnwrapStats = () => { allowance={BigNumber.from(allowance || '0')} loading={isAllowanceLoading} token={TOKENS.WSTETH} - isBlank={isWalletConnected && !isDappActiveAndNetworksMatched} + isBlank={ + !isDappActive || + (isWalletConnected && !isDappActiveAndNetworksMatched) + } /> )} From 2880d51c8efd61b6ab6bdd84e326e4faa85510f1 Mon Sep 17 00:00:00 2001 From: Anton Shalimov Date: Thu, 17 Oct 2024 15:54:43 +0300 Subject: [PATCH 3/3] fix(wq req): condition for 'Max transaction cost' --- features/withdrawals/request/form/transaction-info.tsx | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/features/withdrawals/request/form/transaction-info.tsx b/features/withdrawals/request/form/transaction-info.tsx index 4831bc37..c532d7a4 100644 --- a/features/withdrawals/request/form/transaction-info.tsx +++ b/features/withdrawals/request/form/transaction-info.tsx @@ -17,12 +17,7 @@ import { } from '../request-form-context'; export const TransactionInfo = () => { - const { - isDappActive, - isWalletConnected, - isDappActiveAndNetworksMatched, - isAccountActiveOnL2, - } = useDappStatus(); + const { isDappActive, isAccountActiveOnL2 } = useDappStatus(); const { isApprovalFlow, isApprovalFlowLoading, allowance } = useRequestFormData(); @@ -57,7 +52,7 @@ export const TransactionInfo = () => { data-testid="maxTxCost" loading={requestTxPriceLoading} > - {isWalletConnected && !isDappActiveAndNetworksMatched ? ( + {!isDappActive || isAccountActiveOnL2 ? ( '-' ) : (