From a3a4039072055a34565461264ff387ebdadfcff1 Mon Sep 17 00:00:00 2001 From: jiohjung98 Date: Sun, 9 Jun 2024 22:34:33 +0900 Subject: [PATCH 1/3] =?UTF-8?q?design:=20=EC=B8=B5=20=EC=88=98=20=EC=9D=B4?= =?UTF-8?q?=EB=AF=B8=EC=A7=80=20=ED=85=8D=EC=8A=A4=ED=8A=B8=20=EC=A0=95?= =?UTF-8?q?=EB=A0=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/reservation/meetingRoom/MeetingRoomIndex.tsx | 2 +- src/components/reservation/meetingRoom/MeetingRoomInfo.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/reservation/meetingRoom/MeetingRoomIndex.tsx b/src/components/reservation/meetingRoom/MeetingRoomIndex.tsx index 14b6b6b..66e6718 100644 --- a/src/components/reservation/meetingRoom/MeetingRoomIndex.tsx +++ b/src/components/reservation/meetingRoom/MeetingRoomIndex.tsx @@ -382,7 +382,7 @@ const MeetingRoomIndex: React.FC = () => {
floor -
+
{room.meetingRoomFloor < 0 ? `B${Math.abs(room.meetingRoomFloor)}` : `${room.meetingRoomFloor}`}층
capacity diff --git a/src/components/reservation/meetingRoom/MeetingRoomInfo.tsx b/src/components/reservation/meetingRoom/MeetingRoomInfo.tsx index f38fb8a..0732332 100644 --- a/src/components/reservation/meetingRoom/MeetingRoomInfo.tsx +++ b/src/components/reservation/meetingRoom/MeetingRoomInfo.tsx @@ -236,7 +236,7 @@ const MeetingRoomInfo = () => {
{meetingRoom.meetingRoomName}
floor -
+
{meetingRoom.meetingRoomFloor < 0 ? `B${Math.abs(meetingRoom.meetingRoomFloor)}` : `${meetingRoom.meetingRoomFloor}`}층
capacity From f09fd39cea9a2ea618d81992eb663e0ef84f8360 Mon Sep 17 00:00:00 2001 From: jiohjung98 Date: Sun, 9 Jun 2024 23:09:10 +0900 Subject: [PATCH 2/3] =?UTF-8?q?fix:=20=EC=98=88=EC=95=BD=ED=8E=98=EC=9D=B4?= =?UTF-8?q?=EC=A7=80=EC=97=90=EC=84=9C=20=EC=A7=80=EC=A0=90=20=EC=83=81?= =?UTF-8?q?=EC=84=B8=EB=B3=B4=EA=B8=B0=20=ED=81=B4=EB=A6=AD=20=EC=8B=9C,?= =?UTF-8?q?=20=EC=9D=B4=EB=AF=B8=EC=A7=80=20=EC=95=88=EB=9C=A8=EB=8A=94=20?= =?UTF-8?q?=EB=AC=B8=EC=A0=9C=20=ED=95=B4=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/map/BranchInfo.tsx | 25 ++++++++++++++++++++----- src/components/map/BranchModal.tsx | 1 - 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/src/components/map/BranchInfo.tsx b/src/components/map/BranchInfo.tsx index 5997d0b..187dd9d 100644 --- a/src/components/map/BranchInfo.tsx +++ b/src/components/map/BranchInfo.tsx @@ -13,6 +13,10 @@ import { getSelectedOfficeInfo } from '@/api/map/getSelectedOffice'; import { getOfficeMeetingRoomCount } from '@/api/map/getAvailableOffice'; import TabSection from './TapSection'; +const getBranchImage = (imageName: string): string => { + return `/branch/${imageName}`; +}; + const BranchInfo: React.FC = () => { const router = useRouter(); const { setReservedBranch } = useBranchStore2(); @@ -27,14 +31,25 @@ const BranchInfo: React.FC = () => { const roadFromStation = router.query.roadFromStation as string; const stationToBranch = router.query.stationToBranch as string; const branchId = router.query.branchId; - const branchImage = router.query.image as string; + + const imagePairs = [ + ['branch1-1.png', 'branch1-2.png'], + ['branch2-1.png', 'branch2-2.png'], + ['branch3-1.png', 'branch3-2.png'] + ]; + + const hash = Array.from(branchName).reduce((acc: number, char: string) => acc + char.charCodeAt(0), 0); + const pairIndex = hash % imagePairs.length; + + const selectedImagePair = imagePairs[pairIndex]; + + const branchImage1 = getBranchImage(selectedImagePair[0]); + const branchImage2 = getBranchImage(selectedImagePair[1]); const numericBranchId = Array.isArray(branchId) ? parseInt(branchId[0], 10) : parseInt(branchId as string, 10); const [activeTab, setActiveTab] = useState('meetingRoom'); - const imagePrefix = (branchImage || '').replace('.png', ''); - console.log(branchId); console.log(numericBranchId) @@ -155,7 +170,7 @@ const BranchInfo: React.FC = () => { onSlideChange={(swiper) => setCurrentSlide(swiper.realIndex + 1)}> Office Image 1 { Office Image 2 = ({ isOpen, onClose, branchName, branch roadFromStation: officeInfo.roadFromStation, stationToBranch: officeInfo.stationToBranch.join(','), branchId: officeInfo.branchId as number, - image: getBranchImage(branchName), } }, `/branches/${encodeURIComponent(branchName)}`); } catch (error) { From 9b2a2530d0f72c454cb79283d3412c17ab80702b Mon Sep 17 00:00:00 2001 From: jiohjung98 Date: Sun, 9 Jun 2024 23:13:10 +0900 Subject: [PATCH 3/3] =?UTF-8?q?fix:=20=EC=8B=9C=EC=9E=91=EC=8B=9C=EA=B0=84?= =?UTF-8?q?=2023:30=EC=9D=BC=20=EC=8B=9C,=20=EB=A7=88=EA=B0=90=EC=8B=9C?= =?UTF-8?q?=EA=B0=84=2024:00=EC=9C=BC=EB=A1=9C=20=EA=B3=A0=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../reservation/meetingRoom/MeetingRoomIndex.tsx | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/components/reservation/meetingRoom/MeetingRoomIndex.tsx b/src/components/reservation/meetingRoom/MeetingRoomIndex.tsx index 66e6718..44b31ad 100644 --- a/src/components/reservation/meetingRoom/MeetingRoomIndex.tsx +++ b/src/components/reservation/meetingRoom/MeetingRoomIndex.tsx @@ -28,20 +28,22 @@ const formatDisplayDate = (startDate: Date, endDate: Date): string => { const setInitialDateTime = (): [Date, Date, string] => { const now = new Date(); - let startAt: Date; + const roundedMinutes = Math.ceil(now.getMinutes() / 30) * 30; + const startAt = new Date(now.getFullYear(), now.getMonth(), now.getDate(), now.getHours(), roundedMinutes, 0); - if (now.getMinutes() > 30) { - startAt = new Date(now.getFullYear(), now.getMonth(), now.getDate(), now.getHours() + 1, 0, 0); + let endAt: Date; + if (startAt.getHours() === 23 && startAt.getMinutes() === 30) { + endAt = new Date(startAt.getTime() + 30 * 60 * 1000); } else { - startAt = new Date(now.getFullYear(), now.getMonth(), now.getDate(), now.getHours(), 30, 0); + endAt = new Date(startAt.getTime() + 60 * 60 * 1000); } - const endAt = new Date(startAt.getTime() + 60 * 60 * 1000); const currentTime = formatDisplayDate(startAt, endAt); return [startAt, endAt, currentTime]; }; + const setInitialParams = (startAt: Date, endAt: Date, branchName: string): GetMeetingRoomsParams => { const formattedStartAt = formatDateToCustomString(startAt); const formattedEndAt = formatDateToCustomString(endAt);