feat(useSignup): customize success message
This commit is contained in:
parent
9111693804
commit
a47ca1dd6c
@ -107,7 +107,13 @@ const signupPageSchema: ISchema = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export const useSignup = () => {
|
export interface UseSignupProps {
|
||||||
|
message?: {
|
||||||
|
success?: string;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
export const useSignup = (props?: UseSignupProps) => {
|
||||||
const history = useHistory();
|
const history = useHistory();
|
||||||
const form = useForm();
|
const form = useForm();
|
||||||
const api = useAPIClient();
|
const api = useAPIClient();
|
||||||
@ -118,7 +124,7 @@ export const useSignup = () => {
|
|||||||
await api.resource('users').signup({
|
await api.resource('users').signup({
|
||||||
values: form.values,
|
values: form.values,
|
||||||
});
|
});
|
||||||
message.success('Sign up successfully, and automatically jump to the sign in page');
|
message.success(props?.message?.success || t('Sign up successfully, and automatically jump to the sign in page'));
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
history.push('/signin');
|
history.push('/signin');
|
||||||
}, 2000);
|
}, 2000);
|
||||||
|
Loading…
Reference in New Issue
Block a user