🐛 Fix change button not doing anything (#960)

This commit is contained in:
Luke Vella 2023-12-07 10:25:54 +07:00 committed by GitHub
parent 381520be04
commit fc6c1d54cd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 5 deletions

View file

@ -69,6 +69,9 @@ export function LoginForm({ oidcConfig }: { oidcConfig?: { name: string } }) {
}
}}
email={getValues("email")}
onChangeEmail={() => {
setEmail(undefined);
}}
/>
);
}

View file

@ -68,6 +68,9 @@ export const RegisterForm = () => {
});
}}
email={getValues("email")}
onChangeEmail={() => {
setToken(undefined);
}}
/>
);
}

View file

@ -22,7 +22,8 @@ export const verifyCode = async (options: { email: string; token: string }) => {
export const VerifyCode: React.FunctionComponent<{
email: string;
onSubmit: (code: string) => Promise<void>;
}> = ({ onSubmit, email }) => {
onChangeEmail?: () => void;
}> = ({ onSubmit, onChangeEmail, email }) => {
const { register, handleSubmit, setError, formState } = useForm<{
code: string;
}>();
@ -58,11 +59,11 @@ export const VerifyCode: React.FunctionComponent<{
components={{
b: <strong className="whitespace-nowrap" />,
a: (
<a
<button
role="button"
className="text-link"
href="#"
onClick={(e) => {
e.preventDefault();
onClick={() => {
onChangeEmail?.();
}}
/>
),