From c8b47dbdf7928866d6290de1059812ad0e4d2374 Mon Sep 17 00:00:00 2001 From: Jon Tzeng Date: Mon, 22 Jan 2024 19:08:22 -0800 Subject: [PATCH] Fix Copy Icon Visibility Logic was hiding the right button if onPress wasn't provided --- .../TransactionListRow.test.tsx.snap | 2 +- .../TransactionDetailsScene.test.tsx.snap | 260 ++++++++++++++++++ src/components/ui4/RowUi4.tsx | 6 +- 3 files changed, 265 insertions(+), 3 deletions(-) diff --git a/src/__tests__/components/__snapshots__/TransactionListRow.test.tsx.snap b/src/__tests__/components/__snapshots__/TransactionListRow.test.tsx.snap index e7e6f3863e9..744530451f5 100644 --- a/src/__tests__/components/__snapshots__/TransactionListRow.test.tsx.snap +++ b/src/__tests__/components/__snapshots__/TransactionListRow.test.tsx.snap @@ -241,7 +241,7 @@ exports[`TransactionListRow should render with loading props 1`] = ` ] } > - Synchronizing + Syncing... + + +  + + @@ -1551,6 +1616,71 @@ exports[`TransactionDetailsScene should render 1`] = ` this is a signed tx + + +  + + @@ -2675,6 +2805,71 @@ exports[`TransactionDetailsScene should render with negative nativeAmount and fi this is the txid + + +  + + @@ -3271,6 +3466,71 @@ exports[`TransactionDetailsScene should render with negative nativeAmount and fi this is a signed tx + + +  + + diff --git a/src/components/ui4/RowUi4.tsx b/src/components/ui4/RowUi4.tsx index 78021ad4510..951e5e4dbb2 100644 --- a/src/components/ui4/RowUi4.tsx +++ b/src/components/ui4/RowUi4.tsx @@ -98,7 +98,7 @@ export const RowUi4 = (props: Props) => { { // If right action icon button is visible, only the icon dims on row tap - isTappable && rightButtonVisible ? ( + rightButtonVisible ? ( {rightButtonType === 'touchable' ? : null} {rightButtonType === 'editable' ? : null} @@ -111,7 +111,9 @@ export const RowUi4 = (props: Props) => { ) - // The entire row dims on tap if not handled by the right action icon button + // The entire row dims on tap if not handled by the right action icon button. + // TODO: If a right button is specified, onPress/onLogPress is ignored! Refine + // API and possibly restructure JSX. return isTappable && !rightButtonVisible ? ( {content}