diff --git a/src/pages/BusinessSignUp/hooks/useBusinessSignUp.ts b/src/pages/BusinessSignUp/hooks/useBusinessSignUp.ts index 9e21497f..f238bed4 100644 --- a/src/pages/BusinessSignUp/hooks/useBusinessSignUp.ts +++ b/src/pages/BusinessSignUp/hooks/useBusinessSignUp.ts @@ -3,7 +3,7 @@ import { useMutation } from '@tanstack/react-query'; import axios from 'axios'; import { useNavigate } from 'react-router-dom'; import { Dispatch } from 'react'; -import { ErrorMsg } from '../components/BusinessSignUpForm'; +import type { ErrorMsg } from '../components/BusinessSignUpForm'; const useBusinessSignUp = ( setErrorMessage: Dispatch>, diff --git a/src/pages/DetailPage/components/DetailComponent.tsx b/src/pages/DetailPage/components/DetailComponent.tsx index f5c2bf46..a2fca1ea 100644 --- a/src/pages/DetailPage/components/DetailComponent.tsx +++ b/src/pages/DetailPage/components/DetailComponent.tsx @@ -1,5 +1,6 @@ import { GetWorkPlaceData } from '@typings/types'; import { FaMapMarkerAlt, FaPhoneAlt } from 'react-icons/fa'; +import { IoTime } from 'react-icons/io5'; import { Map, MapMarker } from 'react-kakao-maps-sdk'; const DetailComponent = ({ @@ -11,7 +12,6 @@ const DetailComponent = ({ lat: Number(workplaceDetailData.latitude), lng: Number(workplaceDetailData.longitude), }; - return (
@@ -24,6 +24,16 @@ const DetailComponent = ({ {workplaceDetailData.workplacePhoneNumber}
+
+ + + {workplaceDetailData.workplaceStartTime} ~{' '} + {workplaceDetailData.workplaceEndTime} + +
handleClick(item.studyRoomId)} - className='mb-[16px] rounded-[10px]' - style={{ - border: - selectedRoomId === item.studyRoomId - ? '1px solid #50BEAD' - : 'none', - }} + className={`mb-[16px] rounded-[10px] ${ + selectedRoomId === item.studyRoomId + ? 'border-[1px] border-[#50BEAD]' + : '' + }`} > diff --git a/src/pages/DetailPage/components/TabComponent.tsx b/src/pages/DetailPage/components/TabComponent.tsx index 5b5efdf6..0dbf3ad0 100644 --- a/src/pages/DetailPage/components/TabComponent.tsx +++ b/src/pages/DetailPage/components/TabComponent.tsx @@ -38,11 +38,11 @@ const TabComponent = ({ key={item} type='button' onClick={() => handleClickTab(index)} - style={{ - color: activeTab === index ? 'black' : '#c3c3c3', - borderColor: activeTab === index ? '#50BEAD' : '#c3c3c3', - }} - className='h-[60px] w-[125px] border-b-2' + className={`h-[60px] w-[125px] border-b-2 ${ + activeTab === index + ? 'border-[#50BEAD] text-black' + : 'border-[#c3c3c3] text-[#c3c3c3]' + }`} > {item} diff --git a/src/pages/DetailPage/components/WorkPlaceReview.tsx b/src/pages/DetailPage/components/WorkPlaceReview.tsx index 81b29e88..63592e28 100644 --- a/src/pages/DetailPage/components/WorkPlaceReview.tsx +++ b/src/pages/DetailPage/components/WorkPlaceReview.tsx @@ -52,7 +52,7 @@ const WorkPlaceReview = ({ return (

diff --git a/src/pages/ReservationPage/components/ReservationDate/ReservationDate.tsx b/src/pages/ReservationPage/components/ReservationDate/ReservationDate.tsx index 72cfdb85..af9fc87e 100644 --- a/src/pages/ReservationPage/components/ReservationDate/ReservationDate.tsx +++ b/src/pages/ReservationPage/components/ReservationDate/ReservationDate.tsx @@ -8,6 +8,8 @@ type SelectedDate = DatePiece | [DatePiece, DatePiece]; const ReservationDate = () => { const { searchDate, setDate, setTime, setFormattedTime } = useSearchStore(); + const maxDate = new Date(); + maxDate.setMonth(maxDate.getMonth() + 3); const handleChangeDate = (newDate: SelectedDate) => { if (newDate instanceof Date) { @@ -28,6 +30,7 @@ const ReservationDate = () => { next2Label={null} showFixedNumberOfWeeks minDate={new Date()} + maxDate={maxDate} />

); diff --git a/src/pages/ReservationPage/components/ReservationTime.tsx b/src/pages/ReservationPage/components/ReservationTime.tsx index 06f17dd4..c3583f16 100644 --- a/src/pages/ReservationPage/components/ReservationTime.tsx +++ b/src/pages/ReservationPage/components/ReservationTime.tsx @@ -13,7 +13,7 @@ const ReservationTime = (props: ReservationTimeProps) => { const times = { startTime: data.startTime, endTime: data.endTime }; const startHour: number = Number(times.startTime.split(':')[0]); - const endHour: number = Number(times.endTime.split(':')[0]); + const endHour: number = Number(times.endTime.split(':')[0]) - 1; const timeList = Array.from({ length: endHour - startHour + 1 }, (_, i) => { const hour = startHour + i; diff --git a/src/pages/SearchPage/components/SelectDate/SelectDate.tsx b/src/pages/SearchPage/components/SelectDate/SelectDate.tsx index e0aa9247..2008163f 100644 --- a/src/pages/SearchPage/components/SelectDate/SelectDate.tsx +++ b/src/pages/SearchPage/components/SelectDate/SelectDate.tsx @@ -9,6 +9,9 @@ type SelectedDate = DatePiece | [DatePiece, DatePiece]; const SelectDate = () => { const { searchDate, setDate } = useSearchStore(); + const maxDate = new Date(); + maxDate.setMonth(maxDate.getMonth() + 3); + const handleChangeDate = (newDate: SelectedDate) => { if (newDate instanceof Date) { setDate(new Date(newDate)); @@ -32,6 +35,7 @@ const SelectDate = () => { next2Label={null} showFixedNumberOfWeeks minDate={new Date()} + maxDate={maxDate} />
); diff --git a/src/utils/formatTime.ts b/src/utils/formatTime.ts index 81f2f693..5ab685f0 100644 --- a/src/utils/formatTime.ts +++ b/src/utils/formatTime.ts @@ -34,16 +34,6 @@ export const getFormattedDateWeekFunction = (date: string) => { return `${formattedDate}요일`; }; -// date타입에서 YYYY-MM-DD 추출해 YYYY.MM.DD로 변환 -export const getStringFromDate = (value: Date) => { - const year = value.getFullYear(); - const month = (value.getMonth() + 1).toString().padStart(2, '0'); - const day = value.getDate().toString().padStart(2, '0'); - const dateString = `${year}.${month}.${day}`; - - return dateString; -}; - // YYYY-MM-DDTHH:mm:ss 에서 시간(HH:mm) 추출 export const getTimeFunction = (timeString: string) => { const hour = new Date(timeString).getHours().toString().padStart(2, '0'); @@ -53,15 +43,6 @@ export const getTimeFunction = (timeString: string) => { return formattedTimeString; }; -// date타입에서 시간(HH:mm) 추출 -export const getStringFromDateTime = (value: Date) => { - const hour = value.getHours().toString().padStart(2, '0'); - const minutes = value.getMinutes().toString().padStart(2, '0'); - const formattedTimeString = `${hour}:${minutes}`; - - return formattedTimeString; -}; - export const getDatetoLocalDate = (date: Date) => { const yyyy = date.getFullYear(); const mm = String(date.getMonth() + 1).padStart(2, '0'); // 월은 0부터 시작하므로 +1