Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 5 commits into from
Jan 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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>
);
}
Loading