balibabu
feat: Switch the login page to the registration component by changing the routing parameters #3221 (#3307)
56dceef
raw
history blame
436 Bytes
import { useCallback } from 'react';
import { useSearchParams } from 'umi';
export enum Step {
SignIn,
SignUp,
ForgotPassword,
ResetPassword,
VerifyEmail,
}
export const useSwitchStep = (step: Step) => {
const [_, setSearchParams] = useSearchParams();
const switchStep = useCallback(() => {
setSearchParams(new URLSearchParams({ step: step.toString() }));
}, [setSearchParams, step]);
return { switchStep };
};