+
validation('password')
})}
type={passwordShow ? 'text' : 'password'}
onFocus={() => {
- setInputFocus(3)
+ updateFocus(2)
}}
/>
setPasswordShow(!passwordShow)}
>
{passwordShow ? (
@@ -225,38 +426,56 @@ export default function SignUpRegister() {
)}
- {inputFocus === 3 && (
-
-
- -
- Your password must be at least 8 characters
-
- - and include two of the followings:
- - Capital letters, Small letters, or Numbers
+ {inputFocus === 2 &&
+ (errors.password || !getValues('password') ? (
+
+
+ - 8-20 characters
+ - Include two of the followings:
+ - capital letters, small letters, numbers
+
+
+ ) : (
+ Available
+ ))}
+ {inputFocus !== 2 &&
+ errors.password &&
+ (errors.password.message == 'Required' ? (
+ requiredMessage('Required')
+ ) : (
+
+ - 8-20 characters
+ - Include two of the followings:
+ - capital letters, small letters, numbers
-
- )}
+ ))}
-
+
validation('passwordAgain')
})}
+ className={cn(
+ focusedList[3] && 'ring-1 focus-visible:ring-1',
+ errors.passwordAgain &&
+ (getValues('passwordAgain') || inputFocus !== 3)
+ ? 'ring-red-500 focus-visible:ring-red-500'
+ : 'ring-primary'
+ )}
placeholder="Re-enter password"
type={passwordAgainShow ? 'text' : 'password'}
onFocus={() => {
- setInputFocus(4)
+ updateFocus(3)
}}
/>
setPasswordAgainShow(!passwordAgainShow)}
>
{passwordAgainShow ? (
@@ -266,15 +485,139 @@ export default function SignUpRegister() {
)}
- {errors.passwordAgain && (
-
Incorrect
- )}
+ {errors.passwordAgain &&
+ (getValues('passwordAgain') || inputFocus !== 3) &&
+ requiredMessage(errors.passwordAgain.message)}
+
+
+
+
+ validation('studentId')
+ })}
+ className={cn(
+ focusedList[6] && 'ring-1 focus-visible:ring-1',
+ errors.studentId && (getValues('studentId') || inputFocus !== 6)
+ ? 'ring-red-500 focus-visible:ring-red-500'
+ : 'ring-primary'
+ )}
+ onFocus={() => {
+ updateFocus(6)
+ }}
+ />
+ {errors.studentId &&
+ (getValues('studentId') || inputFocus !== 6) &&
+ requiredMessage(errors.studentId.message)}
+
+
+
+
+
+
+
+
+
+
+ No major found.
+
+
+ {majors?.map((major) => (
+ {
+ setMajorValue(currentValue)
+ setMajorOpen(false)
+ }}
+ >
+
+ {major}
+
+ ))}
+
+
+
+
+
+
+ {!majorValue &&
+ focusedList[7] &&
+ !majorOpen &&
+ requiredMessage('Required')}
diff --git a/apps/frontend/components/auth/SignUpWelcome.tsx b/apps/frontend/components/auth/SignUpWelcome.tsx
index 20a92b83c7..255f13413f 100644
--- a/apps/frontend/components/auth/SignUpWelcome.tsx
+++ b/apps/frontend/components/auth/SignUpWelcome.tsx
@@ -12,11 +12,11 @@ import useSignUpModalStore from '@/stores/signUpModal'
export default function SignUpWelcome() {
const { nextModal } = useSignUpModalStore((state) => state)
return (
-
-
- "Welcome to CODEDANG"
+
+
+ WELCOME to CODEDANG
-