From 70f29e34ed71c214efb8fa75184ee3e4745ac62e Mon Sep 17 00:00:00 2001 From: Alexandr Kazachenko Date: Thu, 26 Dec 2024 14:41:43 +0500 Subject: [PATCH] fix: display hook details only in Hooks store confirm modal --- .../modules/swap/containers/ConfirmSwapModalSetup/index.tsx | 3 +++ .../src/modules/trade/pure/TradeConfirmation/index.tsx | 6 ++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/apps/cowswap-frontend/src/modules/swap/containers/ConfirmSwapModalSetup/index.tsx b/apps/cowswap-frontend/src/modules/swap/containers/ConfirmSwapModalSetup/index.tsx index 269397f3f2..3ba5cde717 100644 --- a/apps/cowswap-frontend/src/modules/swap/containers/ConfirmSwapModalSetup/index.tsx +++ b/apps/cowswap-frontend/src/modules/swap/containers/ConfirmSwapModalSetup/index.tsx @@ -14,6 +14,7 @@ import { TradeConfirmation, TradeConfirmModal, useIsEoaEthFlow, + useIsHooksTradeType, useOrderSubmittedContent, useReceiveAmountInfo, useShouldPayGas, @@ -71,6 +72,7 @@ export function ConfirmSwapModalSetup(props: ConfirmSwapModalSetupProps) { const appData = useAppData() const [userDeadline] = useUserTransactionTTL() const [isPartialApprove] = usePartialApprove() + const isHooksTradeType = useIsHooksTradeType() const slippageAdjustedSellAmount = trade?.maximumAmountIn(allowedSlippage) const isExactIn = trade?.tradeType === TradeType.EXACT_INPUT @@ -127,6 +129,7 @@ export function ConfirmSwapModalSetup(props: ConfirmSwapModalSetupProps) { appData={appData || undefined} slippageAdjustedSellAmount={slippageAdjustedSellAmount} isPartialApprove={isPartialApprove} + displayHookDetails={isHooksTradeType} > {(restContent) => ( <> diff --git a/apps/cowswap-frontend/src/modules/trade/pure/TradeConfirmation/index.tsx b/apps/cowswap-frontend/src/modules/trade/pure/TradeConfirmation/index.tsx index 9722a8d640..6edebb05e2 100644 --- a/apps/cowswap-frontend/src/modules/trade/pure/TradeConfirmation/index.tsx +++ b/apps/cowswap-frontend/src/modules/trade/pure/TradeConfirmation/index.tsx @@ -52,6 +52,7 @@ export interface TradeConfirmationProps { children?: (restContent: ReactElement) => ReactElement slippageAdjustedSellAmount?: CurrencyAmount isPartialApprove?: boolean + displayHookDetails?: boolean } export function TradeConfirmation(props: TradeConfirmationProps) { @@ -81,6 +82,7 @@ export function TradeConfirmation(props: TradeConfirmationProps) { appData, isPartialApprove, slippageAdjustedSellAmount, + displayHookDetails, } = frozenProps || props /** @@ -131,7 +133,7 @@ export function TradeConfirmation(props: TradeConfirmationProps) { onConfirm() } - const hookDetailsElement = ( + const hookDetailsElement = displayHookDetails ? ( <> {appData && ( )} - ) + ) : null return ( e.key === 'Escape' && onDismiss()}>