Skip to content

Commit e90beed

Browse files
youngminssclaude
andauthored
fix: 모임 생성 폼 필드명 변경 (meetingDate → scheduledDate, location → region) (#35)
* fix: meetingDate 필드명을 scheduledDate로 변경 - CreateMeetingForm.meetingDate → scheduledDate - MeetingContext.meetingDate → scheduledDate - 관련 컴포넌트 및 훅 업데이트 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * fix: location 필드명을 region으로 변경 - CreateMeetingForm.location → region - Location 타입 → Region 타입 - CreateMeetingStep "location" → "region" - useLocationStepValidation → useRegionStepValidation - LocationStep 컴포넌트 → RegionStep 컴포넌트 - 파일명 LocationStep.tsx → RegionStep.tsx Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * fix: RegionStep 핸들러 파라미터명 개선 - handleRegionChange 파라미터 loc → selectedRegion Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * chore: prettier 포맷팅 적용 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 7fc01a1 commit e90beed

File tree

10 files changed

+43
-39
lines changed

10 files changed

+43
-39
lines changed

app/gathering/[gatheringId]/opinion/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export default function OpinionPage() {
3333
const meetingContext = useMemo<MeetingContext>(
3434
() => ({
3535
gatheringId,
36-
meetingDate: MOCK_MEETING_DATA.DATE,
36+
scheduledDate: MOCK_MEETING_DATA.DATE,
3737
stationName: MOCK_MEETING_DATA.STATION_NAME,
3838
}),
3939
[gatheringId],

app/gathering/create/page.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { BackwardButton } from "#/components/backwardButton/BackwardButton";
88
import {
99
PeopleStep,
1010
DateStep,
11-
LocationStep,
11+
RegionStep,
1212
} from "#/pageComponents/gathering/create";
1313
import {
1414
useCreateMeetingForm,
@@ -38,8 +38,8 @@ export default function GatheringCreatePage() {
3838
<Layout.Content>
3939
{step === "people" && <PeopleStep onNext={next} />}
4040
{step === "date" && <DateStep onNext={next} />}
41-
{step === "location" && (
42-
<LocationStep
41+
{step === "region" && (
42+
<RegionStep
4343
onComplete={() => {
4444
router.push("/gathering/create/complete");
4545
}}

src/hooks/gathering/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ export {
22
useCreateMeetingForm,
33
usePeopleStepValidation,
44
useDateStepValidation,
5-
useLocationStepValidation,
5+
useRegionStepValidation,
66
} from "./useCreateMeetingForm";
77

88
export { useCreateMeetingFunnel } from "./useCreateMeetingFunnel";

src/hooks/gathering/useCreateMeetingForm.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,21 +23,21 @@ export const usePeopleStepValidation = (
2323
export const useDateStepValidation = (
2424
control: ReturnType<typeof useForm<CreateMeetingForm>>["control"],
2525
) => {
26-
const [meetingDate, timeSlot] = useWatch({
26+
const [scheduledDate, timeSlot] = useWatch({
2727
control,
28-
name: ["meetingDate", "timeSlot"],
28+
name: ["scheduledDate", "timeSlot"],
2929
});
3030

3131
return (
32-
!isNil(meetingDate) &&
32+
!isNil(scheduledDate) &&
3333
!isNil(timeSlot) &&
34-
isValidDateFormat(meetingDate)
34+
isValidDateFormat(scheduledDate)
3535
);
3636
};
3737

38-
export const useLocationStepValidation = (
38+
export const useRegionStepValidation = (
3939
control: ReturnType<typeof useForm<CreateMeetingForm>>["control"],
4040
) => {
41-
const location = useWatch({ control, name: "location" });
42-
return !isNil(location);
41+
const region = useWatch({ control, name: "region" });
42+
return !isNil(region);
4343
};

src/hooks/gathering/useCreateMeetingFunnel.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import { useState, useCallback } from "react";
44
import type { CreateMeetingStep } from "#/types/gathering";
55

6-
const STEP_ORDER: CreateMeetingStep[] = ["people", "date", "location"];
6+
const STEP_ORDER: CreateMeetingStep[] = ["people", "date", "region"];
77

88
export function useCreateMeetingFunnel() {
99
const [step, setStep] = useState<CreateMeetingStep>("people");

src/pageComponents/gathering/create/DateStep.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,19 @@ export const DateStep = ({ onNext }: DateStepProps) => {
1919
const { control, setValue } = useFormContext<CreateMeetingForm>();
2020
const isValid = useDateStepValidation(control);
2121

22-
const meetingDate = useWatch({ control, name: "meetingDate" });
22+
const scheduledDate = useWatch({ control, name: "scheduledDate" });
2323
const timeSlot = useWatch({ control, name: "timeSlot" });
2424

2525
const hasDateError =
26-
meetingDate?.length === 10 && !isValidDateFormat(meetingDate);
26+
scheduledDate?.length === 10 && !isValidDateFormat(scheduledDate);
2727

2828
const handleDateChange = (e: React.ChangeEvent<HTMLInputElement>) => {
2929
const formatted = formatDateInput(e.target.value);
30-
setValue("meetingDate", formatted, { shouldValidate: true });
30+
setValue("scheduledDate", formatted, { shouldValidate: true });
3131
};
3232

3333
const handleDateClear = () => {
34-
setValue("meetingDate", "", { shouldValidate: true });
34+
setValue("scheduledDate", "", { shouldValidate: true });
3535
};
3636

3737
const handleTimeSlotChange = (slot: TimeSlot) => {
@@ -58,7 +58,7 @@ export const DateStep = ({ onNext }: DateStepProps) => {
5858
}
5959
inputMode="numeric"
6060
showClearButton
61-
value={meetingDate || ""}
61+
value={scheduledDate || ""}
6262
onChange={handleDateChange}
6363
onClear={handleDateClear}
6464
/>

src/pageComponents/gathering/create/LocationStep.tsx renamed to src/pageComponents/gathering/create/RegionStep.tsx

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,28 +6,32 @@ import { Layout } from "#/components/layout";
66
import { StepIndicator } from "#/components/stepIndicator/StepIndicator";
77
import { Button } from "#/components/button/Button";
88
import { Chip } from "#/components/chip";
9-
import { useLocationStepValidation } from "#/hooks/gathering";
10-
import type { CreateMeetingForm, Location } from "#/types/gathering";
9+
import { useRegionStepValidation } from "#/hooks/gathering";
10+
import type { CreateMeetingForm, Region } from "#/types/gathering";
1111

12-
interface LocationStepProps {
12+
interface RegionStepProps {
1313
onComplete: () => void;
1414
}
1515

16-
const LOCATION_OPTIONS = [
16+
const REGION_OPTIONS = [
1717
{ id: "HONGDAE" as const, label: "홍대입구역" },
1818
{ id: "GANGNAM" as const, label: "강남역" },
1919
];
2020

21-
export const LocationStep = ({ onComplete }: LocationStepProps) => {
21+
export const RegionStep = ({ onComplete }: RegionStepProps) => {
2222
const { control, setValue } = useFormContext<CreateMeetingForm>();
23-
const isValid = useLocationStepValidation(control);
23+
const isValid = useRegionStepValidation(control);
2424

25-
const location = useWatch({ control, name: "location" });
25+
const region = useWatch({ control, name: "region" });
2626

27-
const handleLocationChange = (loc: Location) => {
28-
setValue("location", loc === location ? undefined : loc, {
29-
shouldValidate: true,
30-
});
27+
const handleRegionChange = (selectedRegion: Region) => {
28+
setValue(
29+
"region",
30+
selectedRegion === region ? undefined : selectedRegion,
31+
{
32+
shouldValidate: true,
33+
},
34+
);
3135
};
3236

3337
return (
@@ -38,11 +42,11 @@ export const LocationStep = ({ onComplete }: LocationStepProps) => {
3842
장소를 선택해 주세요
3943
</h1>
4044
<div className="ygi:flex ygi:gap-3">
41-
{LOCATION_OPTIONS.map(({ id, label }) => (
45+
{REGION_OPTIONS.map(({ id, label }) => (
4246
<Chip
4347
key={id}
44-
selected={location === id}
45-
onClick={() => handleLocationChange(id)}
48+
selected={region === id}
49+
onClick={() => handleRegionChange(id)}
4650
>
4751
{label}
4852
</Chip>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
export { PeopleCountGrid } from "./PeopleCountGrid";
22
export { PeopleStep } from "./PeopleStep";
33
export { DateStep } from "./DateStep";
4-
export { LocationStep } from "./LocationStep";
4+
export { RegionStep } from "./RegionStep";

src/pageComponents/gathering/opinion/IntroStep.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export const IntroStep = ({ meetingContext }: IntroStepProps) => {
1515
</h1>
1616
<div className="ygi:inline-flex ygi:w-fit ygi:items-center ygi:justify-center ygi:rounded-full ygi:bg-button-secondary ygi:px-4 ygi:py-2">
1717
<span className="ygi:body-16-bd ygi:text-text-inverse">
18-
{meetingContext.meetingDate}
18+
{meetingContext.scheduledDate}
1919
</span>
2020
</div>
2121
</div>

src/types/gathering/index.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
export interface CreateMeetingForm {
22
peopleCount?: number;
3-
meetingDate: string;
3+
scheduledDate: string;
44
timeSlot?: "LUNCH" | "DINNER";
5-
location?: "HONGDAE" | "GANGNAM";
5+
region?: "HONGDAE" | "GANGNAM";
66
}
77

88
export type TimeSlot = CreateMeetingForm["timeSlot"];
9-
export type Location = CreateMeetingForm["location"];
9+
export type Region = CreateMeetingForm["region"];
1010

11-
export type CreateMeetingStep = "people" | "date" | "location";
11+
export type CreateMeetingStep = "people" | "date" | "region";
1212

1313
export type DistanceRange = "RANGE_500M" | "RANGE_1KM" | "ANY";
1414

@@ -36,7 +36,7 @@ export type OpinionStep = "intro" | "distance" | "dislike" | "preference";
3636

3737
export interface MeetingContext {
3838
gatheringId: string;
39-
meetingDate: string;
39+
scheduledDate: string;
4040
stationName: string;
4141
totalParticipants?: number;
4242
submittedCount?: number;

0 commit comments

Comments
 (0)