File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -176,6 +176,7 @@ const TYPE_ICON_BY_KIND: Record<string, { sm: string; lg: string }> = {
176176}
177177
178178const TYPE_META = mbtiTypeMetaRaw as Record < string , MbtiTypeMeta >
179+ const STUDENT_ID_PATTERN = / ^ 1 2 \d { 6 } $ /
179180
180181const RESULTS : Record < string , ResultType > = {
181182 LPTI : {
@@ -860,7 +861,8 @@ export default function MbtiEventPage() {
860861
861862 const answeredCount = Object . keys ( answers ) . length
862863 const isComplete = answeredCount === QUESTIONS . length
863- const canStart = name . trim ( ) . length > 0 && studentId . trim ( ) . length > 0 && isPolicyAgreed
864+ const isStudentIdValid = STUDENT_ID_PATTERN . test ( studentId . trim ( ) )
865+ const canStart = name . trim ( ) . length > 0 && isStudentIdValid && isPolicyAgreed
864866
865867 const result = useMemo ( ( ) => {
866868 const sharedType = sharedTypeRef . current
@@ -1127,6 +1129,11 @@ export default function MbtiEventPage() {
11271129 }
11281130 />
11291131 </ label >
1132+ { studentId . trim ( ) . length > 0 && ! isStudentIdValid ? (
1133+ < p className = "typo-m-c2 mt-2 pl-1 text-red" >
1134+ ※ 학번은 12로 시작하는 8자리 숫자로 입력해 주세요.
1135+ </ p >
1136+ ) : null }
11301137
11311138 < div className = "mt-4 flex items-center justify-end gap-1" >
11321139 < span className = "text-base font-bold leading-6 text-red" > *</ span >
You can’t perform that action at this time.
0 commit comments