style: formatted auth page code
This commit is contained in:
+7
-64
@@ -115,72 +115,15 @@ function AuthIndex({ }: Props) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (step == AUTH_STEP.ENTER_NUMBER) {
|
const stepMap = {
|
||||||
// First Step -> Enter number
|
[AUTH_STEP.ENTER_NUMBER]: <StepEnterNumber onChange={onChange} onSubmit={onSubmit} value={number} />,
|
||||||
return (
|
[AUTH_STEP.ENTER_PASSWORD]: <StepEnterPassword onChange={onChange} onClick={onClick} onSubmit={onSubmit} value={password} passwordVisible={showPassword} rememberMe={rememberMe} />,
|
||||||
<StepEnterNumber
|
[AUTH_STEP.ENTER_OTP]: <StepEnterOtp onChange={onChange} onClick={onClick} phoneNumber={number} onSubmit={onSubmit} value={otp} timerRunning={timerRunning} secondsLeft={secondsLeft} />,
|
||||||
onChange={onChange}
|
[AUTH_STEP.ENTER_NEW_PASSWORD]: <StepNewPassword onChange={onChange} onClick={onClick} onSubmit={onSubmit} value={password} repeatValue={passwordRepeat} passwordVisible={showPassword} repeatPasswordVisible={showPasswordRepeat} />,
|
||||||
onSubmit={onSubmit}
|
[AUTH_STEP.ENTER_RESET_PASSWORD]: <StepNewPassword reset onChange={onChange} onClick={onClick} onSubmit={onSubmit} value={password} repeatValue={passwordRepeat} passwordVisible={showPassword} repeatPasswordVisible={showPasswordRepeat} />,
|
||||||
value={number}
|
|
||||||
/>
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (step == AUTH_STEP.ENTER_PASSWORD) {
|
return stepMap[step] || 'say what now?'
|
||||||
return (
|
|
||||||
<StepEnterPassword
|
|
||||||
onChange={onChange}
|
|
||||||
onClick={onClick}
|
|
||||||
onSubmit={onSubmit}
|
|
||||||
value={password}
|
|
||||||
passwordVisible={showPassword}
|
|
||||||
rememberMe={rememberMe}
|
|
||||||
/>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
if (step == AUTH_STEP.ENTER_OTP) {
|
|
||||||
return (
|
|
||||||
<StepEnterOtp
|
|
||||||
onChange={onChange}
|
|
||||||
onClick={onClick}
|
|
||||||
phoneNumber={number}
|
|
||||||
onSubmit={onSubmit}
|
|
||||||
value={otp}
|
|
||||||
timerRunning={timerRunning}
|
|
||||||
secondsLeft={secondsLeft}
|
|
||||||
/>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
if (step == AUTH_STEP.ENTER_NEW_PASSWORD) {
|
|
||||||
return (
|
|
||||||
<StepNewPassword
|
|
||||||
onChange={onChange}
|
|
||||||
onClick={onClick}
|
|
||||||
onSubmit={onSubmit}
|
|
||||||
value={password}
|
|
||||||
repeatValue={passwordRepeat}
|
|
||||||
passwordVisible={showPassword}
|
|
||||||
repeatPasswordVisible={showPasswordRepeat}
|
|
||||||
/>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
if (step == AUTH_STEP.ENTER_RESET_PASSWORD) {
|
|
||||||
return (
|
|
||||||
<StepNewPassword
|
|
||||||
reset
|
|
||||||
onChange={onChange}
|
|
||||||
onClick={onClick}
|
|
||||||
onSubmit={onSubmit}
|
|
||||||
value={password}
|
|
||||||
repeatValue={passwordRepeat}
|
|
||||||
passwordVisible={showPassword}
|
|
||||||
repeatPasswordVisible={showPasswordRepeat}
|
|
||||||
/>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export default AuthIndex
|
export default AuthIndex
|
||||||
|
|||||||
Reference in New Issue
Block a user