From d3f5e188fe06fbeb450b3f2819fd49a959cb4e53 Mon Sep 17 00:00:00 2001 From: Hojin Date: Mon, 22 Jan 2024 11:23:01 +0900 Subject: [PATCH 1/6] =?UTF-8?q?Fix:=20=EC=97=AC=EC=A0=95=EC=95=84=EC=9D=B4?= =?UTF-8?q?=ED=85=9C=20toLocaleString=20=EC=A0=81=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Plan/PlanItemBox.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Plan/PlanItemBox.tsx b/src/components/Plan/PlanItemBox.tsx index 1ff3d1ca..3244d0cc 100644 --- a/src/components/Plan/PlanItemBox.tsx +++ b/src/components/Plan/PlanItemBox.tsx @@ -122,7 +122,7 @@ const PlanItemBox = ({ {item.category}
- {item.price} 원 + {item.price.toLocaleString()} 원
From f2500015d2cc9976e9225787926ba5a382767a34 Mon Sep 17 00:00:00 2001 From: sue Date: Mon, 22 Jan 2024 11:33:34 +0900 Subject: [PATCH 2/6] =?UTF-8?q?Fix:=20=EC=97=AC=EC=A0=95=EC=9E=A5=EC=86=8C?= =?UTF-8?q?=20=EC=97=86=EC=9D=84=20=EB=95=8C=20default=20=EC=A7=80?= =?UTF-8?q?=EB=8F=84=20=EC=84=A4=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Plan/TripMap.tsx | 71 +++++++++++++++++++-------------- 1 file changed, 41 insertions(+), 30 deletions(-) diff --git a/src/components/Plan/TripMap.tsx b/src/components/Plan/TripMap.tsx index 94dac763..60b40607 100644 --- a/src/components/Plan/TripMap.tsx +++ b/src/components/Plan/TripMap.tsx @@ -6,12 +6,16 @@ import { getColor } from '@utils/getColor'; const VITE_KAKAO_MAP_API_KEY = import.meta.env.VITE_KAKAO_MAP_API_KEY; const TripMap = ({ paths }: { paths: Paths[] }) => { + const DEFAULT_LATITUDE = 36.34; + const DEFAULT_LONGITUDE = 127.77; + const firstPath = paths[0]; - const latitude = firstPath?.fromLatitude; - const longitude = firstPath?.fromLongitude; + const latitude = firstPath ? firstPath.fromLatitude : DEFAULT_LATITUDE; + const longitude = firstPath ? firstPath.fromLongitude : DEFAULT_LONGITUDE; const mapRef = useRef(null); const [selectedMarker, setSelectedMarker] = useState(null); + const [maplevel, setMapLevel] = useState(4); const defaultPosition = { lat: Number(latitude), lng: Number(longitude) }; @@ -84,7 +88,13 @@ const TripMap = ({ paths }: { paths: Paths[] }) => { }; useEffect(() => { - setBounds(); + if (paths.length > 0) { + setTimeout(() => { + setBounds(); + }, 100); + } else { + setMapLevel(15); + } }, [paths]); // 마커를 클릭할 때 호출되는 함수 @@ -186,39 +196,40 @@ const TripMap = ({ paths }: { paths: Paths[] }) => { key={VITE_KAKAO_MAP_API_KEY} center={centerPosition} style={MapStyle} - level={4} + level={maplevel} className="relative object-fill" ref={mapRef}> - {paths.map((path, index) => ( -
- handleMarkerClick(path.toSeqNum)} - image={getSequenceIconUrl(path.toSeqNum - 1)} - /> - {/* 마지막 항목인 경우, 목적지 위치에 마커 추가 */} - {index === paths.length - 1 && ( + {paths.length !== 0 && + paths.map((path, index) => ( +
handleMarkerClick(path.toSeqNum + 1)} - image={getSequenceIconUrl(path.toSeqNum)} + onClick={() => handleMarkerClick(path.toSeqNum)} + image={getSequenceIconUrl(path.toSeqNum - 1)} /> - )} - -
- ))} + {/* 마지막 항목인 경우, 목적지 위치에 마커 추가 */} + {index === paths.length - 1 && ( + handleMarkerClick(path.toSeqNum + 1)} + image={getSequenceIconUrl(path.toSeqNum)} + /> + )} + +
+ ))} ); From e9612e91186a56b97cfb697de5cae48dd7e0048a Mon Sep 17 00:00:00 2001 From: sue Date: Mon, 22 Jan 2024 11:40:41 +0900 Subject: [PATCH 3/6] =?UTF-8?q?Design:=20=EA=B3=84=ED=9A=8D=EC=8A=A4?= =?UTF-8?q?=EC=BC=80=EC=A4=84=20=EB=82=A0=EC=A7=9C=20=EB=B3=80=ED=99=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Plan/PlanSchedule.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/Plan/PlanSchedule.tsx b/src/components/Plan/PlanSchedule.tsx index 4e96dc4f..2571a865 100644 --- a/src/components/Plan/PlanSchedule.tsx +++ b/src/components/Plan/PlanSchedule.tsx @@ -20,7 +20,8 @@ const PlanSchedule = () => { - {trip?.startDate} ~ {trip?.endDate} + {trip?.startDate?.substring(2).replace(/-/g, '.') || ''} -{' '} + {trip?.endDate?.substring(5).replace(/-/g, '.') || ''} ); From caf099228f2e130e2d130eeee5e18cf35124dc8a Mon Sep 17 00:00:00 2001 From: sue Date: Mon, 22 Jan 2024 11:49:41 +0900 Subject: [PATCH 4/6] =?UTF-8?q?Design:=20=EC=97=AC=EC=A0=95=ED=8E=B8?= =?UTF-8?q?=EC=A7=91=20=EB=AA=A8=EB=8B=AC=20width=20=EC=9E=AC=EC=84=A4?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Trip/EditCodeModal.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Trip/EditCodeModal.tsx b/src/components/Trip/EditCodeModal.tsx index 7d3ca648..372d5b89 100644 --- a/src/components/Trip/EditCodeModal.tsx +++ b/src/components/Trip/EditCodeModal.tsx @@ -69,7 +69,7 @@ const EditCodeModal = () => { {isEditModal && ( - + 나의 여정 From 48f8ca1996749d77e3b097d226be4a7ec738a6c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=96=B4=EC=8A=B9=EC=A4=80?= Date: Mon, 22 Jan 2024 12:06:24 +0900 Subject: [PATCH 5/6] =?UTF-8?q?Fix:=20=EC=97=AC=ED=96=89=EC=B7=A8=ED=96=A5?= =?UTF-8?q?=20=EB=94=94=ED=8F=B4=ED=8A=B8=20=EB=94=94=EC=9E=90=EC=9D=B8=20?= =?UTF-8?q?=EA=B5=AC=ED=98=84=20=EB=B0=8F=20=EB=94=94=EB=B2=84=EA=B9=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Plan/PlanSectionTop.tsx | 4 +- src/components/Trip/TripPreference.tsx | 68 ++++++++++++------- ...ltimeEditor.tsx => TripRealtimeMember.tsx} | 4 +- src/components/common/tab/Tab.tsx | 4 +- src/utils/calculatePercentage.ts | 9 ++- 5 files changed, 57 insertions(+), 32 deletions(-) rename src/components/Trip/{TripRealtimeEditor.tsx => TripRealtimeMember.tsx} (96%) diff --git a/src/components/Plan/PlanSectionTop.tsx b/src/components/Plan/PlanSectionTop.tsx index 480ec571..fada423c 100644 --- a/src/components/Plan/PlanSectionTop.tsx +++ b/src/components/Plan/PlanSectionTop.tsx @@ -1,4 +1,4 @@ -import TripRealtimeEditor from '@components/Trip/TripRealtimeEditor'; +import TripRealtimeMember from '@components/Trip/TripRealtimeMember'; import { BackBox } from '@components/common'; import { useNavigate } from 'react-router-dom'; import TripBudget from './TripBudget'; @@ -92,7 +92,7 @@ const PlanSectionTop = () => { navigate(`/trip/${tripId}/share`); }} /> - + { + const navigate = useNavigate(); + + const handleClickButton = () => { + navigate('/signup/survey'); + }; + return ( -