From f270c7e97d34d0a267fa808ceb3aa4501ec63bac Mon Sep 17 00:00:00 2001 From: Usame Algan <5880855+usame-algan@users.noreply.github.com> Date: Tue, 26 Sep 2023 14:46:34 +0200 Subject: [PATCH] fix: Hide txInfo when displaying human description in batch tx (#2549) --- src/components/batch/BatchSidebar/BatchTxItem.tsx | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/components/batch/BatchSidebar/BatchTxItem.tsx b/src/components/batch/BatchSidebar/BatchTxItem.tsx index 3a538ba83c..afd633a1af 100644 --- a/src/components/batch/BatchSidebar/BatchTxItem.tsx +++ b/src/components/batch/BatchSidebar/BatchTxItem.tsx @@ -12,6 +12,9 @@ import { MethodDetails } from '@/components/transactions/TxDetails/TxData/Decode import { TxDataRow } from '@/components/transactions/TxDetails/Summary/TxDataRow' import { dateString } from '@/utils/formatters' import { BATCH_EVENTS, trackEvent } from '@/services/analytics' +import { TransactionInfoType } from '@safe-global/safe-gateway-typescript-sdk' +import useABTesting from '@/services/tracking/useAbTesting' +import { AbTest } from '@/services/tracking/abTesting' type BatchTxItemProps = DraftBatchItem & { id: string @@ -30,6 +33,8 @@ const BatchTxItem = ({ dragging = false, draggable = false, }: BatchTxItemProps) => { + const shouldDisplayHumanDescription = useABTesting(AbTest.HUMAN_DESCRIPTION) + const txSummary = useMemo( () => ({ timestamp, @@ -55,6 +60,9 @@ const BatchTxItem = ({ const handleExpand = () => { trackEvent(BATCH_EVENTS.BATCH_EXPAND_TX) } + const displayInfo = + (!txDetails.txInfo.richDecodedInfo && txDetails.txInfo.type !== TransactionInfoType.TRANSFER) || + !shouldDisplayHumanDescription return ( @@ -75,9 +83,7 @@ const BatchTxItem = ({ - - - + {displayInfo && } {onDelete && ( <>