Skip to content

Commit 3bc4855

Browse files
committed
대면 -> 대면 예약, 비대면 -> 비대면 예약으로 라우터 수정
1 parent eda6a18 commit 3bc4855

File tree

2 files changed

+16
-8
lines changed

2 files changed

+16
-8
lines changed

src/pages/DesignerDetail.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,15 @@ import question from "../assets/question.svg";
66
import Button from "../components/Button/Button";
77
import ToolTip from "../components/ToolTip/ToolTip";
88
import "../styles/DesignerDetail.styles.css";
9+
import { useNavigate } from "react-router-dom";
910

1011
const DesignerDetail: React.FC = () => {
12+
const navigate = useNavigate();
13+
14+
const handleConsultingClick = (method: "online" | "offline") => {
15+
navigate(`/reservation?method=${method}`);
16+
};
17+
1118
const designerData = {
1219
name: "이초 디자이너",
1320
address: "서울 강남구 압구정 79길 서울 강남구 압구정 79길서울 강남구 압구정 79길서울 강남구 압구정 79길",
@@ -68,12 +75,14 @@ const DesignerDetail: React.FC = () => {
6875
size="large"
6976
children="비대면 컨설팅"
7077
disabled={isRemoteDisabled}
78+
onClick={() => handleConsultingClick("online")}
7179
/>
7280
<Button
7381
variant="primary"
7482
size="large"
7583
children="대면 컨설팅"
7684
disabled={isInpersonDisabled}
85+
onClick={() => handleConsultingClick("offline")}
7786
/>
7887
</footer>
7988
</div >

src/pages/Reservation.tsx

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,21 @@
11
import { useState } from 'react';
22
import { useNavigate } from 'react-router-dom';
3+
import { useSearchParams } from "react-router-dom";
34
import Header from '../components/Header/Header';
45
import WeeklyCalendar from '../components/WeeklyCalendar/WeeklyCalendar';
56
import TimeSelector from '../components/TimeSelector/TimeSelector';
67
import '../styles/Reservation.styles.css';
78

8-
interface ReservationPageProps {
9-
consultMethod?: 'offline' | 'online';
10-
}
11-
12-
export default function ReservationPage({ consultMethod }: ReservationPageProps) {
9+
export default function ReservationPage() {
1310
const [selectedDate, setSelectedDate] = useState<Date | null>(null);
1411
const [selectedTime, setSelectedTime] = useState<string | null>(null);
1512
const navigate = useNavigate();
13+
const [searchParams] = useSearchParams();
14+
const consultMethod = searchParams.get("method") === "offline" ? "offline" : "online";
1615

17-
const pageTitle = consultMethod === 'offline'
18-
? '대면 컨설팅 예약하기'
19-
: '비대면 컨설팅 예약하기';
16+
const pageTitle = consultMethod === "offline"
17+
? "대면 컨설팅 예약하기"
18+
: "비대면 컨설팅 예약하기";
2019

2120
// 예약된 시간들 (날짜별로 구성)
2221
const bookedTimesByDate: Record<string, string[]> = {

0 commit comments

Comments
 (0)