Skip to content

Commit

Permalink
fix(ui-ux): show reset btn on service provider screen without edit (#…
Browse files Browse the repository at this point in the history
…4155)

* fix(ui-ux): fixed address book forgets saved addresses when user switch to custom provider

* fix(ui-ux): show reset btn on service provider screen without edit

* center align convert text in GetDFIScreen

---------

Co-authored-by: Pierre Gee <[email protected]>
  • Loading branch information
fullstackninja864 and Pierre Gee authored Jan 22, 2024
1 parent d8400cf commit b2d55e5
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 36 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ function StepThree(): JSX.Element {
dark={tailwind("bg-mono-dark-v2-00 border-mono-dark-v2-200")}
light={tailwind("bg-mono-light-v2-00 border-mono-light-v2-200")}
>
<View>
<View style={tailwind("flex flex-col items-center")}>
<ThemedViewV2
style={tailwind(
"w-15 h-15 flex flex-row justify-around items-center rounded-full",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ export function ServiceProviderScreen({ navigation }: Props): JSX.Element {
url: dvmUrl,
defaultUrl: defaultDvmUrl,
setUrl: setDvmUrl,
isCustomUrl,
} = useServiceProviderContext();
const { evmUrl, ethRpcUrl, defaultEvmUrl, defaultEthRpcUrl, setCustomUrl } =
useCustomServiceProviderContext();
Expand Down Expand Up @@ -191,41 +192,43 @@ export function ServiceProviderScreen({ navigation }: Props): JSX.Element {
/>
))}
</View>
{showActionButtons && (
<View
style={tailwind("mt-48", {
"mt-36": isSmallScreen,
"mt-10": customProviders.length > 1,
})}
>
<View style={tailwind("mt-2 px-5 mb-5")}>
<Text
style={tailwind(
"text-orange-v2 font-normal-v2 text-xs text-center",
)}
>
{translate(
"screens/ServiceProviderScreen",
"Only add URLs that are fully trusted and secured. Adding malicious service providers may result in irrecoverable funds. Proceed at your own risk.",
)}
</Text>
</View>
<ButtonV2
styleProps="mx-7 mt-2"
label={translate("screens/ServiceProviderScreen", "Save changes")}
testID="button_submit"
onPress={async () => await submitCustomServiceProvider()}
disabled={
!(
urlInputValues.DVM.isValid &&
urlInputValues.EVM.isValid &&
urlInputValues.ETHRPC.isValid
)
}
/>
<ResetButton />
</View>
)}
<View
style={tailwind("mt-48", {
"mt-36": isSmallScreen,
"mt-10": customProviders.length > 1,
})}
>
{showActionButtons && (
<>
<View style={tailwind("mt-2 px-5 mb-5")}>
<Text
style={tailwind(
"text-orange-v2 font-normal-v2 text-xs text-center",
)}
>
{translate(
"screens/ServiceProviderScreen",
"Only add URLs that are fully trusted and secured. Adding malicious service providers may result in irrecoverable funds. Proceed at your own risk.",
)}
</Text>
</View>
<ButtonV2
styleProps="mx-7 mt-2"
label={translate("screens/ServiceProviderScreen", "Save changes")}
testID="button_submit"
onPress={async () => await submitCustomServiceProvider()}
disabled={
!(
urlInputValues.DVM.isValid &&
urlInputValues.EVM.isValid &&
urlInputValues.ETHRPC.isValid
)
}
/>
</>
)}
{(showActionButtons || isCustomUrl) && <ResetButton />}
</View>
</ThemedScrollViewV2>
);
}

0 comments on commit b2d55e5

Please sign in to comment.