From ab126572ffb0ecb094b52c1ba31505f9f39f04e1 Mon Sep 17 00:00:00 2001 From: Alfetopito Date: Fri, 5 Jan 2024 12:37:26 +0000 Subject: [PATCH] refactor: remove duplication as form validation already knows to show warning --- .../twap/containers/TwapFormWarnings/index.tsx | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/apps/cowswap-frontend/src/modules/twap/containers/TwapFormWarnings/index.tsx b/apps/cowswap-frontend/src/modules/twap/containers/TwapFormWarnings/index.tsx index e956fb7472..876f385396 100644 --- a/apps/cowswap-frontend/src/modules/twap/containers/TwapFormWarnings/index.tsx +++ b/apps/cowswap-frontend/src/modules/twap/containers/TwapFormWarnings/index.tsx @@ -6,8 +6,6 @@ import { useIsSafeViaWc, useWalletInfo } from '@cowprotocol/wallet' import { useAdvancedOrdersDerivedState } from 'modules/advancedOrders' import { SellNativeWarningBanner } from 'modules/trade/containers/SellNativeWarningBanner' -import { useIsNativeIn } from 'modules/trade/hooks/useIsNativeInOrOut' -import { useIsWrappedOut } from 'modules/trade/hooks/useIsWrappedInOrOut' import { useTradeRouteContext } from 'modules/trade/hooks/useTradeRouteContext' import { NoImpactWarning } from 'modules/trade/pure/NoImpactWarning' import { TradeFormValidation, useGetTradeFormValidation } from 'modules/tradeFormValidation' @@ -90,13 +88,6 @@ export function TwapFormWarnings({ localFormValidation, isConfirmationModal }: T const showRecipientWarning = isConfirmationModal && twapOrder?.receiver && twapOrder.receiver !== account - const isNativeIn = useIsNativeIn() - const isWrappedOut = useIsWrappedOut() - - // TODO: implement Safe App EthFlow bundling for TWAP and disable the warning in that case - const showNativeSellWarning = - isNativeIn && !isWrappedOut && primaryFormValidation === TradeFormValidation.SellNativeToken - // Don't display any warnings while a wallet is not connected if (walletIsNotConnected) return null @@ -128,7 +119,7 @@ export function TwapFormWarnings({ localFormValidation, isConfirmationModal }: T return } - if (showNativeSellWarning) { + if (primaryFormValidation === TradeFormValidation.SellNativeToken) { return }