From fd79b4d0aafb0279bfb2d8fc9825e5c131131f62 Mon Sep 17 00:00:00 2001 From: Lyka Labrada Date: Wed, 4 Oct 2023 15:03:05 +0800 Subject: [PATCH] fix(ui-ux): fix selection of whitelisted address that redirects to edit address (#4040) * fix(ui-ux): fix selection of whitelisted address that redirects to edit address * chore(test): update snapshot --- .../DFIBalanceCard.test.tsx.snap | 2 +- .../Portfolio/screens/AddressBookScreen.tsx | 39 +++----- .../NetworkSelectionScreen.test.tsx.snap | 95 ++++++++++++++++++- .../CreateWalletGuidelines.test.tsx.snap | 12 +++ ...nboardingNetworkSelectScreen.test.tsx.snap | 95 ++++++++++++++++++- 5 files changed, 214 insertions(+), 29 deletions(-) diff --git a/mobile-app/app/screens/AppNavigator/screens/Portfolio/components/__snapshots__/DFIBalanceCard.test.tsx.snap b/mobile-app/app/screens/AppNavigator/screens/Portfolio/components/__snapshots__/DFIBalanceCard.test.tsx.snap index c919fa7d50..33b44c5be0 100644 --- a/mobile-app/app/screens/AppNavigator/screens/Portfolio/components/__snapshots__/DFIBalanceCard.test.tsx.snap +++ b/mobile-app/app/screens/AppNavigator/screens/Portfolio/components/__snapshots__/DFIBalanceCard.test.tsx.snap @@ -207,7 +207,7 @@ exports[`DFI Balance Card should match snapshot 1`] = ` } testID="total_dfi_label_name" > - DeFiChain + DeFiChain diff --git a/mobile-app/app/screens/AppNavigator/screens/Portfolio/screens/AddressBookScreen.tsx b/mobile-app/app/screens/AppNavigator/screens/Portfolio/screens/AddressBookScreen.tsx index c1ec623976..c87d663bd7 100644 --- a/mobile-app/app/screens/AppNavigator/screens/Portfolio/screens/AddressBookScreen.tsx +++ b/mobile-app/app/screens/AppNavigator/screens/Portfolio/screens/AddressBookScreen.tsx @@ -305,6 +305,8 @@ export function AddressBookScreen({ route, navigation }: Props): JSX.Element { : addressDetail.address, ); } + } else { + onDFIAddressClick(); } }; @@ -340,9 +342,7 @@ export function AddressBookScreen({ route, navigation }: Props): JSX.Element { ]} testID={`address_row_${index}_${testIDSuffix}`} disabled={isDisabledToSelect} - onPress={async () => { - onChangeAddress(item); - }} + onPress={async () => onChangeAddress(item)} > {item.label !== "" && ( - + <> )} - + )} {/* for DFI address */} onChangeAddress(item)} /> {/* for EVM address */} {activeButtonGroup === ButtonGroupTabKey.YourAddress && ( @@ -442,19 +435,13 @@ export function AddressBookScreen({ route, navigation }: Props): JSX.Element { {!enableAddressSelect && activeButtonGroup === ButtonGroupTabKey.Whitelisted && ( - - - + )} diff --git a/mobile-app/app/screens/AppNavigator/screens/Settings/screens/__snapshots__/NetworkSelectionScreen.test.tsx.snap b/mobile-app/app/screens/AppNavigator/screens/Settings/screens/__snapshots__/NetworkSelectionScreen.test.tsx.snap index 19e2dc0d68..a0883469c0 100644 --- a/mobile-app/app/screens/AppNavigator/screens/Settings/screens/__snapshots__/NetworkSelectionScreen.test.tsx.snap +++ b/mobile-app/app/screens/AppNavigator/screens/Settings/screens/__snapshots__/NetworkSelectionScreen.test.tsx.snap @@ -450,7 +450,9 @@ exports[`onboarding network selection screen should render 1`] = ` + + + + Changi + + + + + + + + Changi + + + +