Skip to content

Commit 3299bd4

Browse files
ImTotemclaude
andcommitted
fix: 회원가입 트랙 선택 단계 제거 + 학년 Select 너비 통일
- 4단계 위저드 → 3단계 (Google 인증 → 정보 입력 → 이메일 인증) - 트랙은 비기너 지원/즉시 전환 시 결정되므로 가입 시 불필요 - RegisterRequest.track을 optional로 변경 - 학년 Select에 w-full 추가하여 다른 Input과 너비 통일 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 3adf809 commit 3299bd4

3 files changed

Lines changed: 9 additions & 25 deletions

File tree

src/pages/register/RegisterPage.tsx

Lines changed: 7 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,9 @@ import { Stepper } from "@/components/common/Stepper";
1212
import { GoogleStep } from "./steps/GoogleStep";
1313
import { ProfileStep } from "./steps/ProfileStep";
1414
import { EmailStep } from "./steps/EmailStep";
15-
import { TrackStep } from "./steps/TrackStep";
1615
import { useRegister } from "@/hooks/use-auth";
1716

18-
const STEPS = ["Google 인증", "정보 입력", "이메일 인증", "트랙 선택"];
17+
const STEPS = ["Google 인증", "정보 입력", "이메일 인증"];
1918

2019
interface WizardState {
2120
step: number;
@@ -27,14 +26,12 @@ interface WizardState {
2726
phone: string;
2827
grade: string;
2928
schoolEmail: string;
30-
track: string;
3129
}
3230

3331
type WizardAction =
3432
| { type: "SET_GOOGLE"; googleToken: string; googleName: string }
3533
| { type: "SET_PROFILE"; name: string; department: string; studentId: string; phone: string; grade: string }
3634
| { type: "SET_EMAIL"; schoolEmail: string }
37-
| { type: "SET_TRACK"; track: string }
3835
| { type: "GO_BACK" };
3936

4037
function decodeGoogleName(token: string): string {
@@ -60,16 +57,15 @@ function reducer(state: WizardState, action: WizardAction): WizardState {
6057
case "SET_PROFILE":
6158
return { ...state, step: 3, name: action.name, department: action.department, studentId: action.studentId, phone: action.phone, grade: action.grade };
6259
case "SET_EMAIL":
63-
return { ...state, step: 4, schoolEmail: action.schoolEmail };
64-
case "SET_TRACK":
65-
return { ...state, track: action.track };
60+
return { ...state, schoolEmail: action.schoolEmail };
6661
case "GO_BACK":
6762
return { ...state, step: Math.max(1, state.step - 1) };
6863
}
6964
}
7065

7166
export function RegisterPage() {
7267
const location = useLocation();
68+
const navigate = useNavigate();
7369
const initialGoogleToken =
7470
(location.state as { googleToken?: string })?.googleToken ?? "";
7571

@@ -85,23 +81,20 @@ export function RegisterPage() {
8581
phone: "",
8682
grade: "",
8783
schoolEmail: "",
88-
track: "",
8984
});
9085

9186
const register = useRegister();
92-
const navigate = useNavigate();
9387

94-
const handleTrackComplete = async (track: string) => {
95-
dispatch({ type: "SET_TRACK", track });
88+
const handleEmailComplete = async (email: string) => {
89+
dispatch({ type: "SET_EMAIL", schoolEmail: email });
9690
try {
9791
await register.mutateAsync({
9892
google_token: state.googleToken,
9993
name: state.name,
10094
department: state.department,
10195
student_id: state.studentId,
102-
school_email: state.schoolEmail,
96+
school_email: email,
10397
phone: state.phone,
104-
track,
10598
grade: state.grade,
10699
});
107100
navigate("/post-register", { state: { grade: state.grade } });
@@ -148,16 +141,7 @@ export function RegisterPage() {
148141
{state.step === 3 && (
149142
<EmailStep
150143
onBack={() => dispatch({ type: "GO_BACK" })}
151-
onComplete={(email) =>
152-
dispatch({ type: "SET_EMAIL", schoolEmail: email })
153-
}
154-
/>
155-
)}
156-
{state.step === 4 && (
157-
<TrackStep
158-
onBack={() => dispatch({ type: "GO_BACK" })}
159-
onComplete={handleTrackComplete}
160-
isPending={register.isPending}
144+
onComplete={handleEmailComplete}
161145
/>
162146
)}
163147
</CardContent>

src/pages/register/steps/ProfileStep.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ export function ProfileStep({ defaultName, onBack, onComplete }: ProfileStepProp
7676
<div className="space-y-2">
7777
<Label>학년</Label>
7878
<Select value={grade} onValueChange={(v) => setGrade(v ?? "")}>
79-
<SelectTrigger>
79+
<SelectTrigger className="w-full">
8080
<SelectValue placeholder="학년 선택" />
8181
</SelectTrigger>
8282
<SelectContent>

src/types/auth.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export interface RegisterRequest {
3939
student_id: string;
4040
school_email: string;
4141
phone: string;
42-
track: string;
42+
track?: string;
4343
grade: string;
4444
}
4545

0 commit comments

Comments
 (0)