From 1ef6c49f89997c4bc786f78abea2aa2add99e5a8 Mon Sep 17 00:00:00 2001 From: MIJUUUUU Date: Mon, 21 Sep 2026 09:32:59 +0900 Subject: [PATCH] =?UTF-8?q?feat(client):=20=EC=9D=BC=EC=A0=95=EC=83=9D?= =?UTF-8?q?=EC=84=B1=20=EC=8B=9C=EA=B0=84=20=EC=88=98=EC=A0=95,=20?= =?UTF-8?q?=EB=8F=84=EC=B0=A9=EC=A7=80/=EC=88=99=EC=86=8C=20=EC=84=A0?= =?UTF-8?q?=ED=83=9D=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/(app)/trips/new/date/page.tsx | 52 ++++++++++++++++++------ src/app/(app)/trips/new/places/page.tsx | 3 -- src/app/(app)/trips/new/preview/page.tsx | 37 ++++++++++++----- 3 files changed, 65 insertions(+), 27 deletions(-) diff --git a/src/app/(app)/trips/new/date/page.tsx b/src/app/(app)/trips/new/date/page.tsx index c0433f5..677b658 100644 --- a/src/app/(app)/trips/new/date/page.tsx +++ b/src/app/(app)/trips/new/date/page.tsx @@ -32,9 +32,13 @@ function parseDate(value?: string) { } function LocationField({ + label, + placeholder, value, onOpen, }: { + label: string; + placeholder: string; value: LocationInput | null; onOpen: () => void; }) { @@ -49,13 +53,13 @@ function LocationField({ - 출발지 + {label} - {value?.name ?? "역, 터미널 또는 장소를 검색하세요"} + {value?.name ?? placeholder} @@ -73,12 +77,15 @@ export default function TripDatePage() { const [startLocation, setStartLocation] = useState( draft.startLocation ?? null, ); - const [pickerOpen, setPickerOpen] = useState(false); + const [endLocation, setEndLocation] = useState( + draft.lodgingPlan.mode === "FIXED_BASE" ? draft.lodgingPlan.baseLocation : null, + ); + const [pickerTarget, setPickerTarget] = useState<"START" | "END" | null>(null); const [error, setError] = useState(null); const nights = start && end ? differenceInDays(start, end) : 0; const tooLong = nights > 3; - const ready = Boolean(start && end && !tooLong && startLocation); + const ready = Boolean(start && end && !tooLong && startLocation && endLocation); function handleSelect(date: Date) { setError(null); @@ -100,13 +107,13 @@ export default function TripDatePage() { } function continueFlow() { - if (!ready || !start || !end || !startLocation) return; + if (!ready || !start || !end || !startLocation || !endLocation) return; updateDraft({ startDate: toDateInput(start), endDate: toDateInput(end), startLocation, startTime: undefined, - lodgingPlan: { mode: "UNDECIDED" }, + lodgingPlan: { mode: "FIXED_BASE", baseLocation: endLocation }, endConstraint: undefined, fixedEvents: [], dayOverrides: [], @@ -196,8 +203,21 @@ export default function TripDatePage() { {start && end && !tooLong && (
-

출발지

- setPickerOpen(true)} /> +

이동 기준 위치

+
+ setPickerTarget("START")} + /> + setPickerTarget("END")} + /> +
)} @@ -211,12 +231,18 @@ export default function TripDatePage() { - {pickerOpen && ( + {pickerTarget && ( setPickerOpen(false)} - onSelect={setStartLocation} + title={pickerTarget === "START" ? "출발지 선택" : "숙소·도착지 선택"} + initial={pickerTarget === "START" ? startLocation : endLocation} + onClose={() => setPickerTarget(null)} + onSelect={(point) => { + if (pickerTarget === "START") { + setStartLocation(point); + } else { + setEndLocation(point); + } + }} /> )} diff --git a/src/app/(app)/trips/new/places/page.tsx b/src/app/(app)/trips/new/places/page.tsx index d3f2895..a1d3afe 100644 --- a/src/app/(app)/trips/new/places/page.tsx +++ b/src/app/(app)/trips/new/places/page.tsx @@ -184,9 +184,6 @@ export default function TripPlacesIntroPage() {

꼭 가고 싶은 곳이 있나요?

-

- 먼저 담아두면 그 장소를 중심으로 동선까지 맞춰 일정을 짜드려요 -

diff --git a/src/app/(app)/trips/new/preview/page.tsx b/src/app/(app)/trips/new/preview/page.tsx index 76090e9..9b697c7 100644 --- a/src/app/(app)/trips/new/preview/page.tsx +++ b/src/app/(app)/trips/new/preview/page.tsx @@ -2,6 +2,7 @@ import { useCallback, useEffect, useRef, useState } from "react"; import { useRouter } from "next/navigation"; +import { ChevronDown } from "lucide-react"; import AppHeader from "@/components/layout/AppHeader"; import { ApiError } from "@/lib/api/axios"; import { getTripQuestions } from "@/lib/api/questions"; @@ -167,6 +168,12 @@ export default function TripPreviewPage() {
시작 위치
{draft.startLocation?.name}
+ {draft.lodgingPlan.mode === "FIXED_BASE" && ( +
+
숙소·도착지
+
{draft.lodgingPlan.baseLocation.name}
+
+ )}
여행 취향
@@ -192,18 +199,26 @@ export default function TripPreviewPage() { {editingDate === day.date && (
@@ -260,7 +275,7 @@ export default function TripPreviewPage() { {preview.routeCoverage === "ATTRACTION_ROUTES_ONLY" && (

- 도착지와 숙소를 별도로 입력하지 않아 출발지를 기준으로 하루를 마무리합니다. 방문지 사이의 이동시간을 우선 고려해 일정을 만듭니다. + 숙소·도착지를 별도로 입력하지 않아 출발지를 기준으로 하루를 마무리합니다. 방문지 사이의 이동시간을 우선 고려해 일정을 만듭니다.

)}