File tree Expand file tree Collapse file tree 2 files changed +16
-8
lines changed
Expand file tree Collapse file tree 2 files changed +16
-8
lines changed Original file line number Diff line number Diff line change @@ -6,8 +6,15 @@ import question from "../assets/question.svg";
66import Button from "../components/Button/Button" ;
77import ToolTip from "../components/ToolTip/ToolTip" ;
88import "../styles/DesignerDetail.styles.css" ;
9+ import { useNavigate } from "react-router-dom" ;
910
1011const 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 >
Original file line number Diff line number Diff line change 11import { useState } from 'react' ;
22import { useNavigate } from 'react-router-dom' ;
3+ import { useSearchParams } from "react-router-dom" ;
34import Header from '../components/Header/Header' ;
45import WeeklyCalendar from '../components/WeeklyCalendar/WeeklyCalendar' ;
56import TimeSelector from '../components/TimeSelector/TimeSelector' ;
67import '../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 [ ] > = {
You can’t perform that action at this time.
0 commit comments