Skip to content

Commit

Permalink
style(EmailInsertScreen): minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisMattew committed Aug 30, 2024
1 parent a0a33be commit f79f0f6
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions ts/screens/profile/EmailInsertScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,12 @@ const EmailInsertScreen = () => {
const isProfileEmailAlreadyTaken = useIOSelector(
isProfileEmailAlreadyTakenSelector
);
const [errorMessage, setErrorMessage] = useState("");
const flow = getFlowType(isOnboarding, isFirstOnboarding);
const accessibilityFirstFocuseViewRef = useRef<View>(null);
// This reference is used to prevent the refresh visual glitch
// caused by the polling stop in the email validation screen.
const canShowLoadingSpinner = useRef(true);
const [error, setError] = useState("");

useFocusEffect(
useCallback(
Expand Down Expand Up @@ -200,32 +200,32 @@ const EmailInsertScreen = () => {
email,
O.fold(
() => {
const errorMessage = I18n.t("email.newinsert.alert.invalidemail");
setError(errorMessage);
const errMessage = I18n.t("email.newinsert.alert.invalidemail");
setErrorMessage(errMessage);

return {
isValid: false,
errorMessage
errorMessage: errMessage
};
},
value => {
if (!validator.isEmail(value)) {
const errorMessage = I18n.t("email.newinsert.alert.invalidemail");
setError(errorMessage);
const errMessage = I18n.t("email.newinsert.alert.invalidemail");
setErrorMessage(errMessage);

return {
isValid: false,
errorMessage
errorMessage: errMessage
};
}
if (areSameEmails) {
const errorMessage = sameEmailsErrorRender();
setError(errorMessage);
const errMessage = sameEmailsErrorRender();
setErrorMessage(errMessage);

return { isValid: false, errorMessage };
return { isValid: false, errorMessage: errMessage };
}
// If the instered email is valid the error is resetted
setError("");
setErrorMessage("");

return true;
}
Expand Down Expand Up @@ -468,7 +468,7 @@ const EmailInsertScreen = () => {
inputMode: "email"
}}
accessibilityLabel={I18n.t("email.newinsert.label")}
accessibilityHint={error}
accessibilityHint={errorMessage}
placeholder={I18n.t("email.newinsert.label")}
onValidate={isValidEmail}
errorMessage={I18n.t("email.newinsert.alert.invalidemail")}
Expand Down

0 comments on commit f79f0f6

Please sign in to comment.