feat: show sign-in/sign-up errors under input instead of alert (#904)

This commit is contained in:
Aman Harwara
2022-03-02 19:43:52 +05:30
committed by GitHub
parent c184ef2449
commit 6311c68712
4 changed files with 25 additions and 36 deletions

View File

@@ -36,7 +36,7 @@ export const CreateAccount: FunctionComponent<Props> = observer(
useEffect(() => {
if (emailInputRef.current) {
emailInputRef.current!.focus();
emailInputRef.current?.focus();
}
}, []);
@@ -62,12 +62,12 @@ export const CreateAccount: FunctionComponent<Props> = observer(
e.preventDefault();
if (!email || email.length === 0) {
emailInputRef?.current!.focus();
emailInputRef.current?.focus();
return;
}
if (!password || password.length === 0) {
passwordInputRef?.current!.focus();
passwordInputRef.current?.focus();
return;
}