From d11dacdbde9cdcdb8a4c08b60d7ef3af211fa9e0 Mon Sep 17 00:00:00 2001 From: Hojin Date: Tue, 23 Jan 2024 00:16:12 +0900 Subject: [PATCH 01/68] =?UTF-8?q?Feat:=20=EC=9D=BC=EC=A0=95=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80=ED=95=98=EA=B8=B0=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/trips.ts | 2 +- .../DetailSectionTop/DetailAddSchedule.tsx | 320 +++++++++++++----- .../DetailSectionTop/DetailSectionTop.tsx | 3 +- .../DetailSectionTop/DetailToursRating.tsx | 1 - src/components/Plan/PlanItemBox.tsx | 18 +- src/components/Plan/PlanMoveItem.tsx | 6 +- src/components/Tours/ToursCategory.tsx | 2 +- src/components/common/accordion/Accordion.tsx | 30 +- src/components/common/icons/Icons.tsx | 85 ++++- src/hooks/useGetMyTrips.ts | 3 +- src/hooks/useGetTripsAuthority.ts | 1 - 11 files changed, 348 insertions(+), 123 deletions(-) diff --git a/src/api/trips.ts b/src/api/trips.ts index 0a89bb54..a33f5e38 100644 --- a/src/api/trips.ts +++ b/src/api/trips.ts @@ -21,7 +21,7 @@ export const putTrips = async ( // 여행 상세페이지에서 여정에 여행지 등록 export const postTripsItem = async ( tripId: string, - tourItemId: number, + tourItemId: string, visitDate: string, ) => { const requestBody = { diff --git a/src/components/DetailSectionTop/DetailAddSchedule.tsx b/src/components/DetailSectionTop/DetailAddSchedule.tsx index 57880903..9a25586e 100644 --- a/src/components/DetailSectionTop/DetailAddSchedule.tsx +++ b/src/components/DetailSectionTop/DetailAddSchedule.tsx @@ -1,118 +1,254 @@ import * as Dialog from '@radix-ui/react-dialog'; -import { CalendarIcon } from '@components/common/icons/Icons'; +import { CalendarIcon, GrayCalendarIcon } from '@components/common/icons/Icons'; import Alert from '@components/common/alert/Alert'; import { useNavigate } from 'react-router-dom'; import { PlusIcon } from '@components/common/icons/Icons'; import { useGetMyTrips } from '@hooks/useGetMyTrips'; import { calculateTripDuration } from '@utils/calculateTripDuration'; import { calculateDayAndDate } from '@utils/utils'; +import Accordion from '@components/common/accordion/Accordion'; +import { useState, useEffect } from 'react'; +import { postTripsItem } from '@api/trips'; +import { useParams } from 'react-router-dom'; +import { Swiper, SwiperSlide } from 'swiper/react'; const DetailAddSchedule = () => { - const { myTrips } = useGetMyTrips(); + const token = localStorage.getItem('accessToken'); - const { SmallDayArr } = calculateDayAndDate( - myTrips[0]?.startDate, - myTrips[0]?.endDate, + const navigate = useNavigate(); + const { id: tourItemId } = useParams(); + const { myTrips } = useGetMyTrips(); + const [isOpen, setIsOpen] = useState(false); + const [openAccordion, setOpenAccordion] = useState(''); + const [isProcessing, setIsProcessing] = useState(false); + const [selectedVisitDate, setSelectedVisitDate] = useState( + null, + ); + const [selectedTripId, setSelectedTripId] = useState(null); + const [selectedButton, setSelectedButton] = useState(null); + const initialValue = myTrips.findIndex( + (trip) => trip.tripStatus !== '여행완료', ); - console.log(SmallDayArr); + const handleNavigate = (url: string) => { + navigate(url); + }; - const navigate = useNavigate(); + const handleDateButtonClick = ( + tripId: string | null, + visitDate: string | null, + index: number | null, + ) => { + setSelectedTripId(tripId); + setSelectedVisitDate(visitDate); + setSelectedButton(index); + }; - const handleConfirm = () => { - navigate('/login'); + const handleAccordion = (newValue: string) => { + setOpenAccordion(newValue); + setSelectedButton(null); }; - const handleCreate = () => { - navigate('/create'); + const handlePostTripsItem = async ( + tripId: string, + tourItemId: string, + visitDate: string, + ) => { + if (isProcessing) return; + setIsProcessing(true); + if (tripId && tourItemId && visitDate) { + try { + await postTripsItem(tripId, tourItemId, visitDate); + setIsOpen(false); + } catch (error) { + console.error('요청 실패:', error); + } finally { + setIsProcessing(false); + } + } }; - return ( - - - - + useEffect(() => { + setOpenAccordion(`item-${initialValue}`); + }, [initialValue]); - - + useEffect(() => { + if (!isOpen) { + setOpenAccordion(`item-${initialValue}`); + setSelectedButton(null); + } + }, [isOpen]); - - - - - - - {myTrips.map((trip, index) => { - // 각 여행에 대한 기간을 계산합니다. - const tripDuration = calculateTripDuration( - trip.startDate, - trip.endDate, - ); - - return ( -
-
-
- {`Thumbnail -
-
- {trip.tripName} -
-
- {trip.startDate?.replace(/-/g, '.')} -{' '} - {trip.endDate?.substring(5).replace(/-/g, '.')} ( - {tripDuration}) -
-
-
+ + + + 0 ? 'h-[392px]' : 'h-[276px]' + }`}> +
+
- ); - })} - -
-
-
- Day 1 -
+
-
- - - 일정 추가 시 로그인이 필요합니다. -
- 로그인 하시겠습니까? - - } - onConfirm={handleConfirm}> -
- -
-
-
-
- + {myTrips.length > 0 ? ( + + {myTrips.map((trip, index) => { + if (trip.tripStatus !== '여행완료') { + const tripDuration = calculateTripDuration( + trip.startDate, + trip.endDate, + ); + const { SmallDayArr, DateArr } = calculateDayAndDate( + trip.startDate, + trip.endDate, + ); + return ( + <> + +
+
+ {`Thumbnail +
+
+ {trip.tripName} +
+
+ {trip.startDate?.replace(/-/g, '.')} -{' '} + {trip.endDate + ?.substring(5) + .replace(/-/g, '.')}{' '} + {tripDuration === '0박 1일' + ? '' + : `(${tripDuration})`} +
+
+
+
+
+ } + content={ +
+ + {SmallDayArr.map((day, index) => ( + + + + ))} + +
+ } + /> + + ); + } + })} + + ) : ( + +
+ +

+ 등록된 여행이 없습니다. +

+
+
+ )} + {myTrips.length > 0 ? ( +
+ +
+ ) : ( + '' + )} + + + + ) : ( + + 새로운 여행 생성 시 로그인이 필요합니다. +
+ 로그인 하시겠습니까? + + } + onConfirm={() => handleNavigate('/login')}> + +
+ )} + ); }; diff --git a/src/components/DetailSectionTop/DetailSectionTop.tsx b/src/components/DetailSectionTop/DetailSectionTop.tsx index b6283042..55a69ea9 100644 --- a/src/components/DetailSectionTop/DetailSectionTop.tsx +++ b/src/components/DetailSectionTop/DetailSectionTop.tsx @@ -1,15 +1,14 @@ // import { useEffect, useState } from 'react'; import { useQuery } from '@tanstack/react-query'; import { useParams } from 'react-router-dom'; - import { getDetailTours, getToursReviews } from '@api/tours'; - import { DetailToursButtons, DetailToursInfo, DetailToursMap, DetailToursRating, } from '.'; +import { useGetMyTrips } from '@hooks/useGetMyTrips'; export default function DetailSectionTop() { const params = useParams(); diff --git a/src/components/DetailSectionTop/DetailToursRating.tsx b/src/components/DetailSectionTop/DetailToursRating.tsx index 2be49e9c..d92303d2 100644 --- a/src/components/DetailSectionTop/DetailToursRating.tsx +++ b/src/components/DetailSectionTop/DetailToursRating.tsx @@ -67,7 +67,6 @@ export default function DetailToursRating({ ); })} -

({reviewTotalCount}) diff --git a/src/components/Plan/PlanItemBox.tsx b/src/components/Plan/PlanItemBox.tsx index 3244d0cc..4a4ee0c9 100644 --- a/src/components/Plan/PlanItemBox.tsx +++ b/src/components/Plan/PlanItemBox.tsx @@ -68,17 +68,23 @@ const PlanItemBox = ({

-
+
img
-
+
{item.name.length > 19 ? item.name.slice(0, 19) + '...' : item.name} +
+
+ {item.category} +
+
+ {item.price.toLocaleString()} 원 {tripAuthority == 'WRITE' && ( - + } content={ @@ -118,12 +124,6 @@ const PlanItemBox = ({ /> )}
-
- {item.category} -
-
- {item.price.toLocaleString()} 원 -
{index < itemLength - 1 && diff --git a/src/components/Plan/PlanMoveItem.tsx b/src/components/Plan/PlanMoveItem.tsx index 0daa5b5f..a53392f2 100644 --- a/src/components/Plan/PlanMoveItem.tsx +++ b/src/components/Plan/PlanMoveItem.tsx @@ -85,7 +85,7 @@ const PlanMoveItem: React.FC = ({ - +
@@ -94,8 +94,8 @@ const PlanMoveItem: React.FC = ({ 날짜 이동

-
-
+
+
{day.map((day, index) => (
- // )}
{member.nickname}
@@ -108,7 +106,6 @@ const TripInfo = () => { }>
- // )}
))} From 21775c6bbe87e8949b681d83faf47424e0cb9e1c Mon Sep 17 00:00:00 2001 From: Hojin Date: Tue, 23 Jan 2024 12:18:35 +0900 Subject: [PATCH 08/68] =?UTF-8?q?Fix:=20=EB=B2=84=ED=8A=BC=20=ED=81=AC?= =?UTF-8?q?=EA=B8=B0=20=EC=88=98=EC=A0=95,=20=EC=97=AC=EC=A0=95=EC=83=81?= =?UTF-8?q?=EC=84=B8=20=EA=B0=80=EB=A1=9C=EC=8A=A4=ED=81=AC=EB=A1=A4=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Plan/PlanItem.tsx | 2 +- src/components/Trip/TripRealtimeMember.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/Plan/PlanItem.tsx b/src/components/Plan/PlanItem.tsx index 1de95e72..56def8f7 100644 --- a/src/components/Plan/PlanItem.tsx +++ b/src/components/Plan/PlanItem.tsx @@ -128,7 +128,7 @@ const PlanItem: React.FC = ({ date, day }) => {
navigate('./place')} - className="h-[40px] w-full"> + className="h-[56px] w-full">
장소 추가하기
diff --git a/src/components/Trip/TripRealtimeMember.tsx b/src/components/Trip/TripRealtimeMember.tsx index 5dd0fd86..c57afe5a 100644 --- a/src/components/Trip/TripRealtimeMember.tsx +++ b/src/components/Trip/TripRealtimeMember.tsx @@ -15,7 +15,7 @@ const TripRealtimeMember = () => { slidesPerView={5} navigation={true} modules={[Navigation]} - className="flex w-[375px] items-center justify-center"> + className="w-[100vw]items-center flex max-w-[375px] justify-center"> {tripMemberData?.tripMembers?.map((member) => { const isConnected = member?.connected; const thumbnailUrl = member?.thumbnailUrl; From 40772706ef62bd3555edc97aaef2ee2d05f2de97 Mon Sep 17 00:00:00 2001 From: jisu Seo Date: Tue, 23 Jan 2024 12:23:41 +0900 Subject: [PATCH 09/68] =?UTF-8?q?Refactor:=20=EC=9C=A0=EC=A0=80=20?= =?UTF-8?q?=EC=A0=95=EB=B3=B4=20=EC=A1=B0=ED=9A=8C=20=EC=9C=84=EC=B9=98=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/router/mainRouter.tsx | 2 -- src/router/routerLayout.tsx | 3 +++ 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/router/mainRouter.tsx b/src/router/mainRouter.tsx index 1cbe518c..dd309613 100644 --- a/src/router/mainRouter.tsx +++ b/src/router/mainRouter.tsx @@ -15,12 +15,10 @@ import { EditUserSurvey, Mypage, } from '@pages/mypage'; -import useGetUserInfo from '@hooks/useGetUserInfo'; import MainLayout from './routerLayout'; import { CreateTrip } from '@pages/create/createTrip.page'; const MainRouter = () => { - useGetUserInfo(); return ( <> diff --git a/src/router/routerLayout.tsx b/src/router/routerLayout.tsx index 75d0006f..7a357148 100644 --- a/src/router/routerLayout.tsx +++ b/src/router/routerLayout.tsx @@ -3,6 +3,7 @@ import { Outlet, useLocation } from 'react-router-dom'; import { Nav } from '@components/common/nav'; import { InputComment } from '@components/common/nav'; import '../index.css'; +import useGetUserInfo from '@hooks/useGetUserInfo'; const MainLayout = () => { const location = useLocation(); @@ -23,6 +24,8 @@ const MainLayout = () => { location.pathname.includes(path), ); + useGetUserInfo(); + return (
From d5de300003f9e5c9f60db116285b65c6e2e77bcb Mon Sep 17 00:00:00 2001 From: sue Date: Tue, 23 Jan 2024 12:42:31 +0900 Subject: [PATCH 10/68] =?UTF-8?q?Design:=20=EC=97=AC=EC=A0=95=20=EC=88=98?= =?UTF-8?q?=EC=A0=95=20=ED=8E=98=EC=9D=B4=EC=A7=80=20QA=20=EB=B0=98?= =?UTF-8?q?=EC=98=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/trip/tripEdit.page.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pages/trip/tripEdit.page.tsx b/src/pages/trip/tripEdit.page.tsx index 50d6bc51..d9750bf9 100644 --- a/src/pages/trip/tripEdit.page.tsx +++ b/src/pages/trip/tripEdit.page.tsx @@ -106,7 +106,7 @@ const TripEdit = () => { ); } return ( -
+
{ @@ -119,7 +119,7 @@ const TripEdit = () => { { @@ -166,7 +166,7 @@ const TripEdit = () => {
{formattedTripDate}
-
+
완료
From 06d1aa17592299ee8188cc72d297546ba759a43d Mon Sep 17 00:00:00 2001 From: sue Date: Tue, 23 Jan 2024 12:57:27 +0900 Subject: [PATCH 11/68] =?UTF-8?q?Design:=20=EC=97=AC=ED=96=89=20=EC=95=84?= =?UTF-8?q?=EC=9D=B4=ED=85=9C=20input=20width=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Plan/PlanItemBox.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/Plan/PlanItemBox.tsx b/src/components/Plan/PlanItemBox.tsx index 38bdd399..7d269110 100644 --- a/src/components/Plan/PlanItemBox.tsx +++ b/src/components/Plan/PlanItemBox.tsx @@ -98,11 +98,11 @@ const PlanItemBox = ({ } content={ -
+
setInputPrice(e.target.value)} From 696ec0bcf428c8ecca6f16f5d382848e7e27dadc Mon Sep 17 00:00:00 2001 From: Shim Jeong ah <35457850+joanShim@users.noreply.github.com> Date: Tue, 23 Jan 2024 13:02:21 +0900 Subject: [PATCH 12/68] =?UTF-8?q?Design:=20=EB=B2=84=ED=8A=BC=20=EB=86=92?= =?UTF-8?q?=EC=9D=B4=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/common/button/Button.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/common/button/Button.tsx b/src/components/common/button/Button.tsx index a3ca8c3b..211bfa70 100644 --- a/src/components/common/button/Button.tsx +++ b/src/components/common/button/Button.tsx @@ -29,7 +29,7 @@ export const ButtonPrimary: React.FC = ({ return ( From 3e9ec46ef885c44af894c42bde6b09abc0f77a60 Mon Sep 17 00:00:00 2001 From: Shim Jeong ah <35457850+joanShim@users.noreply.github.com> Date: Tue, 23 Jan 2024 13:06:25 +0900 Subject: [PATCH 13/68] =?UTF-8?q?Fix:=20=EC=88=98=EC=A0=95=ED=8E=98?= =?UTF-8?q?=EC=9D=B4=EC=A7=80=20=EC=9D=B8=ED=92=8B=20=ED=81=B4=EB=A6=AC?= =?UTF-8?q?=EC=96=B4=EB=B2=84=ED=8A=BC=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/trip/tripEdit.page.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/trip/tripEdit.page.tsx b/src/pages/trip/tripEdit.page.tsx index 50d6bc51..6764fd66 100644 --- a/src/pages/trip/tripEdit.page.tsx +++ b/src/pages/trip/tripEdit.page.tsx @@ -119,7 +119,7 @@ const TripEdit = () => { { From a278641e88fdd88fa7c3cf9cb464d270df3288a9 Mon Sep 17 00:00:00 2001 From: NohWookJin Date: Tue, 23 Jan 2024 15:37:30 +0900 Subject: [PATCH 14/68] =?UTF-8?q?feat:=20=ED=88=AC=ED=91=9C=20=EC=B7=A8?= =?UTF-8?q?=EC=86=8C=20=EA=B8=B0=EB=8A=A5=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../LikedToursLists/LikedToursListItem.tsx | 28 +++++++++++-------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/src/components/Trip/LikedToursLists/LikedToursListItem.tsx b/src/components/Trip/LikedToursLists/LikedToursListItem.tsx index 7260e8fa..9f7e72a5 100644 --- a/src/components/Trip/LikedToursLists/LikedToursListItem.tsx +++ b/src/components/Trip/LikedToursLists/LikedToursListItem.tsx @@ -1,3 +1,7 @@ +import { useState } from 'react'; +import { useNavigate } from 'react-router-dom'; +import { useMutation, useQueryClient } from '@tanstack/react-query'; +import { postTripsLikeHate } from '@api/trips'; import { ThumbsUp, ThumbsDown, @@ -5,10 +9,6 @@ import { ClickThumbsDown, StarIcon, } from '@components/common/icons/Icons'; -import { useMutation, useQueryClient } from '@tanstack/react-query'; -import { postTripsLikeHate } from '@api/trips'; -import { useNavigate } from 'react-router-dom'; -import { useState } from 'react'; interface LikedToursListItemProps { ourTripList: ourTripType; @@ -34,11 +34,11 @@ const LikedToursListItem: React.FC = ({ const navigate = useNavigate(); const queryClient = useQueryClient(); const [thumbsState, setThumbsState] = useState({ - prefer: false, - notPrefer: false, + prefer: prefer, + notPrefer: notPrefer, }); - const { mutate: thumbsUpMutate } = useMutation({ + const { mutate: thumbsMutate } = useMutation({ mutationFn: () => postTripsLikeHate( selectedTripId, @@ -54,14 +54,20 @@ const LikedToursListItem: React.FC = ({ const onClickThumbsUpButton = (e: React.MouseEvent) => { e.stopPropagation(); - setThumbsState({ prefer: true, notPrefer: false }); - thumbsUpMutate(); + setThumbsState((prev) => ({ + prefer: !prev.prefer, + notPrefer: false, + })); + thumbsMutate(); }; const onClickThumbsDownButton = (e: React.MouseEvent) => { e.stopPropagation(); - setThumbsState({ prefer: false, notPrefer: true }); - thumbsUpMutate(); + setThumbsState((prev) => ({ + prefer: false, + notPrefer: !prev.notPrefer, + })); + thumbsMutate(); }; return ( From b638a605ad2ec82cb4fc811793faf685905c7076 Mon Sep 17 00:00:00 2001 From: Hojin Date: Tue, 23 Jan 2024 17:28:36 +0900 Subject: [PATCH 15/68] =?UTF-8?q?Fix:=20=EC=8A=AC=EB=9D=BC=EC=9D=B4?= =?UTF-8?q?=EB=8D=94=20=ED=81=AC=EA=B8=B0=EA=B3=A0=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/@types/service.ts | 14 +++++++++++++ src/@types/socket.types.ts | 20 ++++++++++++++++++ src/api/socket.ts | 21 +++++++++++++++++++ .../DetailSectionTop/DetailAddSchedule.tsx | 2 +- src/components/Plan/PlanSectionTop.tsx | 19 +++++++++++++++++ src/hooks/useSocket.ts | 12 +++++++++++ 6 files changed, 87 insertions(+), 1 deletion(-) diff --git a/src/@types/service.ts b/src/@types/service.ts index bae375b2..b0fe82ae 100644 --- a/src/@types/service.ts +++ b/src/@types/service.ts @@ -97,12 +97,26 @@ export type subBudgetRes = { } | null; }; +export type subCursorRes = { + status: number; + message: string; + data: { + tripId: string; + visitDate: string; + memberId: number; + name: string; + x: number; + y: number; + } | null; +}; + export type SocketContextType = { tripInfo: subInfoRes | null; tripItem: subItemRes | null; tripPath: subPathRes | null; tripMember: subMemberRes | null; tripBudget: subBudgetRes | null; + tripCursor: subCursorRes | null; tripId: string; callBackPub: (callback: () => void) => void; }; diff --git a/src/@types/socket.types.ts b/src/@types/socket.types.ts index a8167cc8..227a7467 100644 --- a/src/@types/socket.types.ts +++ b/src/@types/socket.types.ts @@ -82,6 +82,19 @@ type subBudgetMessage = (response: { }; }) => void; +type subCursorMessage = (response: { + status: number; + message: string; + data: { + tripId: string; + visitDate: string; + memberId: number; + name: string; + x: number; + y: number; + }; +}) => void; + interface pubInfo { startDate: string; endDate: string; @@ -138,3 +151,10 @@ interface pubGetPathAndItems { interface pubUpdateBudget { budget: number; } + +interface pubCursor { + token: string; + visitDate: string; + x: number; + y: number; +} diff --git a/src/api/socket.ts b/src/api/socket.ts index c5c437b4..93bc09d3 100644 --- a/src/api/socket.ts +++ b/src/api/socket.ts @@ -61,6 +61,18 @@ export const subBudget = ( }); }; +// 커서 공유 +export const subCursor = ( + tripId: string, + visitDate: string, + subCursorMessage: subCursorMessage, +) => { + socketClient.subscribe(`/sub/${tripId}/cursor/${visitDate}`, (message) => { + const res = JSON.parse(message.body); + subCursorMessage(res); + }); +}; + // 소켓 전송 // 여정 기본 정보 변경 이벤트 발생시 export const pubInfo = (pubInfo: pubInfo, tripId: string) => { @@ -187,3 +199,12 @@ export const pubUpdateBudget = ( body: JSON.stringify(pubUpdateBudget), }); }; + +// 커서공유 +export const pubCursor = (pubCursor: pubCursor, tripId: string) => { + socketClient.publish({ + destination: `/pub/trips/${tripId}/cursor`, + body: JSON.stringify(pubCursor), + }); + console.log(pubCursor); +}; diff --git a/src/components/DetailSectionTop/DetailAddSchedule.tsx b/src/components/DetailSectionTop/DetailAddSchedule.tsx index 22f35eb5..fbbc8361 100644 --- a/src/components/DetailSectionTop/DetailAddSchedule.tsx +++ b/src/components/DetailSectionTop/DetailAddSchedule.tsx @@ -165,7 +165,7 @@ const DetailAddSchedule = () => { key={index} className="flex w-[99px] items-start"> +
+ ); +}; + +export default ScrollTopButton; diff --git a/src/components/Review/MyReview.tsx b/src/components/Review/MyReview.tsx index 1db45243..ed33f095 100644 --- a/src/components/Review/MyReview.tsx +++ b/src/components/Review/MyReview.tsx @@ -21,6 +21,7 @@ import EditDelete from '@components/common/modal/children/EditDelete'; import MyAlert from '@components/common/modal/children/MyAlert'; import { alertTypeState } from '@recoil/modal'; import { PenIcon } from '@components/common/icons/Icons'; +import ScrollTopButton from '@components/Plan/ScrollTopButton'; export default function MyReview() { const [reviewDataLength, setReviewDataLength] = useState(0); @@ -163,6 +164,7 @@ export default function MyReview() { )} + ); } diff --git a/src/components/Share/IsEditableModal.tsx b/src/components/Share/IsEditableModal.tsx index eae7a09c..f3f6a832 100644 --- a/src/components/Share/IsEditableModal.tsx +++ b/src/components/Share/IsEditableModal.tsx @@ -22,8 +22,8 @@ const IsEditableModal = ({ isEditable, setIsEditable }: Props) => { return ( - - + + 편집 참여 코드를 입력하시면
diff --git a/src/components/Trip/EditCodeModal.tsx b/src/components/Trip/EditCodeModal.tsx index d486c0ce..8d674d6e 100644 --- a/src/components/Trip/EditCodeModal.tsx +++ b/src/components/Trip/EditCodeModal.tsx @@ -76,8 +76,8 @@ const EditCodeModal = () => { {isEditModal && ( - - + + 나의 여정 diff --git a/src/components/Trip/LikedToursList.tsx b/src/components/Trip/LikedToursList.tsx index 5587077e..c2b4e969 100644 --- a/src/components/Trip/LikedToursList.tsx +++ b/src/components/Trip/LikedToursList.tsx @@ -78,7 +78,7 @@ export const LikedToursList = () => { )} {/* 우리의 관심 여행지 추가 버튼 => 검색 라우터 이동 */} -
+
From c7afd01a373292e70bdb5b1813c2f421a42be773 Mon Sep 17 00:00:00 2001 From: sue Date: Wed, 24 Jan 2024 11:12:46 +0900 Subject: [PATCH 19/68] =?UTF-8?q?Fix:=20=EC=97=AC=EC=A0=95=20=EC=88=98?= =?UTF-8?q?=EC=A0=95=ED=8E=98=EC=9D=B4=EC=A7=80=20nav=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/router/routerLayout.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/router/routerLayout.tsx b/src/router/routerLayout.tsx index 9499a033..bb3f24ef 100644 --- a/src/router/routerLayout.tsx +++ b/src/router/routerLayout.tsx @@ -20,6 +20,7 @@ const MainLayout = () => { '/plan', '/create', '/add', + '/edit', ]; const showNav = !hideNavPaths.some((path) => location.pathname.includes(path), From 31f6644103b1a9ea2f5fdf6d7444c510339575ca Mon Sep 17 00:00:00 2001 From: sue Date: Wed, 24 Jan 2024 11:24:23 +0900 Subject: [PATCH 20/68] =?UTF-8?q?Feat:=20=EB=A9=94=EC=9D=B8=ED=8E=98?= =?UTF-8?q?=EC=9D=B4=EC=A7=80=20=EC=8A=A4=ED=81=AC=EB=A1=A4=20=EC=9C=84?= =?UTF-8?q?=EC=B9=98=20=EC=A1=B0=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Tours/ToursList.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/Tours/ToursList.tsx b/src/components/Tours/ToursList.tsx index 45888808..fd0575ed 100644 --- a/src/components/Tours/ToursList.tsx +++ b/src/components/Tours/ToursList.tsx @@ -46,6 +46,7 @@ const ToursList = ({ selectedRegion }: ToursListProps) => { pageStart={0} loadMore={() => fetchNextPage()} hasMore={hasNextPage} + threshold={500} loader={
From a1793b45c9c70d0e39125a33b80e0c230d97e5d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=96=B4=EC=8A=B9=EC=A4=80?= Date: Wed, 24 Jan 2024 13:24:22 +0900 Subject: [PATCH 21/68] =?UTF-8?q?Refactor:=20any=20=ED=83=80=EC=9E=85=20?= =?UTF-8?q?=EA=B0=9C=EC=84=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/@types/detail.types.ts | 1 + src/@types/review.types.ts | 28 +++++++--- src/@types/tours.types.ts | 22 ++++++++ src/@types/trips.types.ts | 10 ++++ src/api/review.ts | 2 +- .../DetailSectionBottom/DetailReviews.tsx | 51 ++++++++++--------- .../DetailSectionBottom/ReviewItem.tsx | 25 +-------- .../DetailSectionTop/DetailToursButtons.tsx | 10 ++-- src/components/Review/CommentItem.tsx | 12 +---- src/components/Review/MyReview.tsx | 5 +- src/components/Review/Review.tsx | 4 +- src/components/Review/ReviewComments.tsx | 25 +++++---- src/components/Review/ReviewKeyword.tsx | 8 +-- src/components/Review/ReviewRating.tsx | 2 +- src/components/Trip/TripInfo.tsx | 4 +- src/components/Trip/TripParticipant.tsx | 6 ++- src/components/common/modal/Modal.tsx | 4 +- src/recoil/review.ts | 2 +- 18 files changed, 123 insertions(+), 98 deletions(-) diff --git a/src/@types/detail.types.ts b/src/@types/detail.types.ts index bfb4bca8..71827919 100644 --- a/src/@types/detail.types.ts +++ b/src/@types/detail.types.ts @@ -1,5 +1,6 @@ interface tourDetail { id: number; + contentTypeId: number; title: string; liked: boolean; fullAddress: string; diff --git a/src/@types/review.types.ts b/src/@types/review.types.ts index 851b017b..fe5fcb10 100644 --- a/src/@types/review.types.ts +++ b/src/@types/review.types.ts @@ -1,11 +1,27 @@ -interface ReviewRequest { - tourItemId: number; - rating: number; - keywords: Keyword[]; +export interface Keyword { + keywordId: number; content: string; + type: string; } -interface Keyword { - keywordId: number; +export interface CommentItemProps { + commentId: number; + authorNickname: string; + authorProfileImageUrl: string; + createdTime: string; content: string; + onClick?: () => void; + isAuthor: boolean; +} + +export interface MyReviewContent { + reviewId: number; + authorNickname: string; + authorProfileImageUrl: string; + rating: number; + createdTime: string; + content: string; + keywords: Keyword[]; + commentCount: number; + isAuthor?: boolean; } diff --git a/src/@types/tours.types.ts b/src/@types/tours.types.ts index ccd95671..11e862e7 100644 --- a/src/@types/tours.types.ts +++ b/src/@types/tours.types.ts @@ -52,3 +52,25 @@ export interface LikedListType { preferTotalCount: number; notPreferTotalCount: number; } + +export interface ReviewInfoItemProps { + reviewId: number; + authorNickname: string; + authorProfileImageUrl: string; + rating: number; + createdTime: string; + content: string; + keywords: Keyword[]; // keywordId, content, type + commentCount: number; + onClick?: () => void; + tourItemId?: number; + contentTypeId?: number; + canTextOverflow: boolean; + isAuthor?: boolean; +} + +interface Keyword { + keywordId: number; + content: string; + type: string; +} diff --git a/src/@types/trips.types.ts b/src/@types/trips.types.ts index e2ebbb0c..36f92cd8 100644 --- a/src/@types/trips.types.ts +++ b/src/@types/trips.types.ts @@ -51,3 +51,13 @@ interface AuthorityType { tripId: string; }; } +interface TripSurveySetMemberInfo { + memberId: number; + nickname: string; + thumbnail: string; +} + +interface TripMemeberInfo { + nickname: string; + profileImageUrl: string; +} diff --git a/src/api/review.ts b/src/api/review.ts index 9c5e46df..ec7f4f43 100644 --- a/src/api/review.ts +++ b/src/api/review.ts @@ -1,6 +1,6 @@ import client from './client'; import authClient from './authClient'; - +import { ReviewRequest } from '@recoil/review'; // 리뷰 관련 API // 리뷰수정 diff --git a/src/components/DetailSectionBottom/DetailReviews.tsx b/src/components/DetailSectionBottom/DetailReviews.tsx index 8d526846..bde618f1 100644 --- a/src/components/DetailSectionBottom/DetailReviews.tsx +++ b/src/components/DetailSectionBottom/DetailReviews.tsx @@ -26,12 +26,13 @@ import ToastPopUp from '@components/common/toastpopup/ToastPopUp'; import EditDelete from '@components/common/modal/children/EditDelete'; import MyAlert from '@components/common/modal/children/MyAlert'; import { alertTypeState } from '@recoil/modal'; +import { ReviewInfoItemProps } from '@/@types/tours.types'; -interface reviewProps { - reviewData: any; -} - -export default function DetailReviews({ reviewData }: reviewProps) { +export default function DetailReviews({ + reviewData, +}: { + reviewData: tourDetail; +}) { const [reviewDataLength, setReviewDataLength] = useState(0); const { title, contentTypeId } = reviewData; const params = useParams(); @@ -73,7 +74,7 @@ export default function DetailReviews({ reviewData }: reviewProps) { return
데이터를 불러오는 중 오류가 발생했습니다.
; } - const handleReviewClick = (item: any) => { + const handleReviewClick = (item: ReviewInfoItemProps) => { const reviewId = item.reviewId; navigate(`/reviewComment/${reviewId}`, { state: { item, tourItemId } }); }; @@ -155,24 +156,26 @@ export default function DetailReviews({ reviewData }: reviewProps) { { return ( - {group?.data.data.reviewInfos.content.map((item: any) => ( - handleReviewClick(item)} - tourItemId={tourItemId} - contentTypeId={contentTypeId} - canTextOverflow={true} - isAuthor={item.isAuthor} - /> - ))} + {group?.data.data.reviewInfos.content.map( + (item: ReviewInfoItemProps) => ( + handleReviewClick(item)} + tourItemId={tourItemId} + contentTypeId={contentTypeId} + canTextOverflow={true} + isAuthor={item.isAuthor} + /> + ), + )} ); } diff --git a/src/components/DetailSectionBottom/ReviewItem.tsx b/src/components/DetailSectionBottom/ReviewItem.tsx index 57a89c8c..1a2817d9 100644 --- a/src/components/DetailSectionBottom/ReviewItem.tsx +++ b/src/components/DetailSectionBottom/ReviewItem.tsx @@ -21,30 +21,9 @@ import { import { MouseEvent, useState } from 'react'; import { getEmoji } from '@utils/utils'; import { getStarFill } from '@utils/getStarFill'; +import { ReviewInfoItemProps } from '@/@types/tours.types'; -interface Keyword { - keywordId: number; - content: string; - type: string; -} - -interface ItemProps { - reviewId: number; - authorNickname: string; - authorProfileImageUrl: string; - rating: number; - createdTime: any; - content: string; - keywords: Keyword[]; // keywordId, content, type - commentCount: number; - onClick?: () => void; - tourItemId?: number; - contentTypeId?: number; - canTextOverflow: boolean; - isAuthor?: boolean; -} - -const Item: React.FC = (props: ItemProps) => { +const Item: React.FC = (props: ReviewInfoItemProps) => { const { reviewId, authorNickname, diff --git a/src/components/DetailSectionTop/DetailToursButtons.tsx b/src/components/DetailSectionTop/DetailToursButtons.tsx index 8c9e01a6..49de97fb 100644 --- a/src/components/DetailSectionTop/DetailToursButtons.tsx +++ b/src/components/DetailSectionTop/DetailToursButtons.tsx @@ -10,11 +10,11 @@ import { useNavigate, useParams } from 'react-router-dom'; import { useSetRecoilState } from 'recoil'; import { getMember } from '@api/member'; -interface reviewProps { - reviewData: any; -} - -export default function DetailTourButtons({ reviewData }: reviewProps) { +export default function DetailTourButtons({ + reviewData, +}: { + reviewData: tourDetail; +}) { const { title, contentTypeId } = reviewData; const params = useParams(); const tourItemId = Number(params.id); diff --git a/src/components/Review/CommentItem.tsx b/src/components/Review/CommentItem.tsx index 6c1b907e..9b8a8fdd 100644 --- a/src/components/Review/CommentItem.tsx +++ b/src/components/Review/CommentItem.tsx @@ -6,17 +6,9 @@ import { } from '@recoil/modal'; import { commentState, targetCommentIdState } from '@recoil/review'; import { useRecoilState, useSetRecoilState } from 'recoil'; -interface ItemProps { - commentId: number; - authorNickname: string; - authorProfileImageUrl: string; - createdTime: any; - content: string; - onClick?: () => void; - isAuthor: boolean; -} +import { CommentItemProps } from '@/@types/review.types'; -const CommentItem: React.FC = (props: ItemProps) => { +const CommentItem: React.FC = (props: CommentItemProps) => { const { commentId, authorNickname, diff --git a/src/components/Review/MyReview.tsx b/src/components/Review/MyReview.tsx index ed33f095..a34d61ce 100644 --- a/src/components/Review/MyReview.tsx +++ b/src/components/Review/MyReview.tsx @@ -22,6 +22,7 @@ import MyAlert from '@components/common/modal/children/MyAlert'; import { alertTypeState } from '@recoil/modal'; import { PenIcon } from '@components/common/icons/Icons'; import ScrollTopButton from '@components/Plan/ScrollTopButton'; +import { MyReviewContent } from '@/@types/review.types'; export default function MyReview() { const [reviewDataLength, setReviewDataLength] = useState(0); @@ -60,7 +61,7 @@ export default function MyReview() { return
데이터를 불러오는 중 오류가 발생했습니다.
; } - const handleReviewClick = (item: any) => { + const handleReviewClick = (item: MyReviewContent) => { const reviewId = item.reviewId; navigate(`/reviewComment/${reviewId}`, { state: { item } }); }; @@ -134,7 +135,7 @@ export default function MyReview() { { return ( - {group?.data.data.content.map((item: any) => { + {group?.data.data.content.map((item: MyReviewContent) => { item.isAuthor = true; return ( - {group?.data.data.comments.content.map((item: any) => ( - - ))} + {group?.data.data.comments.content.map( + (item: CommentItemProps) => ( + + ), + )} ); } diff --git a/src/components/Review/ReviewKeyword.tsx b/src/components/Review/ReviewKeyword.tsx index 1d9d7ad3..1b33a700 100644 --- a/src/components/Review/ReviewKeyword.tsx +++ b/src/components/Review/ReviewKeyword.tsx @@ -4,11 +4,7 @@ import { getReviewKeywords } from '@api/review'; import { useQuery } from '@tanstack/react-query'; import { useRecoilState } from 'recoil'; import { keywordsState } from '@recoil/review'; - -interface Keyword { - keywordId: number; - content: string; -} +import { Keyword } from '@/@types/review.types'; export default function ReviewKeyword() { const location = useLocation(); @@ -59,7 +55,7 @@ export default function ReviewKeyword() {
어떤 점이 좋았나요?
{reviewKeywords?.data?.data?.keywords?.map( - (keyword: any, index: number) => { + (keyword: Keyword, index: number) => { const row = Math.floor(index / columns) + 1; const col = (index % columns) + 1; diff --git a/src/components/Review/ReviewRating.tsx b/src/components/Review/ReviewRating.tsx index 7ec0baed..f4f5ffb1 100644 --- a/src/components/Review/ReviewRating.tsx +++ b/src/components/Review/ReviewRating.tsx @@ -13,7 +13,7 @@ const ReviewRating = () => { const handleStarClick = (index: number) => { const newRating = index + 1; - setRating((prevRating: any) => { + setRating((prevRating: number) => { const updatedIsHalfClicked = prevRating === newRating ? !isHalfClicked : false; setIsHalfClicked(updatedIsHalfClicked); diff --git a/src/components/Trip/TripInfo.tsx b/src/components/Trip/TripInfo.tsx index 7e753878..72b02f76 100644 --- a/src/components/Trip/TripInfo.tsx +++ b/src/components/Trip/TripInfo.tsx @@ -26,7 +26,7 @@ const ShareList = () => { <>
- {members.map((member: any, index: number) => { + {members.map((member: TripMemeberInfo, index: number) => { return (
{
- {members?.map((member: any, index: number) => ( + {members?.map((member: TripMemeberInfo, index: number) => (
{member.profileImageUrl && member.profileImageUrl !== 'http://asiduheimage.jpg' ? ( diff --git a/src/components/Trip/TripParticipant.tsx b/src/components/Trip/TripParticipant.tsx index d114a6d5..28938a6f 100644 --- a/src/components/Trip/TripParticipant.tsx +++ b/src/components/Trip/TripParticipant.tsx @@ -7,9 +7,11 @@ interface ParticipantStatusProps { status: string; } -const ParticipantList: React.FC<{ infos: any[] }> = ({ infos }) => ( +const ParticipantList: React.FC<{ infos: TripSurveySetMemberInfo[] }> = ({ + infos, +}) => (
- {infos.map((info: any) => ( + {infos.map((info: TripSurveySetMemberInfo) => (
diff --git a/src/components/common/modal/Modal.tsx b/src/components/common/modal/Modal.tsx index 8296f7bc..340f72e7 100644 --- a/src/components/common/modal/Modal.tsx +++ b/src/components/common/modal/Modal.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import React, { ReactNode } from 'react'; import Modal from 'react-modal'; import { modalChildrenState } from '@recoil/modal'; import { useRecoilValue } from 'recoil'; @@ -6,7 +6,7 @@ import { useRecoilValue } from 'recoil'; interface ModalProps { isOpen: boolean; closeModal: () => void; - children: any; + children: ReactNode; } const ModalComponent: React.FC = ({ diff --git a/src/recoil/review.ts b/src/recoil/review.ts index 1c9753e1..4c7b0156 100644 --- a/src/recoil/review.ts +++ b/src/recoil/review.ts @@ -1,6 +1,6 @@ import { atom } from 'recoil'; -interface ReviewRequest { +export interface ReviewRequest { tourItemId: number; rating: number; keywords: Keyword[]; From 07a0db4b6384496e195f45f5c387a1cdd404930e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=96=B4=EC=8A=B9=EC=A4=80?= Date: Wed, 24 Jan 2024 15:19:32 +0900 Subject: [PATCH 22/68] =?UTF-8?q?Fix:=20=EC=9B=8C=EB=94=A9=20=EC=A0=95?= =?UTF-8?q?=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/DetailSectionBottom/DetailReviews.tsx | 2 +- src/components/Review/MyReview.tsx | 2 +- src/components/Review/ReviewButton.tsx | 6 +----- src/components/Review/ReviewComments.tsx | 4 ++-- src/components/Trip/TripPreference.tsx | 8 ++++---- src/components/Trip/TripRealtimeMember.tsx | 3 +-- src/components/common/toastpopup/ToastPopUp.tsx | 2 +- 7 files changed, 11 insertions(+), 16 deletions(-) diff --git a/src/components/DetailSectionBottom/DetailReviews.tsx b/src/components/DetailSectionBottom/DetailReviews.tsx index bde618f1..93e1e310 100644 --- a/src/components/DetailSectionBottom/DetailReviews.tsx +++ b/src/components/DetailSectionBottom/DetailReviews.tsx @@ -190,7 +190,7 @@ export default function DetailReviews({ {modalChildren === 'MyAlert' && alertType === 'LoginReview' && ( )} diff --git a/src/components/Review/MyReview.tsx b/src/components/Review/MyReview.tsx index a34d61ce..7bb3cfb5 100644 --- a/src/components/Review/MyReview.tsx +++ b/src/components/Review/MyReview.tsx @@ -114,7 +114,7 @@ export default function MyReview() {
- 작성한 리뷰가 없습니다 + 내가 쓴 리뷰가 없어요
다녀온 여행지의 리뷰를 남겨보세요! diff --git a/src/components/Review/ReviewButton.tsx b/src/components/Review/ReviewButton.tsx index 11885da3..634dd2c5 100644 --- a/src/components/Review/ReviewButton.tsx +++ b/src/components/Review/ReviewButton.tsx @@ -3,11 +3,7 @@ import { ratingState } from '@recoil/review'; import { useEffect, useState } from 'react'; import { useRecoilValue } from 'recoil'; -interface ButtonProps { - onClick: () => void; -} - -const ReviewButton = (props: ButtonProps) => { +const ReviewButton = (props: { onClick: () => void }) => { const { onClick } = props; const rating = useRecoilValue(ratingState); const [isRatingValid, setIsRatingValid] = useState(false); diff --git a/src/components/Review/ReviewComments.tsx b/src/components/Review/ReviewComments.tsx index 485147bc..965314d2 100644 --- a/src/components/Review/ReviewComments.tsx +++ b/src/components/Review/ReviewComments.tsx @@ -89,8 +89,8 @@ export default function ReviewComments() {
{commentDataLength == 0 && ( -
-
댓글이 없습니다.
+
+
아직 댓글이 없어요.
첫 댓글을 작성해보세요!
)} diff --git a/src/components/Trip/TripPreference.tsx b/src/components/Trip/TripPreference.tsx index bcc94302..16749894 100644 --- a/src/components/Trip/TripPreference.tsx +++ b/src/components/Trip/TripPreference.tsx @@ -14,19 +14,19 @@ import { useGetTripsAuthority } from '@hooks/useGetTripsAuthority'; import { useNavigate } from 'react-router-dom'; import { getMember } from '@api/member'; -interface RatioBarParams { +type RatioBarParams = { value: number; total: number; color: string; label1: string; label2: string; -} +}; -interface PercentageParams { +type PercentageParams = { value: number; total: number; color: string; -} +}; const TripPreferenceButton: React.FC = () => { const { tripAuthority } = useGetTripsAuthority(); diff --git a/src/components/Trip/TripRealtimeMember.tsx b/src/components/Trip/TripRealtimeMember.tsx index c57afe5a..db5a77ea 100644 --- a/src/components/Trip/TripRealtimeMember.tsx +++ b/src/components/Trip/TripRealtimeMember.tsx @@ -6,7 +6,6 @@ import { Navigation } from 'swiper/modules'; const TripRealtimeMember = () => { const { tripMember } = useContext(socketContext); - const tripMemberData = tripMember?.data; return ( @@ -15,7 +14,7 @@ const TripRealtimeMember = () => { slidesPerView={5} navigation={true} modules={[Navigation]} - className="w-[100vw]items-center flex max-w-[375px] justify-center"> + className="flex w-[100vw] max-w-[375px] items-center justify-center"> {tripMemberData?.tripMembers?.map((member) => { const isConnected = member?.connected; const thumbnailUrl = member?.thumbnailUrl; diff --git a/src/components/common/toastpopup/ToastPopUp.tsx b/src/components/common/toastpopup/ToastPopUp.tsx index 4dbf53ca..004ebacd 100644 --- a/src/components/common/toastpopup/ToastPopUp.tsx +++ b/src/components/common/toastpopup/ToastPopUp.tsx @@ -51,7 +51,7 @@ const ToastPopUp: React.FC = ({ noun, verb }) => {

{noun} - {particle} {verb}되었습니다. + {particle} {verb}되었어요.

); From a3865013c0eccec2b3886d095b7b8275504e7b6a Mon Sep 17 00:00:00 2001 From: jisu Seo Date: Wed, 24 Jan 2024 15:56:08 +0900 Subject: [PATCH 23/68] =?UTF-8?q?Style:=20=EC=9B=8C=EB=94=A9=20=EC=A0=95?= =?UTF-8?q?=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Mypage/LogoutButton.tsx | 2 +- src/components/Mypage/MypageItem.tsx | 4 ++-- src/pages/signup/signupSuccess.page.tsx | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/components/Mypage/LogoutButton.tsx b/src/components/Mypage/LogoutButton.tsx index 0e6666d7..c66aa282 100644 --- a/src/components/Mypage/LogoutButton.tsx +++ b/src/components/Mypage/LogoutButton.tsx @@ -34,7 +34,7 @@ const LogoutButton = () => { return (

- 환영합니다! + 만나서 반가워요!
- 가입이 완료되었습니다. + 가입이 완료되었어요.

- 위플랜플랜스 회원이 되신 것을 환영합니다. + 위플랜플랜스에서 여행 계획을 세워볼까요?
- 여행 취향과 프로필을 등록해주세요! + 여행 취향과 프로필을 등록하면 도움이 될 거예요.
From c5b93a4864b36f0df19471d9b89b998788bd4e08 Mon Sep 17 00:00:00 2001 From: Hojin Date: Wed, 24 Jan 2024 16:49:09 +0900 Subject: [PATCH 24/68] =?UTF-8?q?feat:=20=EC=BB=A4=EC=84=9C=EA=B3=B5?= =?UTF-8?q?=EC=9C=A0=20=ED=85=8C=EC=8A=A4=ED=8A=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 1 + pnpm-lock.yaml | 11 +++ src/api/socket.ts | 3 +- src/components/Plan/PlanCursor.tsx | 94 +++++++++++++++++++++++++ src/components/Plan/PlanItem.tsx | 6 +- src/components/Plan/PlanOtherCursor.tsx | 63 +++++++++++++++++ src/components/Plan/PlanSectionTop.tsx | 19 ----- src/hooks/useSocket.ts | 27 ++++--- 8 files changed, 195 insertions(+), 29 deletions(-) create mode 100644 src/components/Plan/PlanCursor.tsx create mode 100644 src/components/Plan/PlanOtherCursor.tsx diff --git a/package.json b/package.json index 10b3be84..611f6d99 100644 --- a/package.json +++ b/package.json @@ -34,6 +34,7 @@ "react-beautiful-dnd": "^13.1.1", "react-dom": "^18.2.0", "react-hook-form": "^7.49.2", + "react-icons": "^5.0.1", "react-infinite-scroller": "^1.2.6", "react-kakao-maps-sdk": "^1.1.24", "react-modal": "^3.16.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 0720f243..71bfd5fe 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -77,6 +77,9 @@ dependencies: react-hook-form: specifier: ^7.49.2 version: 7.49.3(react@18.2.0) + react-icons: + specifier: ^5.0.1 + version: 5.0.1(react@18.2.0) react-infinite-scroller: specifier: ^1.2.6 version: 1.2.6(react@18.2.0) @@ -5145,6 +5148,14 @@ packages: react: 18.2.0 dev: false + /react-icons@5.0.1(react@18.2.0): + resolution: {integrity: sha512-WqLZJ4bLzlhmsvme6iFdgO8gfZP17rfjYEJ2m9RsZjZ+cc4k1hTzknEz63YS1MeT50kVzoa1Nz36f4BEx+Wigw==} + peerDependencies: + react: '*' + dependencies: + react: 18.2.0 + dev: false + /react-infinite-scroller@1.2.6(react@18.2.0): resolution: {integrity: sha512-mGdMyOD00YArJ1S1F3TVU9y4fGSfVVl6p5gh/Vt4u99CJOptfVu/q5V/Wlle72TMgYlBwIhbxK5wF0C/R33PXQ==} peerDependencies: diff --git a/src/api/socket.ts b/src/api/socket.ts index 93bc09d3..ff4101db 100644 --- a/src/api/socket.ts +++ b/src/api/socket.ts @@ -154,6 +154,7 @@ export const pubConnectMember = (pubMember: pubMember, tripId: string) => { destination: `/pub/trips/${tripId}/connectMember`, body: JSON.stringify(pubMember), }); + console.log('입장발생'); }; // 멤버 여정 페이지 퇴장 이벤트 발생시 @@ -162,6 +163,7 @@ export const pubDisconnectMember = (pubMember: pubMember, tripId: string) => { destination: `/pub/trips/${tripId}/disconnectMember`, body: JSON.stringify(pubMember), }); + console.log('퇴장발생'); }; // 여정 편집 페이지 입장 이벤트 발생시(모든 sub 다받음) @@ -206,5 +208,4 @@ export const pubCursor = (pubCursor: pubCursor, tripId: string) => { destination: `/pub/trips/${tripId}/cursor`, body: JSON.stringify(pubCursor), }); - console.log(pubCursor); }; diff --git a/src/components/Plan/PlanCursor.tsx b/src/components/Plan/PlanCursor.tsx new file mode 100644 index 00000000..48d10a01 --- /dev/null +++ b/src/components/Plan/PlanCursor.tsx @@ -0,0 +1,94 @@ +import { useEffect, useState, useContext } from 'react'; +import { BsFillCursorFill } from 'react-icons/bs'; +import { pubCursor } from '@api/socket'; +import { socketContext } from '@hooks/useSocket'; +import { useGetTripsAuthority } from '@hooks/useGetTripsAuthority'; + +type TripCursorData = { + memberId: number; + x: number; + y: number; + name: string; +}; + +type PlanCursorProps = { + date: string; +}; + +const PlanCursor = ({ date }: PlanCursorProps) => { + const token = localStorage.getItem('accessToken'); + const { memberId } = useGetTripsAuthority(); + const { callBackPub, tripId, tripMember } = useContext(socketContext); + const [position, setPosition] = useState({ x: 0, y: 0 }); + + const myName = tripMember?.data?.tripMembers.find( + (member) => member.memberId === memberId, + ); + + useEffect(() => { + const handleMouseMove = (e: MouseEvent) => { + setPosition({ x: e.clientX, y: e.clientY }); + }; + const cursorStyle = (style: string): void => { + document.querySelectorAll('*').forEach((el) => { + const element = el as HTMLElement; + element.style.cursor = style; + }); + }; + cursorStyle('none'); + document.addEventListener('mousemove', handleMouseMove); + return () => { + cursorStyle('auto'); + document.removeEventListener('mousemove', handleMouseMove); + }; + }, []); + + // useEffect(() => { + // if (token && position && myName && date && tripId) { + // const timeoutId = setTimeout(() => { + // callBackPub(() => + // pubCursor( + // { + // token: token, + // visitDate: date, + // x: position.x, + // y: position.y, + // }, + // tripId, + // ), + // ); + // }, 1000); + + // return () => clearTimeout(timeoutId); + // } + // }, [position]); + + useEffect(() => { + if (token && position && myName && date && tripId) { + callBackPub(() => + pubCursor( + { + token: token, + visitDate: date, + x: position.x, + y: position.y, + }, + tripId, + ), + ); + } + }, [position]); + + return ( +
+ +
+ {myName?.name} +
+
+ ); +}; + +export default PlanCursor; diff --git a/src/components/Plan/PlanItem.tsx b/src/components/Plan/PlanItem.tsx index 56def8f7..51ab0c63 100644 --- a/src/components/Plan/PlanItem.tsx +++ b/src/components/Plan/PlanItem.tsx @@ -11,6 +11,8 @@ import { visitDateState, isEditState } from '@recoil/socket'; import { pubGetPathAndItems, pubUpdateTransportation } from '@api/socket'; import { tapState } from '@recoil/plan'; import { useGetTripsAuthority } from '@hooks/useGetTripsAuthority'; +import PlanCursor from './PlanCursor'; +import PlanOtherCursor from './PlanOtherCursor'; type PlanItemProps = { date: string; @@ -62,8 +64,10 @@ const PlanItem: React.FC = ({ date, day }) => { return ( <> - {tripPath && } + + + {tripPath && }
{tripAuthority !== 'WRITE' || isEdit ? (
diff --git a/src/components/Plan/PlanOtherCursor.tsx b/src/components/Plan/PlanOtherCursor.tsx new file mode 100644 index 00000000..d8fa5090 --- /dev/null +++ b/src/components/Plan/PlanOtherCursor.tsx @@ -0,0 +1,63 @@ +import { useEffect, useState, useContext } from 'react'; +import { BsFillCursorFill } from 'react-icons/bs'; +import { pubCursor } from '@api/socket'; +import { socketContext } from '@hooks/useSocket'; +import { useGetTripsAuthority } from '@hooks/useGetTripsAuthority'; + +type TripCursorData = { + memberId: number; + x: number; + y: number; + name: string; +}; + +type PlanCursorProps = { + date: string; +}; + +const PlanOtherCursor = () => { + const { memberId } = useGetTripsAuthority(); + const { tripCursor } = useContext(socketContext); + const [otherCursors, setOtherCursors] = useState([]); + + console.log(otherCursors); + useEffect(() => { + if ( + tripCursor && + tripCursor.data && + tripCursor.data.memberId !== memberId + ) { + setOtherCursors((prevCursors) => { + const existingCursorIndex = prevCursors.findIndex( + (cursor) => cursor.memberId === tripCursor.data!.memberId, + ); + + if (existingCursorIndex !== -1) { + const updatedCursors = [...prevCursors]; + updatedCursors[existingCursorIndex] = tripCursor.data!; + return updatedCursors; + } else { + return [...prevCursors, tripCursor.data!]; + } + }); + } + }, [tripCursor, memberId]); + + return ( + <> + {otherCursors.map((cursor, index) => ( +
+ +
+ {cursor.name} +
+
+ ))} + + ); +}; + +export default PlanOtherCursor; diff --git a/src/components/Plan/PlanSectionTop.tsx b/src/components/Plan/PlanSectionTop.tsx index 6c03a1f7..fada423c 100644 --- a/src/components/Plan/PlanSectionTop.tsx +++ b/src/components/Plan/PlanSectionTop.tsx @@ -10,7 +10,6 @@ import { pubEnterMember, pubConnectMember, pubDisconnectMember, - pubCursor, } from '@api/socket'; import { useEffect } from 'react'; import { useRecoilState } from 'recoil'; @@ -34,7 +33,6 @@ const PlanSectionTop = () => { tripPath, tripMember, tripBudget, - tripCursor, } = useContext(socketContext); const [, setVisitDate] = useRecoilState(visitDateState); const { startDate, endDate } = useGetTrips(); @@ -47,8 +45,6 @@ const PlanSectionTop = () => { ({ DayArr, DateArr } = calculateDayAndDate(startDate, endDate)); } - console.log(tripCursor); - useEffect(() => { if (startDate) { setVisitDate({ visitDate: startDate }); @@ -84,21 +80,6 @@ const PlanSectionTop = () => { } }, [isEnter]); - // useEffect(() => { - // callBackPub(() => - // pubCursor( - // { - // token: - // 'eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiI4MCIsImF1dGgiOiJST0xFX1VTRVIiLCJleHAiOjE3MDU5OTQ4NDJ9.nu7XavOKvKaFYJB77bmPkkYV3rLvfra2zGxa9d9kArwS235CiKi_5UTzm4HqanUIFonhXmS0yxFBrjchlpPFQg', - // visitDate: '2024-02-07', - // x: 123.213, - // y: 92.531, - // }, - // tripId, - // ), - // ); - // }, []); - return (
{ const [tripBudget, setTripBudget] = useState(null); const [tripCursor, setTripCursor] = useState(null); - const [socketCallback, setSocketCallback] = useState<(() => void) | null>( - null, - ); + const socketCallbackRef = useRef<(() => void) | null>(null); const callBackPub = (callback: () => void): void => { - setSocketCallback(() => callback); + // socketCallbackRef에 새로운 콜백을 할당 + socketCallbackRef.current = callback; }; + console.log(socketCallbackRef.current); + const socketConnect = (tripId: string, visitDate: string) => { socketClient.onConnect = () => { subInfo(tripId, (res) => { @@ -91,8 +92,8 @@ export const useSocket = () => { } }); - if (socketCallback) { - socketCallback(); + if (socketCallbackRef.current) { + socketCallbackRef.current(); } }; @@ -103,11 +104,13 @@ export const useSocket = () => { if (tripId && visitDate) { socketConnect(tripId, visitDate.visitDate); } + console.log('소켓연결'); return () => { socketClient.deactivate(); + console.log('소켓해제'); }; - }, [tripId, visitDate, socketCallback]); + }, [tripId, visitDate]); return { tripInfo, @@ -120,3 +123,11 @@ export const useSocket = () => { callBackPub, }; }; + +// const [socketCallback, setSocketCallback] = useState<(() => void) | null>( +// null, +// ); + +// const callBackPub = (callback: () => void): void => { +// setSocketCallback(() => callback); +// }; From 26a951b84859ab360fa89b5363766fe128ab9655 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=96=B4=EC=8A=B9=EC=A4=80?= Date: Wed, 24 Jan 2024 17:49:50 +0900 Subject: [PATCH 25/68] =?UTF-8?q?Refactor:=20GA=20=EC=A0=81=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.html | 36 +++++++++++++++++++++++++----------- 1 file changed, 25 insertions(+), 11 deletions(-) diff --git a/index.html b/index.html index a39119f2..4236bce1 100644 --- a/index.html +++ b/index.html @@ -1,16 +1,30 @@ + + + + + 위플플 | 여정 공유 플랫폼 + - - - - - 위플플 | 여정 공유 플랫폼 - + +
+ + - -
- - + + + + From 154201e5c1a057182fc7c762363dd791cb317ef1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=96=B4=EC=8A=B9=EC=A4=80?= Date: Wed, 24 Jan 2024 17:57:46 +0900 Subject: [PATCH 26/68] =?UTF-8?q?Refactor:=20GA=20=EC=A0=81=EC=9A=A92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.html | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/index.html b/index.html index 4236bce1..c3bd5b82 100644 --- a/index.html +++ b/index.html @@ -8,12 +8,6 @@ content="width=device-width, initial-scale=1.0 maximum-scale=1" /> 위플플 | 여정 공유 플랫폼 - - -
- - - + From d2f437c6daa7f7c4254e486072a54b1601a3bad5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=96=B4=EC=8A=B9=EC=A4=80?= Date: Wed, 24 Jan 2024 18:25:09 +0900 Subject: [PATCH 27/68] =?UTF-8?q?Remove:=20theme,=20globalstyle=20?= =?UTF-8?q?=ED=8C=8C=EC=9D=BC=20=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.tsx | 10 ++---- src/styles/globalStyles.ts | 65 -------------------------------------- src/styles/theme.ts | 61 ----------------------------------- 3 files changed, 2 insertions(+), 134 deletions(-) delete mode 100644 src/styles/globalStyles.ts delete mode 100644 src/styles/theme.ts diff --git a/src/App.tsx b/src/App.tsx index 909f6bac..030880f3 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,6 +1,3 @@ -import { ThemeProvider } from 'styled-components'; -import { GlobalStyle } from '@styles/globalStyles'; -import { theme } from '@styles/theme'; import { RecoilRoot } from 'recoil'; import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; import { ReactQueryDevtools } from '@tanstack/react-query-devtools'; @@ -17,11 +14,8 @@ const App = () => { - - - - - + + diff --git a/src/styles/globalStyles.ts b/src/styles/globalStyles.ts deleted file mode 100644 index e4028567..00000000 --- a/src/styles/globalStyles.ts +++ /dev/null @@ -1,65 +0,0 @@ -import { createGlobalStyle } from 'styled-components'; - -export const GlobalStyle = createGlobalStyle` - html, body, div, span, applet, object, iframe, - h1, h2, h3, h4, h5, h6, p, blockquote, pre, - a, abbr, acronym, address, big, cite, code, - del, dfn, em, img, ins, kbd, q, s, samp, - small, strike, strong, sub, sup, tt, var, - b, u, i, center, - dl, dt, dd, ol, ul, li, - fieldset, form, label, legend, - table, caption, tbody, tfoot, thead, tr, th, td, - article, aside, canvas, details, embed, - figure, figcaption, footer, header, hgroup, - menu, nav, output, ruby, section, summary, - time, mark, audio, video, button { - margin: 0; - padding: 0; - border: 0; - font-size: 100%; - font: inherit; - vertical-align: baseline; - } - - /* HTML5 display-role reset for older browsers */ - article, aside, details, figcaption, figure, - footer, header, hgroup, menu, nav, section { - display: block; - } - - body { - line-height: 1; - } - - ol, ul { - list-style: none; - } - - blockquote, q { - quotes: none; - } - - blockquote:before, blockquote:after, - q:before, q:after { - content: ''; - content: none; - } - - table { - border-collapse: collapse; - border-spacing: 0; - } - * { - box-sizing: border-box; - } - body { - font-family: 'Pretendard Variable', sans-serif; - background-color: ${({ theme }) => theme.colors.bg_page}; - color: ${({ theme }) => theme.colors.text1}; - } - a { - text-decoration: none; - color: inherit; - } -`; diff --git a/src/styles/theme.ts b/src/styles/theme.ts deleted file mode 100644 index 93fe759f..00000000 --- a/src/styles/theme.ts +++ /dev/null @@ -1,61 +0,0 @@ -export const theme = { - colors: { - navy: '#253C59', //primary navy - blue: '#58788c', //옵션에 사용하는 두번째 blue - yellow: '#D9B70D', //찜에 사용하는 yellow - gray1: '#f8f8f8', //제일 어두운 gray - gray2: '#AFAFAF', //중간 gray - gray3: '#757575', - - error: '#CF0000', - success: '#008000', - }, - fonts: { - subtitle1: { - fontSize: '2.5rem', - fontWeight: '900', - lineHeight: '1.5', - }, - subtitle2: { - fontSize: '2rem', - fontWeight: '700', - lineHeight: '1.5', - }, - subtitle3: { - fontSize: '1.75rem', - fontWeight: '600', - lineHeight: '1.5', - }, - subtitle4: { - fontSize: '1.5rem', - fontWeight: '500', - lineHeight: '1.5', - }, - subtitle4_5: { - fontSize: '1.25rem', - fontWeight: '700', - lineHeight: '1.5', - }, - subtitle5: { - fontSize: '1rem', - fontWeight: '700', - lineHeight: '1.5', - }, - body: { - fontSize: '0.875rem', - fontWeight: '700', - lineHeight: '1.6', - }, - }, - shadows: { - shadow1: { - shadow: '0px 4px 8px rgba(0, 0, 0, 0.04)', - }, - shadow2: { - shadow: '0px 8px 16px rgba(0, 0, 0, 0.16)', - }, - shadow3: { - shadow: '0px 12px 40px rgba(0, 0, 0, 0.12)', - }, - }, -}; From 32f88af85035a140ea91435b36415efddcca4ab4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=96=B4=EC=8A=B9=EC=A4=80?= Date: Wed, 24 Jan 2024 18:37:48 +0900 Subject: [PATCH 28/68] =?UTF-8?q?Refactor:=20=ED=83=80=EC=9E=85=20?= =?UTF-8?q?=EB=B6=84=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/@types/review.types.ts | 15 ++++++++++---- src/@types/tours.types.ts | 20 +++++++++---------- src/@types/trips.types.ts | 12 +++++++++++ src/api/review.ts | 1 - .../DetailSectionBottom/DetailReviews.tsx | 1 - .../DetailSectionBottom/ReviewItem.tsx | 1 - src/components/Review/CommentItem.tsx | 1 - src/components/Review/MyReview.tsx | 1 - src/components/Review/Review.tsx | 1 - src/components/Review/ReviewComments.tsx | 1 - src/components/Review/ReviewKeyword.tsx | 1 - src/components/Tours/ToursItem.tsx | 1 - src/hooks/useReviewStats.ts | 1 - src/hooks/useReviewStatsCalculator.ts | 1 - src/recoil/review.ts | 12 ----------- src/recoil/trip.ts | 12 ----------- 16 files changed, 33 insertions(+), 49 deletions(-) diff --git a/src/@types/review.types.ts b/src/@types/review.types.ts index fe5fcb10..6f6cf219 100644 --- a/src/@types/review.types.ts +++ b/src/@types/review.types.ts @@ -1,10 +1,10 @@ -export interface Keyword { +interface Keyword { keywordId: number; content: string; - type: string; + type?: string; } -export interface CommentItemProps { +interface CommentItemProps { commentId: number; authorNickname: string; authorProfileImageUrl: string; @@ -14,7 +14,7 @@ export interface CommentItemProps { isAuthor: boolean; } -export interface MyReviewContent { +interface MyReviewContent { reviewId: number; authorNickname: string; authorProfileImageUrl: string; @@ -25,3 +25,10 @@ export interface MyReviewContent { commentCount: number; isAuthor?: boolean; } + +interface ReviewRequest { + tourItemId: number; + rating: number; + keywords: Keyword[]; + content: string; +} diff --git a/src/@types/tours.types.ts b/src/@types/tours.types.ts index 11e862e7..52776135 100644 --- a/src/@types/tours.types.ts +++ b/src/@types/tours.types.ts @@ -1,30 +1,30 @@ -export type TourKeywordInfo = { +interface TourKeywordInfo { keywordId: number; content: string; type: string; keywordCount: number; -}; +} -export interface RegionTypes { +interface RegionTypes { areaCode?: number; subAreaCode?: number; name: string; } -export interface ToursCategoryItemProps extends RegionTypes { +interface ToursCategoryItemProps extends RegionTypes { isSelected: boolean; onSelect: (name: string) => void; } -export interface ToursListProps { +interface ToursListProps { selectedRegion: string; } -export interface ToursCategoryProps extends ToursListProps { +interface ToursCategoryProps extends ToursListProps { setSelectedRegion: (region: string) => void; } -export interface TourType { +interface TourType { contentTypeId?: number; id: number; title: string; @@ -38,7 +38,7 @@ export interface TourType { latitude?: string; } -export interface LikedListType { +interface LikedListType { tripLikedItemId: number; tourItemId: number; contentTypeId: number; @@ -53,7 +53,7 @@ export interface LikedListType { notPreferTotalCount: number; } -export interface ReviewInfoItemProps { +interface ReviewInfoItemProps { reviewId: number; authorNickname: string; authorProfileImageUrl: string; @@ -72,5 +72,5 @@ export interface ReviewInfoItemProps { interface Keyword { keywordId: number; content: string; - type: string; + type?: string; } diff --git a/src/@types/trips.types.ts b/src/@types/trips.types.ts index 36f92cd8..71ab6a4f 100644 --- a/src/@types/trips.types.ts +++ b/src/@types/trips.types.ts @@ -61,3 +61,15 @@ interface TripMemeberInfo { nickname: string; profileImageUrl: string; } + +interface Participant { + memberId: number; + nickname: string; + thumbnail: string; +} + +interface Participants { + tripSurveyMemberCount: number; + tripSurveySetMemberInfos: Participant[]; + nonTripSurveySetMemberInfos: Participant[]; +} diff --git a/src/api/review.ts b/src/api/review.ts index ec7f4f43..33c11ba8 100644 --- a/src/api/review.ts +++ b/src/api/review.ts @@ -1,6 +1,5 @@ import client from './client'; import authClient from './authClient'; -import { ReviewRequest } from '@recoil/review'; // 리뷰 관련 API // 리뷰수정 diff --git a/src/components/DetailSectionBottom/DetailReviews.tsx b/src/components/DetailSectionBottom/DetailReviews.tsx index 93e1e310..ddb3161c 100644 --- a/src/components/DetailSectionBottom/DetailReviews.tsx +++ b/src/components/DetailSectionBottom/DetailReviews.tsx @@ -26,7 +26,6 @@ import ToastPopUp from '@components/common/toastpopup/ToastPopUp'; import EditDelete from '@components/common/modal/children/EditDelete'; import MyAlert from '@components/common/modal/children/MyAlert'; import { alertTypeState } from '@recoil/modal'; -import { ReviewInfoItemProps } from '@/@types/tours.types'; export default function DetailReviews({ reviewData, diff --git a/src/components/DetailSectionBottom/ReviewItem.tsx b/src/components/DetailSectionBottom/ReviewItem.tsx index 1a2817d9..051569c2 100644 --- a/src/components/DetailSectionBottom/ReviewItem.tsx +++ b/src/components/DetailSectionBottom/ReviewItem.tsx @@ -21,7 +21,6 @@ import { import { MouseEvent, useState } from 'react'; import { getEmoji } from '@utils/utils'; import { getStarFill } from '@utils/getStarFill'; -import { ReviewInfoItemProps } from '@/@types/tours.types'; const Item: React.FC = (props: ReviewInfoItemProps) => { const { diff --git a/src/components/Review/CommentItem.tsx b/src/components/Review/CommentItem.tsx index 9b8a8fdd..c74ff1c5 100644 --- a/src/components/Review/CommentItem.tsx +++ b/src/components/Review/CommentItem.tsx @@ -6,7 +6,6 @@ import { } from '@recoil/modal'; import { commentState, targetCommentIdState } from '@recoil/review'; import { useRecoilState, useSetRecoilState } from 'recoil'; -import { CommentItemProps } from '@/@types/review.types'; const CommentItem: React.FC = (props: CommentItemProps) => { const { diff --git a/src/components/Review/MyReview.tsx b/src/components/Review/MyReview.tsx index 7bb3cfb5..a675b022 100644 --- a/src/components/Review/MyReview.tsx +++ b/src/components/Review/MyReview.tsx @@ -22,7 +22,6 @@ import MyAlert from '@components/common/modal/children/MyAlert'; import { alertTypeState } from '@recoil/modal'; import { PenIcon } from '@components/common/icons/Icons'; import ScrollTopButton from '@components/Plan/ScrollTopButton'; -import { MyReviewContent } from '@/@types/review.types'; export default function MyReview() { const [reviewDataLength, setReviewDataLength] = useState(0); diff --git a/src/components/Review/Review.tsx b/src/components/Review/Review.tsx index 30335755..c60a1b28 100644 --- a/src/components/Review/Review.tsx +++ b/src/components/Review/Review.tsx @@ -15,7 +15,6 @@ import { isModalOpenState } from '@recoil/modal'; import { useRecoilState, useRecoilValue, useSetRecoilState } from 'recoil'; import { useParams, useNavigate } from 'react-router-dom'; import { useMutation, useQueryClient } from '@tanstack/react-query'; -import { ReviewRequest } from '@recoil/review'; interface EditReviewMutationParams { reviewData: ReviewRequest; targetReviewId: number; diff --git a/src/components/Review/ReviewComments.tsx b/src/components/Review/ReviewComments.tsx index 965314d2..05dd0244 100644 --- a/src/components/Review/ReviewComments.tsx +++ b/src/components/Review/ReviewComments.tsx @@ -13,7 +13,6 @@ import MyAlert from '@components/common/modal/children/MyAlert'; import { commentState, toastPopUpState } from '@recoil/review'; import { alertTypeState } from '@recoil/modal'; import ToastPopUp from '@components/common/toastpopup/ToastPopUp'; -import { CommentItemProps } from '@/@types/review.types'; export default function ReviewComments() { const params = useParams(); diff --git a/src/components/Review/ReviewKeyword.tsx b/src/components/Review/ReviewKeyword.tsx index 1b33a700..d6c24780 100644 --- a/src/components/Review/ReviewKeyword.tsx +++ b/src/components/Review/ReviewKeyword.tsx @@ -4,7 +4,6 @@ import { getReviewKeywords } from '@api/review'; import { useQuery } from '@tanstack/react-query'; import { useRecoilState } from 'recoil'; import { keywordsState } from '@recoil/review'; -import { Keyword } from '@/@types/review.types'; export default function ReviewKeyword() { const location = useLocation(); diff --git a/src/components/Tours/ToursItem.tsx b/src/components/Tours/ToursItem.tsx index 0e30a938..c6221f5c 100644 --- a/src/components/Tours/ToursItem.tsx +++ b/src/components/Tours/ToursItem.tsx @@ -1,4 +1,3 @@ -import { TourType } from '@/@types/tours.types'; import { HeartIcon, StarIcon } from '@components/common/icons/Icons'; import Like from '@components/common/like/Like'; import { useNavigate } from 'react-router-dom'; diff --git a/src/hooks/useReviewStats.ts b/src/hooks/useReviewStats.ts index 001b1a54..2c4a37fd 100644 --- a/src/hooks/useReviewStats.ts +++ b/src/hooks/useReviewStats.ts @@ -1,6 +1,5 @@ import { useQuery } from '@tanstack/react-query'; import { getToursReviews } from '@api/tours'; -import { TourKeywordInfo } from '@/@types/tours.types'; import { useParams } from 'react-router-dom'; type UseGetToursReviewsReturn = { diff --git a/src/hooks/useReviewStatsCalculator.ts b/src/hooks/useReviewStatsCalculator.ts index 88be9c15..89573b0c 100644 --- a/src/hooks/useReviewStatsCalculator.ts +++ b/src/hooks/useReviewStatsCalculator.ts @@ -1,5 +1,4 @@ import { useMemo } from 'react'; -import { TourKeywordInfo } from '@/@types/tours.types'; const getMaxMinCounts = (reviewStats: TourKeywordInfo[]) => { const counts = reviewStats.map((item) => item.keywordCount); diff --git a/src/recoil/review.ts b/src/recoil/review.ts index 4c7b0156..0aaac458 100644 --- a/src/recoil/review.ts +++ b/src/recoil/review.ts @@ -1,17 +1,5 @@ import { atom } from 'recoil'; -export interface ReviewRequest { - tourItemId: number; - rating: number; - keywords: Keyword[]; - content: string; -} - -type Keyword = { - keywordId: number; - content: string; -}; - export const ratingState = atom({ key: 'ratingState', default: 0, diff --git a/src/recoil/trip.ts b/src/recoil/trip.ts index 9df993e0..b2b7e656 100644 --- a/src/recoil/trip.ts +++ b/src/recoil/trip.ts @@ -1,17 +1,5 @@ import { atom } from 'recoil'; -type Participant = { - memberId: number; - nickname: string; - thumbnail: string; -}; - -export type Participants = { - tripSurveyMemberCount: number; - tripSurveySetMemberInfos: Participant[]; - nonTripSurveySetMemberInfos: Participant[]; -}; - export const participantsState = atom({ key: 'participantsState', default: { From ccaaff37eca874c55c7f6ee3d69bfa5ee106d067 Mon Sep 17 00:00:00 2001 From: Hojin Date: Wed, 24 Jan 2024 23:38:31 +0900 Subject: [PATCH 29/68] =?UTF-8?q?Chore:=20pull=EC=A0=84=20=EC=BB=A4?= =?UTF-8?q?=EB=B0=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Plan/PlanItem.tsx | 7 +++--- src/components/Plan/PlanOtherCursor.tsx | 3 +-- src/components/Plan/PlanSectionTop.tsx | 1 + src/hooks/useSocket.ts | 31 ++++++++++++------------- 4 files changed, 21 insertions(+), 21 deletions(-) diff --git a/src/components/Plan/PlanItem.tsx b/src/components/Plan/PlanItem.tsx index 51ab0c63..33c6e23b 100644 --- a/src/components/Plan/PlanItem.tsx +++ b/src/components/Plan/PlanItem.tsx @@ -26,7 +26,8 @@ const PlanItem: React.FC = ({ date, day }) => { const tap = useRecoilValue(tapState); const [, setVisitDate] = useRecoilState(visitDateState); - const { tripItem, tripPath, callBackPub, tripId } = useContext(socketContext); + const { tripItem, tripPath, callBackPub, tripId, tripCursor } = + useContext(socketContext); useEffect(() => { if (tap) { @@ -64,8 +65,8 @@ const PlanItem: React.FC = ({ date, day }) => { return ( <> - - + {/* + */} {tripPath && }
diff --git a/src/components/Plan/PlanOtherCursor.tsx b/src/components/Plan/PlanOtherCursor.tsx index d8fa5090..fe98bb05 100644 --- a/src/components/Plan/PlanOtherCursor.tsx +++ b/src/components/Plan/PlanOtherCursor.tsx @@ -17,10 +17,9 @@ type PlanCursorProps = { const PlanOtherCursor = () => { const { memberId } = useGetTripsAuthority(); - const { tripCursor } = useContext(socketContext); + const { tripCursor, tripMember } = useContext(socketContext); const [otherCursors, setOtherCursors] = useState([]); - console.log(otherCursors); useEffect(() => { if ( tripCursor && diff --git a/src/components/Plan/PlanSectionTop.tsx b/src/components/Plan/PlanSectionTop.tsx index fada423c..95e0e44d 100644 --- a/src/components/Plan/PlanSectionTop.tsx +++ b/src/components/Plan/PlanSectionTop.tsx @@ -65,6 +65,7 @@ const PlanSectionTop = () => { useEffect(() => { if (isEnter) { + console.log('실행'); const accessToken = getItem('accessToken'); if (accessToken) { callBackPub(() => { diff --git a/src/hooks/useSocket.ts b/src/hooks/useSocket.ts index e39c8b10..2c252273 100644 --- a/src/hooks/useSocket.ts +++ b/src/hooks/useSocket.ts @@ -45,15 +45,21 @@ export const useSocket = () => { const [tripBudget, setTripBudget] = useState(null); const [tripCursor, setTripCursor] = useState(null); - const socketCallbackRef = useRef<(() => void) | null>(null); + // const socketCallbackRef = useRef<(() => void) | null>(null); + + // const callBackPub = (callback: () => void): void => { + // // socketCallbackRef에 새로운 콜백을 할당 + // socketCallbackRef.current = callback; + // }; + + const [socketCallback, setSocketCallback] = useState<(() => void) | null>( + null, + ); const callBackPub = (callback: () => void): void => { - // socketCallbackRef에 새로운 콜백을 할당 - socketCallbackRef.current = callback; + setSocketCallback(() => callback); }; - console.log(socketCallbackRef.current); - const socketConnect = (tripId: string, visitDate: string) => { socketClient.onConnect = () => { subInfo(tripId, (res) => { @@ -92,9 +98,10 @@ export const useSocket = () => { } }); - if (socketCallbackRef.current) { - socketCallbackRef.current(); + if (socketCallback) { + socketCallback(); } + }; socketClient.activate(); @@ -110,7 +117,7 @@ export const useSocket = () => { socketClient.deactivate(); console.log('소켓해제'); }; - }, [tripId, visitDate]); + }, [tripId, visitDate, callBackPub]); return { tripInfo, @@ -123,11 +130,3 @@ export const useSocket = () => { callBackPub, }; }; - -// const [socketCallback, setSocketCallback] = useState<(() => void) | null>( -// null, -// ); - -// const callBackPub = (callback: () => void): void => { -// setSocketCallback(() => callback); -// }; From b1063318404180bcec90c44d93652f3c9a6ff39e Mon Sep 17 00:00:00 2001 From: sue Date: Wed, 24 Jan 2024 23:56:30 +0900 Subject: [PATCH 30/68] =?UTF-8?q?Design:=20=EB=94=94=EC=9E=90=EC=9D=B8=20Q?= =?UTF-8?q?A=20=EB=B0=8F=20=EC=9B=8C=EB=94=A9=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/DetailSectionTop/DetailAddSchedule.tsx | 2 +- src/components/Plan/PlanEditItemBox.tsx | 2 +- src/components/Plan/PlanSectionTop.tsx | 2 +- src/components/Review/MyReview.tsx | 2 +- src/components/Trip/EditCodeModal.tsx | 4 ++-- src/components/Trip/PlanTripButton.tsx | 2 +- src/components/Trip/TripSectionTop.tsx | 2 +- src/components/Wish/Wish.tsx | 2 +- src/components/common/icons/Icons.tsx | 4 ++-- .../scrollTopButton}/ScrollTopButton.tsx | 11 +++++------ src/components/common/toastpopup/ToastPopUp.tsx | 4 +++- src/components/search/SearchResult.tsx | 2 +- 12 files changed, 20 insertions(+), 19 deletions(-) rename src/components/{Plan => common/scrollTopButton}/ScrollTopButton.tsx (87%) diff --git a/src/components/DetailSectionTop/DetailAddSchedule.tsx b/src/components/DetailSectionTop/DetailAddSchedule.tsx index 22f35eb5..6f32843d 100644 --- a/src/components/DetailSectionTop/DetailAddSchedule.tsx +++ b/src/components/DetailSectionTop/DetailAddSchedule.tsx @@ -202,7 +202,7 @@ const DetailAddSchedule = () => {

- 등록된 여행이 없습니다. + 참여하고 있는 여정이 없어요.

diff --git a/src/components/Plan/PlanEditItemBox.tsx b/src/components/Plan/PlanEditItemBox.tsx index 1e1a6fec..3a69e149 100644 --- a/src/components/Plan/PlanEditItemBox.tsx +++ b/src/components/Plan/PlanEditItemBox.tsx @@ -171,7 +171,7 @@ const PlanEditItemBox = ({
선택한 장소를 삭제하시겠습니까?} + message={<>여정에서 이 장소를 삭제할까요?} onConfirm={handleConfirm} closeOnConfirm={true} isCheck={selectedItemId}> diff --git a/src/components/Plan/PlanSectionTop.tsx b/src/components/Plan/PlanSectionTop.tsx index 35d61790..eff1f233 100644 --- a/src/components/Plan/PlanSectionTop.tsx +++ b/src/components/Plan/PlanSectionTop.tsx @@ -20,7 +20,7 @@ import { visitDateState } from '@recoil/socket'; import { useState } from 'react'; import { getItem } from '@utils/localStorageFun'; import PlanSchedule from './PlanSchedule'; -import ScrollTopButton from './ScrollTopButton'; +import ScrollTopButton from '../common/scrollTopButton/ScrollTopButton'; const PlanSectionTop = () => { const navigate = useNavigate(); diff --git a/src/components/Review/MyReview.tsx b/src/components/Review/MyReview.tsx index 7bb3cfb5..ef5b266b 100644 --- a/src/components/Review/MyReview.tsx +++ b/src/components/Review/MyReview.tsx @@ -21,7 +21,7 @@ import EditDelete from '@components/common/modal/children/EditDelete'; import MyAlert from '@components/common/modal/children/MyAlert'; import { alertTypeState } from '@recoil/modal'; import { PenIcon } from '@components/common/icons/Icons'; -import ScrollTopButton from '@components/Plan/ScrollTopButton'; +import ScrollTopButton from '@components/common/scrollTopButton/ScrollTopButton'; import { MyReviewContent } from '@/@types/review.types'; export default function MyReview() { diff --git a/src/components/Trip/EditCodeModal.tsx b/src/components/Trip/EditCodeModal.tsx index 8d674d6e..f5e5c7ea 100644 --- a/src/components/Trip/EditCodeModal.tsx +++ b/src/components/Trip/EditCodeModal.tsx @@ -63,14 +63,14 @@ const EditCodeModal = () => { return ( <> - {isToastVisible && } + {isToastVisible && } {isLogin ? ( tripAuthority === 'WRITE' ? ( diff --git a/src/components/Trip/PlanTripButton.tsx b/src/components/Trip/PlanTripButton.tsx index 01cb4eb9..ccba7409 100644 --- a/src/components/Trip/PlanTripButton.tsx +++ b/src/components/Trip/PlanTripButton.tsx @@ -24,7 +24,7 @@ const PlanTripButton = () => {
-

여행 계획하기

+

여행 계획하기

diff --git a/src/components/Trip/TripSectionTop.tsx b/src/components/Trip/TripSectionTop.tsx index 7679645f..7b40a52c 100644 --- a/src/components/Trip/TripSectionTop.tsx +++ b/src/components/Trip/TripSectionTop.tsx @@ -8,7 +8,7 @@ import { LikedToursList } from './LikedToursList'; import { useGetTripsAuthority } from '@hooks/useGetTripsAuthority'; import { useEffect, useState } from 'react'; import IsEditableModal from '@components/Share/IsEditableModal'; -import ScrollTopButton from '@components/Plan/ScrollTopButton'; +import ScrollTopButton from '@components/common/scrollTopButton/ScrollTopButton'; const TripSectionTop = () => { const navigate = useNavigate(); diff --git a/src/components/Wish/Wish.tsx b/src/components/Wish/Wish.tsx index ffe8c8af..11c5d8ef 100644 --- a/src/components/Wish/Wish.tsx +++ b/src/components/Wish/Wish.tsx @@ -5,7 +5,7 @@ import WishList from './WishList'; import NoDataMessage from '@components/common/noData/NoDataMessage'; import { getMemberTours } from '@api/member'; import { HeartIcon } from '@components/common/icons/Icons'; -import ScrollTopButton from '@components/Plan/ScrollTopButton'; +import ScrollTopButton from '@components/common/scrollTopButton/ScrollTopButton'; const Wish = () => { const [selectedContentTypeId, setSelectedContentTypeId] = useState< diff --git a/src/components/common/icons/Icons.tsx b/src/components/common/icons/Icons.tsx index 1969e0b1..a33a26b2 100644 --- a/src/components/common/icons/Icons.tsx +++ b/src/components/common/icons/Icons.tsx @@ -1041,8 +1041,8 @@ export const TopIcon: React.FC = () => { }; export const ShareIcon: React.FC = ({ - width = 20, - height = 19, + width = 17.9, + height = 17, fill = 'none', color = 'black', }) => { diff --git a/src/components/Plan/ScrollTopButton.tsx b/src/components/common/scrollTopButton/ScrollTopButton.tsx similarity index 87% rename from src/components/Plan/ScrollTopButton.tsx rename to src/components/common/scrollTopButton/ScrollTopButton.tsx index 9f16e9b6..2eb1bcbc 100644 --- a/src/components/Plan/ScrollTopButton.tsx +++ b/src/components/common/scrollTopButton/ScrollTopButton.tsx @@ -28,14 +28,13 @@ const ScrollTopButton = () => { } return ( -
- -
+ style={{ left: 'calc(100%)' }} + onClick={scrollToTop}> + + ); }; diff --git a/src/components/common/toastpopup/ToastPopUp.tsx b/src/components/common/toastpopup/ToastPopUp.tsx index 004ebacd..75c28bb0 100644 --- a/src/components/common/toastpopup/ToastPopUp.tsx +++ b/src/components/common/toastpopup/ToastPopUp.tsx @@ -22,8 +22,10 @@ const ToastPopUp: React.FC = ({ noun, verb }) => { }, []); useEffect(() => { - if (noun === '일정' || noun === '날짜 이동' || noun === '여행 일정') { + if (noun === '일정' || noun === '날짜 이동') { setParticle('이'); + } else if (noun === '나의 여정') { + setParticle('에서'); } }, [noun]); diff --git a/src/components/search/SearchResult.tsx b/src/components/search/SearchResult.tsx index 952e1e2c..c420e2b5 100644 --- a/src/components/search/SearchResult.tsx +++ b/src/components/search/SearchResult.tsx @@ -4,7 +4,7 @@ import { useInfiniteQuery } from '@tanstack/react-query'; import ToursCategoryItem from '@components/Tours/ToursCategoryItem'; import { useEffect, useState } from 'react'; import { Spinner } from '@components/common/spinner/Spinner'; -import ScrollTopButton from '@components/Plan/ScrollTopButton'; +import ScrollTopButton from '@components/common/scrollTopButton/ScrollTopButton'; interface SearchResultProps { selectedRegion: string | null; From 742aa7dbf56babb119ef5f7c6056a762729da22d Mon Sep 17 00:00:00 2001 From: Hojin Date: Thu, 25 Jan 2024 12:33:48 +0900 Subject: [PATCH 31/68] =?UTF-8?q?Fix:=20=EC=86=8C=EC=BC=93=20=EC=83=88?= =?UTF-8?q?=EB=A1=9C=EA=B3=A0=EC=B9=A8=20=EB=AC=B8=EC=A0=9C=ED=95=B4?= =?UTF-8?q?=EA=B2=B0(=EC=95=84=EC=9D=B4=ED=85=9C=20=EC=B6=94=EA=B0=80=20?= =?UTF-8?q?=EC=A0=9C=EC=99=B8)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Plan/PlanCursor.tsx | 37 ++++++-------------------- src/components/Plan/PlanItem.tsx | 23 ++++++++++------ src/components/Plan/PlanSectionTop.tsx | 16 ++++++----- src/hooks/useSocket.ts | 12 ++------- 4 files changed, 35 insertions(+), 53 deletions(-) diff --git a/src/components/Plan/PlanCursor.tsx b/src/components/Plan/PlanCursor.tsx index 48d10a01..54e325db 100644 --- a/src/components/Plan/PlanCursor.tsx +++ b/src/components/Plan/PlanCursor.tsx @@ -43,38 +43,17 @@ const PlanCursor = ({ date }: PlanCursorProps) => { }; }, []); - // useEffect(() => { - // if (token && position && myName && date && tripId) { - // const timeoutId = setTimeout(() => { - // callBackPub(() => - // pubCursor( - // { - // token: token, - // visitDate: date, - // x: position.x, - // y: position.y, - // }, - // tripId, - // ), - // ); - // }, 1000); - - // return () => clearTimeout(timeoutId); - // } - // }, [position]); useEffect(() => { if (token && position && myName && date && tripId) { - callBackPub(() => - pubCursor( - { - token: token, - visitDate: date, - x: position.x, - y: position.y, - }, - tripId, - ), + pubCursor( + { + token: token, + visitDate: date, + x: position.x, + y: position.y, + }, + tripId, ); } }, [position]); diff --git a/src/components/Plan/PlanItem.tsx b/src/components/Plan/PlanItem.tsx index 33c6e23b..5c4e81bd 100644 --- a/src/components/Plan/PlanItem.tsx +++ b/src/components/Plan/PlanItem.tsx @@ -49,14 +49,21 @@ const PlanItem: React.FC = ({ date, day }) => { tripId: string, ) => { if (transportation !== transpo) { - callBackPub(() => - pubUpdateTransportation( - { - visitDate: date, - transportation: transportation, - }, - tripId, - ), + // callBackPub(() => + // pubUpdateTransportation( + // { + // visitDate: date, + // transportation: transportation, + // }, + // tripId, + // ), + // ); + pubUpdateTransportation( + { + visitDate: date, + transportation: transportation, + }, + tripId, ); } }; diff --git a/src/components/Plan/PlanSectionTop.tsx b/src/components/Plan/PlanSectionTop.tsx index 95e0e44d..2c5d4d45 100644 --- a/src/components/Plan/PlanSectionTop.tsx +++ b/src/components/Plan/PlanSectionTop.tsx @@ -68,14 +68,18 @@ const PlanSectionTop = () => { console.log('실행'); const accessToken = getItem('accessToken'); if (accessToken) { - callBackPub(() => { - pubConnectMember({ token: accessToken || '' }, tripId); - }); + // callBackPub(() => { + // pubConnectMember({ token: accessToken || '' }, tripId); + // }); + + pubConnectMember({ token: accessToken || '' }, tripId); return () => { - callBackPub(() => - pubDisconnectMember({ token: accessToken || '' }, tripId), - ); + // callBackPub(() => + // pubDisconnectMember({ token: accessToken || '' }, tripId), + // ); + + pubDisconnectMember({ token: accessToken || '' }, tripId); }; } } diff --git a/src/hooks/useSocket.ts b/src/hooks/useSocket.ts index 2c252273..dc5a8c1e 100644 --- a/src/hooks/useSocket.ts +++ b/src/hooks/useSocket.ts @@ -17,7 +17,7 @@ import { SocketContextType, } from '@/@types/service'; import { createContext } from 'react'; -import { useState, useEffect, useRef } from 'react'; +import { useState, useEffect } from 'react'; import { useParams } from 'react-router-dom'; import { useRecoilValue } from 'recoil'; import { visitDateState } from '@recoil/socket'; @@ -45,13 +45,6 @@ export const useSocket = () => { const [tripBudget, setTripBudget] = useState(null); const [tripCursor, setTripCursor] = useState(null); - // const socketCallbackRef = useRef<(() => void) | null>(null); - - // const callBackPub = (callback: () => void): void => { - // // socketCallbackRef에 새로운 콜백을 할당 - // socketCallbackRef.current = callback; - // }; - const [socketCallback, setSocketCallback] = useState<(() => void) | null>( null, ); @@ -101,7 +94,6 @@ export const useSocket = () => { if (socketCallback) { socketCallback(); } - }; socketClient.activate(); @@ -117,7 +109,7 @@ export const useSocket = () => { socketClient.deactivate(); console.log('소켓해제'); }; - }, [tripId, visitDate, callBackPub]); + }, [tripId, visitDate, socketCallback]); return { tripInfo, From 601c894439622f45b26a0f5ec5793e56a7d9cfed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=96=B4=EC=8A=B9=EC=A4=80?= Date: Thu, 25 Jan 2024 14:46:19 +0900 Subject: [PATCH 32/68] =?UTF-8?q?Fix:=EB=94=94=EC=9E=90=EC=9D=B8=20qa=20?= =?UTF-8?q?=EC=A0=81=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/DetailSectionBottom/ReviewItem.tsx | 2 +- src/components/common/nav/InputComment.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/DetailSectionBottom/ReviewItem.tsx b/src/components/DetailSectionBottom/ReviewItem.tsx index 051569c2..c11e040e 100644 --- a/src/components/DetailSectionBottom/ReviewItem.tsx +++ b/src/components/DetailSectionBottom/ReviewItem.tsx @@ -184,7 +184,7 @@ const Item: React.FC = (props: ReviewInfoItemProps) => { .map((keyword, idx) => (
+ className="rounded-md bg-gray1 px-2 py-1 text-xs text-gray6"> {getEmoji(keyword.content)} {keyword.content}
))} diff --git a/src/components/common/nav/InputComment.tsx b/src/components/common/nav/InputComment.tsx index 3e3bb64d..00a343dc 100644 --- a/src/components/common/nav/InputComment.tsx +++ b/src/components/common/nav/InputComment.tsx @@ -106,7 +106,7 @@ export const InputComment: React.FC = () => { }; return ( -
+
From 1caee05197cb207fc1f68e769b77441757864598 Mon Sep 17 00:00:00 2001 From: Shim Jeong ah <35457850+joanShim@users.noreply.github.com> Date: Thu, 25 Jan 2024 14:49:13 +0900 Subject: [PATCH 33/68] =?UTF-8?q?Design:=20=EB=94=94=EC=9E=90=EC=9D=B8=20Q?= =?UTF-8?q?A=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/common/icons/Icons.tsx | 39 +++++++------------ .../common/toggleGroup/ToggleValue.tsx | 2 +- src/components/search/ResultItem.tsx | 4 +- src/components/search/SearchInput.tsx | 36 +++++++++-------- src/components/search/StartSearchBtn.tsx | 2 +- 5 files changed, 38 insertions(+), 45 deletions(-) diff --git a/src/components/common/icons/Icons.tsx b/src/components/common/icons/Icons.tsx index 5e3ce768..495e9292 100644 --- a/src/components/common/icons/Icons.tsx +++ b/src/components/common/icons/Icons.tsx @@ -724,32 +724,23 @@ export const SearchIcon: React.FC = ({ }) => { return ( - - - - + fill={fill}> + + ); }; diff --git a/src/components/common/toggleGroup/ToggleValue.tsx b/src/components/common/toggleGroup/ToggleValue.tsx index fffff6dc..57764632 100644 --- a/src/components/common/toggleGroup/ToggleValue.tsx +++ b/src/components/common/toggleGroup/ToggleValue.tsx @@ -16,7 +16,7 @@ export const ToggleValue = ({ {values.map((value) => ( onToggle(value)}> diff --git a/src/components/search/ResultItem.tsx b/src/components/search/ResultItem.tsx index 47c86ecc..0a910b7a 100644 --- a/src/components/search/ResultItem.tsx +++ b/src/components/search/ResultItem.tsx @@ -9,7 +9,7 @@ export const ResultItem = ({ result }: { result: TourType }) => { }; return (
{ />
-
{result.title}
+
{result.title}
{result.tourAddress} diff --git a/src/components/search/SearchInput.tsx b/src/components/search/SearchInput.tsx index c3dbbabf..0adedc1c 100644 --- a/src/components/search/SearchInput.tsx +++ b/src/components/search/SearchInput.tsx @@ -52,24 +52,26 @@ const SearchInput = () => {
-
- -
- - {inputValue && ( -
- +
+
+
- )} + + {inputValue && ( +
+ +
+ )} +
); diff --git a/src/components/search/StartSearchBtn.tsx b/src/components/search/StartSearchBtn.tsx index a5b9b3ef..0ec5b0f0 100644 --- a/src/components/search/StartSearchBtn.tsx +++ b/src/components/search/StartSearchBtn.tsx @@ -13,7 +13,7 @@ export const StartSearchButton = () => { className="flex h-[40px] w-full items-center border-b-2 border-solid px-1" onClick={goToSearch}> - 어디로 떠나세요? + 어디로 떠나세요? ); }; From 4809bcc13f04bc0fa6ffd18e5f8c17250f99bf6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=96=B4=EC=8A=B9=EC=A4=80?= Date: Thu, 25 Jan 2024 14:51:12 +0900 Subject: [PATCH 34/68] =?UTF-8?q?Fix:=20=EB=B9=8C=EB=93=9C=20=EC=97=90?= =?UTF-8?q?=EB=9F=AC=20=ED=95=B4=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Tours/ToursCategory.tsx | 1 - src/components/Tours/ToursCategoryItem.tsx | 2 -- src/components/Tours/ToursList.tsx | 1 - src/components/Wish/WishItem.tsx | 1 - src/components/Wish/WishList.tsx | 1 - src/components/search/ResultCategory.tsx | 1 - src/components/search/ResultItem.tsx | 1 - src/pages/plan/AddToTripPlan/OurLikedList.tsx | 1 - src/pages/plan/AddToTripPlan/OurLikedListItem.tsx | 1 - src/pages/plan/addToOurPlace/MyLikedList.tsx | 1 - src/pages/plan/addToOurPlace/MyLikedListItem.tsx | 1 - src/pages/plan/addToOurPlace/ResultCategoryPlan.tsx | 1 - src/pages/plan/addToOurPlace/ResultItem.tsx | 1 - 13 files changed, 14 deletions(-) diff --git a/src/components/Tours/ToursCategory.tsx b/src/components/Tours/ToursCategory.tsx index c7f72853..8042e180 100644 --- a/src/components/Tours/ToursCategory.tsx +++ b/src/components/Tours/ToursCategory.tsx @@ -1,4 +1,3 @@ -import { RegionTypes, ToursCategoryProps } from '@/@types/tours.types'; import ToursCategoryItem from './ToursCategoryItem'; import { getPopularRegion } from '@api/region'; import { Swiper, SwiperSlide } from 'swiper/react'; diff --git a/src/components/Tours/ToursCategoryItem.tsx b/src/components/Tours/ToursCategoryItem.tsx index f7e62cb3..f6a11688 100644 --- a/src/components/Tours/ToursCategoryItem.tsx +++ b/src/components/Tours/ToursCategoryItem.tsx @@ -1,5 +1,3 @@ -import { ToursCategoryItemProps } from '@/@types/tours.types'; - const ToursCategoryItem = ({ name, isSelected, diff --git a/src/components/Tours/ToursList.tsx b/src/components/Tours/ToursList.tsx index 45888808..5edc8611 100644 --- a/src/components/Tours/ToursList.tsx +++ b/src/components/Tours/ToursList.tsx @@ -1,4 +1,3 @@ -import { TourType, ToursListProps } from '@/@types/tours.types'; import { getTours } from '@api/tours'; import { useInfiniteQuery } from '@tanstack/react-query'; import React, { useEffect, useState } from 'react'; diff --git a/src/components/Wish/WishItem.tsx b/src/components/Wish/WishItem.tsx index 8a27f666..ffb1d665 100644 --- a/src/components/Wish/WishItem.tsx +++ b/src/components/Wish/WishItem.tsx @@ -1,4 +1,3 @@ -import { TourType } from '@/@types/tours.types'; import { HeartIcon, StarIcon } from '@components/common/icons/Icons'; import Like from '@components/common/like/Like'; import { useEffect, useState } from 'react'; diff --git a/src/components/Wish/WishList.tsx b/src/components/Wish/WishList.tsx index 45c2f717..c4fbb68d 100644 --- a/src/components/Wish/WishList.tsx +++ b/src/components/Wish/WishList.tsx @@ -3,7 +3,6 @@ import InfiniteScroll from 'react-infinite-scroller'; import { v4 as uuidv4 } from 'uuid'; import WishItem from './WishItem'; import ToursItemSkeleton from '@components/Tours/ToursItemSkeleton'; -import { TourType } from '@/@types/tours.types'; import { Spinner } from '@components/common/spinner/Spinner'; interface WishListProps { diff --git a/src/components/search/ResultCategory.tsx b/src/components/search/ResultCategory.tsx index e6447af1..3f321437 100644 --- a/src/components/search/ResultCategory.tsx +++ b/src/components/search/ResultCategory.tsx @@ -1,5 +1,4 @@ import { ButtonWhite } from '@components/common/button/Button'; -import { TourType } from '@/@types/tours.types'; import { InfiniteQueryObserverResult } from '@tanstack/react-query'; import { ResultItem } from './ResultItem'; diff --git a/src/components/search/ResultItem.tsx b/src/components/search/ResultItem.tsx index 47c86ecc..36785a4d 100644 --- a/src/components/search/ResultItem.tsx +++ b/src/components/search/ResultItem.tsx @@ -1,4 +1,3 @@ -import { TourType } from '@/@types/tours.types'; import { useNavigate } from 'react-router-dom'; export const ResultItem = ({ result }: { result: TourType }) => { diff --git a/src/pages/plan/AddToTripPlan/OurLikedList.tsx b/src/pages/plan/AddToTripPlan/OurLikedList.tsx index 76d48865..512ef578 100644 --- a/src/pages/plan/AddToTripPlan/OurLikedList.tsx +++ b/src/pages/plan/AddToTripPlan/OurLikedList.tsx @@ -2,7 +2,6 @@ import React from 'react'; import InfiniteScroll from 'react-infinite-scroller'; import { v4 as uuidv4 } from 'uuid'; import { OurLikedListItem } from './OurLikedListItem'; -import { LikedListType } from '@/@types/tours.types'; import { Spinner } from '@components/common/spinner/Spinner'; interface WishListProps { diff --git a/src/pages/plan/AddToTripPlan/OurLikedListItem.tsx b/src/pages/plan/AddToTripPlan/OurLikedListItem.tsx index 19a20840..3548e423 100644 --- a/src/pages/plan/AddToTripPlan/OurLikedListItem.tsx +++ b/src/pages/plan/AddToTripPlan/OurLikedListItem.tsx @@ -1,4 +1,3 @@ -import { LikedListType } from '@/@types/tours.types'; import { ListCheckBtn } from '@components/common/button/ListSelectBtn'; import { StarIcon } from '@components/common/icons/Icons'; import { selectedItemsState } from '@recoil/listItem'; diff --git a/src/pages/plan/addToOurPlace/MyLikedList.tsx b/src/pages/plan/addToOurPlace/MyLikedList.tsx index 6979f41a..c8acd8d7 100644 --- a/src/pages/plan/addToOurPlace/MyLikedList.tsx +++ b/src/pages/plan/addToOurPlace/MyLikedList.tsx @@ -2,7 +2,6 @@ import React from 'react'; import InfiniteScroll from 'react-infinite-scroller'; import { v4 as uuidv4 } from 'uuid'; import { MyLikedListItem } from './MyLikedListItem'; -import { TourType } from '@/@types/tours.types'; import { Spinner } from '@components/common/spinner/Spinner'; interface WishListProps { diff --git a/src/pages/plan/addToOurPlace/MyLikedListItem.tsx b/src/pages/plan/addToOurPlace/MyLikedListItem.tsx index 67628128..852b5ddd 100644 --- a/src/pages/plan/addToOurPlace/MyLikedListItem.tsx +++ b/src/pages/plan/addToOurPlace/MyLikedListItem.tsx @@ -1,4 +1,3 @@ -import { TourType } from '@/@types/tours.types'; import { ListCheckBtn } from '@components/common/button/ListSelectBtn'; import { StarIcon } from '@components/common/icons/Icons'; import { selectedItemsState } from '@recoil/listItem'; diff --git a/src/pages/plan/addToOurPlace/ResultCategoryPlan.tsx b/src/pages/plan/addToOurPlace/ResultCategoryPlan.tsx index b8988d18..e7fd80f2 100644 --- a/src/pages/plan/addToOurPlace/ResultCategoryPlan.tsx +++ b/src/pages/plan/addToOurPlace/ResultCategoryPlan.tsx @@ -1,5 +1,4 @@ import { ButtonWhite } from '@components/common/button/Button'; -import { TourType } from '@/@types/tours.types'; import { InfiniteQueryObserverResult } from '@tanstack/react-query'; import { ResultItemPlan } from './ResultItem'; import AddToListButton from './AddtoListBtn'; diff --git a/src/pages/plan/addToOurPlace/ResultItem.tsx b/src/pages/plan/addToOurPlace/ResultItem.tsx index 7d027aaa..9b99dc1e 100644 --- a/src/pages/plan/addToOurPlace/ResultItem.tsx +++ b/src/pages/plan/addToOurPlace/ResultItem.tsx @@ -1,4 +1,3 @@ -import { TourType } from '@/@types/tours.types'; import { ListSelectBtn } from '@components/common/button/ListSelectBtn'; import { StarIcon } from '@components/common/icons/Icons'; import { selectedItemsState } from '@recoil/listItem'; From bd1d50ffca70710882985e5ce8356c1fb3ef86d1 Mon Sep 17 00:00:00 2001 From: Shim Jeong ah <35457850+joanShim@users.noreply.github.com> Date: Thu, 25 Jan 2024 15:07:20 +0900 Subject: [PATCH 35/68] =?UTF-8?q?Fix:=20=EC=97=AC=ED=96=89=EC=A7=80=20?= =?UTF-8?q?=EA=B2=80=EC=83=89=20=EC=A7=80=EC=97=AD=20=ED=8C=8C=EB=9D=BC?= =?UTF-8?q?=EB=AF=B8=ED=84=B0=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/search/RegionSelect.tsx | 9 +++++---- src/constants.ts | 18 +++++++++--------- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/src/components/search/RegionSelect.tsx b/src/components/search/RegionSelect.tsx index f0383b42..2a5c69ec 100644 --- a/src/components/search/RegionSelect.tsx +++ b/src/components/search/RegionSelect.tsx @@ -9,15 +9,16 @@ export const RegionSelect = ({}) => { const [selectedRegion, setSelectedRegion] = useState(''); // 지역값 쿼리스트링으로 저장 - const onRegionSelect = (value: string) => { + const onRegionSelect = (key: string) => { const queryParams = new URLSearchParams(location.search); + const value = AREA_CODE[key as keyof typeof AREA_CODE]; - if (value === selectedRegion) { + if (key === selectedRegion) { queryParams.delete('region'); setSelectedRegion(''); } else { queryParams.set('region', value); - setSelectedRegion(value); + setSelectedRegion(key); } navigate( @@ -30,6 +31,6 @@ export const RegionSelect = ({}) => { }; return ( - + ); }; diff --git a/src/constants.ts b/src/constants.ts index 37e408d4..c50f848b 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -6,14 +6,14 @@ export const AREA_CODE = { 광주: '광주', 대전: '대전', 울산: '울산', - 세종: '세종', + 세종: '세종특별자치시', 제주: '제주', - 경기: '경기', - 강원: '강원', - 충북: '충북', - 충남: '충남', - 경북: '경북', - 경남: '경남', - 전북: '전북', - 전남: '전남', + 경기: '경기도', + 강원: '강원도', + 충북: '충청북도', + 충남: '충청남도', + 경북: '경상북도', + 경남: '경상남도', + 전북: '전라북도', + 전남: '전라남도', }; From ab1fc67c1039878d1fb56a13f319570b6df9a614 Mon Sep 17 00:00:00 2001 From: Shim Jeong ah <35457850+joanShim@users.noreply.github.com> Date: Thu, 25 Jan 2024 15:11:06 +0900 Subject: [PATCH 36/68] =?UTF-8?q?Chore:=20=EC=95=88=EB=82=B4=20=EC=9B=8C?= =?UTF-8?q?=EB=94=A9=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Tours/CreateTripButton.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/Tours/CreateTripButton.tsx b/src/components/Tours/CreateTripButton.tsx index 27026623..0cffb946 100644 --- a/src/components/Tours/CreateTripButton.tsx +++ b/src/components/Tours/CreateTripButton.tsx @@ -45,9 +45,9 @@ const CreateTripButton = () => { title={'로그인'} message={ <> - 로그인이 필요한 기능입니다. + 여정을 계획하려면 로그인이 필요해요.
- 로그인 하시겠습니까? + 로그인하러 가볼까요? } onConfirm={handleConfirm}> From eaf7e10e586be5f5e80720f303181b4169401179 Mon Sep 17 00:00:00 2001 From: NohWookJin Date: Thu, 25 Jan 2024 15:11:53 +0900 Subject: [PATCH 37/68] =?UTF-8?q?style:=20=EC=9C=84=EC=B9=98=20truncate=20?= =?UTF-8?q?=EC=A0=81=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/DetailSectionTop/DetailToursMap.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/DetailSectionTop/DetailToursMap.tsx b/src/components/DetailSectionTop/DetailToursMap.tsx index 07871ac0..651433f4 100644 --- a/src/components/DetailSectionTop/DetailToursMap.tsx +++ b/src/components/DetailSectionTop/DetailToursMap.tsx @@ -42,7 +42,7 @@ export default function DetailToursMap({ mapData }: DetailToursMapProps) {
-

+

{fullAddress}

From 7ece2ebe1db5073d5c2495a79916f8a73f6a2454 Mon Sep 17 00:00:00 2001 From: NohWookJin Date: Thu, 25 Jan 2024 15:12:31 +0900 Subject: [PATCH 38/68] =?UTF-8?q?refactor:=20=EA=B0=92=20=EC=97=86?= =?UTF-8?q?=EC=9D=84=EC=8B=9C=20null=20=EB=B0=98=ED=99=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/MyTrip/MyTripAfterList.tsx | 28 +++++++++++++---------- 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/src/components/MyTrip/MyTripAfterList.tsx b/src/components/MyTrip/MyTripAfterList.tsx index ec33c2de..3afc4806 100644 --- a/src/components/MyTrip/MyTripAfterList.tsx +++ b/src/components/MyTrip/MyTripAfterList.tsx @@ -17,18 +17,22 @@ const MyTripAfterList: React.FC = ({ myTripsData }) => { new Date(a.startDate).getTime() - new Date(b.startDate).getTime(), ); - return ( - <> -
-

지난 여행

-
-
- {sortedTrips.map((myTripList: MyTripType) => ( - - ))} -
- - ); + if (sortedTrips.length > 0) { + return ( + <> +
+

지난 여행

+
+
+ {sortedTrips.map((myTripList: MyTripType) => ( + + ))} +
+ + ); + } else { + return null; + } }; export default MyTripAfterList; From 66abdbea22ac3d40330b1c9225f7b4fbb2970a2e Mon Sep 17 00:00:00 2001 From: NohWookJin Date: Thu, 25 Jan 2024 15:13:01 +0900 Subject: [PATCH 39/68] =?UTF-8?q?style:=20=EC=9B=8C=EB=94=A9=20qa=20?= =?UTF-8?q?=EA=B8=B0=EB=B0=98=20=EC=A0=95=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/MyTrip/MyTrip.tsx | 2 +- src/components/Trip/LikedToursList.tsx | 63 ++++++++++++++++++++------ src/components/Wish/Wish.tsx | 2 +- src/components/common/like/Like.tsx | 4 +- src/components/common/nav/Nav.tsx | 8 ++-- 5 files changed, 58 insertions(+), 21 deletions(-) diff --git a/src/components/MyTrip/MyTrip.tsx b/src/components/MyTrip/MyTrip.tsx index ae8ed92e..13ade56e 100644 --- a/src/components/MyTrip/MyTrip.tsx +++ b/src/components/MyTrip/MyTrip.tsx @@ -42,7 +42,7 @@ const MyTrip = () => { ) : ( } /> diff --git a/src/components/Trip/LikedToursList.tsx b/src/components/Trip/LikedToursList.tsx index c2b4e969..407e398a 100644 --- a/src/components/Trip/LikedToursList.tsx +++ b/src/components/Trip/LikedToursList.tsx @@ -1,4 +1,4 @@ -import { useState } from 'react'; +import { useEffect, useState } from 'react'; import { useNavigate, useParams } from 'react-router-dom'; import { useInfiniteQuery } from '@tanstack/react-query'; @@ -8,8 +8,10 @@ import NoDataMessage from '@components/common/noData/NoDataMessage'; import { getTripsLike } from '@api/trips'; import { HeartIcon, NewIcon } from '@components/common/icons/Icons'; +import Alert from '@components/common/alert/Alert'; export const LikedToursList = () => { + const [isLoggedIn, setIsLoggedIn] = useState(false); const [selectedContentTypeId, setSelectedContentTypeId] = useState< null | number >(null); @@ -18,7 +20,7 @@ export const LikedToursList = () => { const { id: tripId } = useParams(); if (!tripId) { - return; + return null; } const { fetchNextPage, hasNextPage, data, isLoading, error } = @@ -52,6 +54,19 @@ export const LikedToursList = () => { setSelectedContentTypeId(contentTypeId); }; + const handleConfirm = () => { + navigate('/login'); + }; + + useEffect(() => { + const token = window.localStorage.getItem('accessToken'); + if (token) { + setIsLoggedIn(true); + } else { + setIsLoggedIn(false); + } + }, []); + return (
@@ -70,7 +85,7 @@ export const LikedToursList = () => { ) : (
} /> @@ -78,16 +93,38 @@ export const LikedToursList = () => { )} {/* 우리의 관심 여행지 추가 버튼 => 검색 라우터 이동 */} -
- -
+ {isLoggedIn ? ( +
+ +
+ ) : ( + + 관심 여행지를 추가하려면 로그인이 필요해요. +
+ 로그인하러 가볼까요? + + } + onConfirm={handleConfirm}> +
+ +
+
+ )}
); }; diff --git a/src/components/Wish/Wish.tsx b/src/components/Wish/Wish.tsx index 11c5d8ef..8554eab4 100644 --- a/src/components/Wish/Wish.tsx +++ b/src/components/Wish/Wish.tsx @@ -60,7 +60,7 @@ const Wish = () => { /> ) : ( } /> diff --git a/src/components/common/like/Like.tsx b/src/components/common/like/Like.tsx index 159bf56d..8ab6504c 100644 --- a/src/components/common/like/Like.tsx +++ b/src/components/common/like/Like.tsx @@ -75,9 +75,9 @@ const Like = ({ liked, id }: LikeProps) => { title={'로그인'} message={ <> - 관심 목록 등록시 로그인이 필요합니다. + 관심 여행지를 추가하려면 로그인이 필요해요.
- 로그인 하시겠습니까? + 로그인하러 가볼까요? } onConfirm={handleConfirm} diff --git a/src/components/common/nav/Nav.tsx b/src/components/common/nav/Nav.tsx index c26329ac..912da64f 100644 --- a/src/components/common/nav/Nav.tsx +++ b/src/components/common/nav/Nav.tsx @@ -66,9 +66,9 @@ const Nav = () => { title={'로그인'} message={ <> - 나의 여정 조회를 위해 로그인이 필요합니다. + 여정을 관리하려면 로그인이 필요해요.
- 로그인 하시겠습니까? + 로그인하러 가볼까요? } onConfirm={handleConfirm}> @@ -105,9 +105,9 @@ const Nav = () => { title={'로그인'} message={ <> - 관심 목록 조회를 위해 로그인이 필요합니다. + 관심 여행지를 관리하려면 로그인이 필요해요.
- 로그인 하시겠습니까? + 로그인하러 가볼까요? } onConfirm={handleConfirm}> From f83cd5ef62aadc6a87daa945c920c0a5ccbb083d Mon Sep 17 00:00:00 2001 From: NohWookJin Date: Thu, 25 Jan 2024 15:14:37 +0900 Subject: [PATCH 40/68] =?UTF-8?q?style:=20=EC=8D=B8=EB=84=A4=EC=9D=BC=20?= =?UTF-8?q?=EB=AA=A8=EC=96=91=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/MyTrip/MyTripIngItem.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/MyTrip/MyTripIngItem.tsx b/src/components/MyTrip/MyTripIngItem.tsx index ca0d08d4..2ac15a77 100644 --- a/src/components/MyTrip/MyTripIngItem.tsx +++ b/src/components/MyTrip/MyTripIngItem.tsx @@ -19,7 +19,7 @@ const MyTripIngItem: React.FC = ({ myTripList }) => {
여행지 이미지 From acce36a14486302d7dc120b46c90aafb468ae612 Mon Sep 17 00:00:00 2001 From: Shim Jeong ah <35457850+joanShim@users.noreply.github.com> Date: Thu, 25 Jan 2024 15:16:19 +0900 Subject: [PATCH 41/68] =?UTF-8?q?Fix:=20=EC=98=A4=ED=86=A0=ED=8F=AC?= =?UTF-8?q?=EC=BB=A4=EC=8A=A4=20=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../plan => components/addToList}/AddToTripPlan/OurLiked.tsx | 0 .../addToList}/AddToTripPlan/OurLikedList.tsx | 0 .../addToList}/AddToTripPlan/OurLikedListItem.tsx | 0 .../addToList}/addToOurPlace/AddtoListBtn.tsx | 0 .../plan => components/addToList}/addToOurPlace/MyLiked.tsx | 0 .../addToList}/addToOurPlace/MyLikedList.tsx | 0 .../addToList}/addToOurPlace/MyLikedListItem.tsx | 0 .../addToList}/addToOurPlace/PlanAddPlace.page.tsx | 0 .../addToList}/addToOurPlace/ResultCategoryPlan.tsx | 0 .../addToList}/addToOurPlace/ResultItem.tsx | 0 .../addToList}/addToOurPlace/SearchResult.tsx | 0 src/pages/create/createTrip.page.tsx | 1 - src/pages/trip/AddOurList.page.tsx | 4 ++-- src/router/socketRouter.tsx | 2 +- 14 files changed, 3 insertions(+), 4 deletions(-) rename src/{pages/plan => components/addToList}/AddToTripPlan/OurLiked.tsx (100%) rename src/{pages/plan => components/addToList}/AddToTripPlan/OurLikedList.tsx (100%) rename src/{pages/plan => components/addToList}/AddToTripPlan/OurLikedListItem.tsx (100%) rename src/{pages/plan => components/addToList}/addToOurPlace/AddtoListBtn.tsx (100%) rename src/{pages/plan => components/addToList}/addToOurPlace/MyLiked.tsx (100%) rename src/{pages/plan => components/addToList}/addToOurPlace/MyLikedList.tsx (100%) rename src/{pages/plan => components/addToList}/addToOurPlace/MyLikedListItem.tsx (100%) rename src/{pages/plan => components/addToList}/addToOurPlace/PlanAddPlace.page.tsx (100%) rename src/{pages/plan => components/addToList}/addToOurPlace/ResultCategoryPlan.tsx (100%) rename src/{pages/plan => components/addToList}/addToOurPlace/ResultItem.tsx (100%) rename src/{pages/plan => components/addToList}/addToOurPlace/SearchResult.tsx (100%) diff --git a/src/pages/plan/AddToTripPlan/OurLiked.tsx b/src/components/addToList/AddToTripPlan/OurLiked.tsx similarity index 100% rename from src/pages/plan/AddToTripPlan/OurLiked.tsx rename to src/components/addToList/AddToTripPlan/OurLiked.tsx diff --git a/src/pages/plan/AddToTripPlan/OurLikedList.tsx b/src/components/addToList/AddToTripPlan/OurLikedList.tsx similarity index 100% rename from src/pages/plan/AddToTripPlan/OurLikedList.tsx rename to src/components/addToList/AddToTripPlan/OurLikedList.tsx diff --git a/src/pages/plan/AddToTripPlan/OurLikedListItem.tsx b/src/components/addToList/AddToTripPlan/OurLikedListItem.tsx similarity index 100% rename from src/pages/plan/AddToTripPlan/OurLikedListItem.tsx rename to src/components/addToList/AddToTripPlan/OurLikedListItem.tsx diff --git a/src/pages/plan/addToOurPlace/AddtoListBtn.tsx b/src/components/addToList/addToOurPlace/AddtoListBtn.tsx similarity index 100% rename from src/pages/plan/addToOurPlace/AddtoListBtn.tsx rename to src/components/addToList/addToOurPlace/AddtoListBtn.tsx diff --git a/src/pages/plan/addToOurPlace/MyLiked.tsx b/src/components/addToList/addToOurPlace/MyLiked.tsx similarity index 100% rename from src/pages/plan/addToOurPlace/MyLiked.tsx rename to src/components/addToList/addToOurPlace/MyLiked.tsx diff --git a/src/pages/plan/addToOurPlace/MyLikedList.tsx b/src/components/addToList/addToOurPlace/MyLikedList.tsx similarity index 100% rename from src/pages/plan/addToOurPlace/MyLikedList.tsx rename to src/components/addToList/addToOurPlace/MyLikedList.tsx diff --git a/src/pages/plan/addToOurPlace/MyLikedListItem.tsx b/src/components/addToList/addToOurPlace/MyLikedListItem.tsx similarity index 100% rename from src/pages/plan/addToOurPlace/MyLikedListItem.tsx rename to src/components/addToList/addToOurPlace/MyLikedListItem.tsx diff --git a/src/pages/plan/addToOurPlace/PlanAddPlace.page.tsx b/src/components/addToList/addToOurPlace/PlanAddPlace.page.tsx similarity index 100% rename from src/pages/plan/addToOurPlace/PlanAddPlace.page.tsx rename to src/components/addToList/addToOurPlace/PlanAddPlace.page.tsx diff --git a/src/pages/plan/addToOurPlace/ResultCategoryPlan.tsx b/src/components/addToList/addToOurPlace/ResultCategoryPlan.tsx similarity index 100% rename from src/pages/plan/addToOurPlace/ResultCategoryPlan.tsx rename to src/components/addToList/addToOurPlace/ResultCategoryPlan.tsx diff --git a/src/pages/plan/addToOurPlace/ResultItem.tsx b/src/components/addToList/addToOurPlace/ResultItem.tsx similarity index 100% rename from src/pages/plan/addToOurPlace/ResultItem.tsx rename to src/components/addToList/addToOurPlace/ResultItem.tsx diff --git a/src/pages/plan/addToOurPlace/SearchResult.tsx b/src/components/addToList/addToOurPlace/SearchResult.tsx similarity index 100% rename from src/pages/plan/addToOurPlace/SearchResult.tsx rename to src/components/addToList/addToOurPlace/SearchResult.tsx diff --git a/src/pages/create/createTrip.page.tsx b/src/pages/create/createTrip.page.tsx index acaf0422..09a65f51 100644 --- a/src/pages/create/createTrip.page.tsx +++ b/src/pages/create/createTrip.page.tsx @@ -102,7 +102,6 @@ export const CreateTrip = () => { onChange={(e) => { setTitle(e.target.value); }} - autoFocus /> {title && (
Date: Thu, 25 Jan 2024 15:16:41 +0900 Subject: [PATCH 42/68] =?UTF-8?q?style:=20=EA=B8=B0=ED=98=B8=20=EB=B3=80?= =?UTF-8?q?=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/MyTrip/MyTripIngItem.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/MyTrip/MyTripIngItem.tsx b/src/components/MyTrip/MyTripIngItem.tsx index 2ac15a77..a18c33da 100644 --- a/src/components/MyTrip/MyTripIngItem.tsx +++ b/src/components/MyTrip/MyTripIngItem.tsx @@ -36,7 +36,7 @@ const MyTripIngItem: React.FC = ({ myTripList }) => {
- {startDate.replace(/-/g, '.')} ~{' '} + {startDate.replace(/-/g, '.')} -{' '} {endDate.replace(/-/g, '.').split('2024.')}{' '} {tripDuration === '0박 1일' ? null : ` (${tripDuration})`}
From 4b2425e8e86fb96eff803957ab08defcff061101 Mon Sep 17 00:00:00 2001 From: Shim Jeong ah <35457850+joanShim@users.noreply.github.com> Date: Thu, 25 Jan 2024 15:53:44 +0900 Subject: [PATCH 43/68] =?UTF-8?q?Design:=20=EA=B2=80=EC=83=89=EB=B2=84?= =?UTF-8?q?=ED=8A=BC=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/search/StartSearchBtn.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/search/StartSearchBtn.tsx b/src/components/search/StartSearchBtn.tsx index 0ec5b0f0..000b3d30 100644 --- a/src/components/search/StartSearchBtn.tsx +++ b/src/components/search/StartSearchBtn.tsx @@ -1,5 +1,5 @@ import { useNavigate } from 'react-router-dom'; -import { ReactComponent as SearchIcon } from '@assets/images/Search.svg'; +import { SearchIcon } from '@components/common/icons/Icons'; export const StartSearchButton = () => { const navigate = useNavigate(); @@ -10,10 +10,10 @@ export const StartSearchButton = () => { return ( ); }; From 5a85a7afab94fd4221594a909da90753c3092161 Mon Sep 17 00:00:00 2001 From: Hojin Date: Thu, 25 Jan 2024 16:23:19 +0900 Subject: [PATCH 44/68] =?UTF-8?q?Feat:=20=EC=9D=BC=EC=A0=95=EC=9D=B4=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80=EB=90=98=EC=97=88=EC=96=B4=EC=9A=94=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DetailSectionTop/DetailAddSchedule.tsx | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/src/components/DetailSectionTop/DetailAddSchedule.tsx b/src/components/DetailSectionTop/DetailAddSchedule.tsx index 6f32843d..a66d8913 100644 --- a/src/components/DetailSectionTop/DetailAddSchedule.tsx +++ b/src/components/DetailSectionTop/DetailAddSchedule.tsx @@ -11,6 +11,7 @@ import { useState, useEffect } from 'react'; import { postTripsItem } from '@api/trips'; import { useParams } from 'react-router-dom'; import { Swiper, SwiperSlide } from 'swiper/react'; +import ToastPopUp from '@components/common/toastpopup/ToastPopUp'; const DetailAddSchedule = () => { const token = localStorage.getItem('accessToken'); @@ -30,6 +31,12 @@ const DetailAddSchedule = () => { (trip) => trip.tripStatus !== '여행완료', ); + const [toastPopUp, setToastPopUp] = useState({ + isPopUp: false, + noun: '', + verb: '', + }); + const handleNavigate = (url: string) => { navigate(url); }; @@ -63,6 +70,11 @@ const DetailAddSchedule = () => { } catch (error) { console.error('요청 실패:', error); } finally { + setToastPopUp(() => ({ + isPopUp: true, + noun: '일정', + verb: '추가', + })); setIsProcessing(false); } } @@ -79,8 +91,24 @@ const DetailAddSchedule = () => { } }, [isOpen]); + useEffect(() => { + if (toastPopUp.isPopUp) { + const timer = setTimeout(() => { + setToastPopUp(() => ({ + isPopUp: false, + noun: '', + verb: '', + })); + }, 2000); + return () => clearTimeout(timer); + } + }, [toastPopUp]); + return ( <> + {toastPopUp.isPopUp && ( + + )} {token ? ( From 487674bdeb1668c1bc2dd9a877b4089e354f3873 Mon Sep 17 00:00:00 2001 From: NohWookJin Date: Thu, 25 Jan 2024 16:28:51 +0900 Subject: [PATCH 45/68] =?UTF-8?q?style:=20=EB=94=94=EC=9E=90=EC=9D=B8=20qa?= =?UTF-8?q?=20=EB=B0=98=EC=98=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DetailSectionTop/DetailAddSchedule.tsx | 8 +- .../DetailSectionTop/DetailToursButtons.tsx | 4 +- .../DetailSectionTop/DetailToursInfo.tsx | 6 +- .../DetailSectionTop/DetailToursMap.tsx | 2 +- .../DetailSectionTop/DetailToursRating.tsx | 6 +- src/components/Wish/WishCategory.tsx | 4 +- src/components/Wish/WishCategoryItem.tsx | 2 +- src/components/Wish/WishItem.tsx | 6 +- src/components/common/header/DetailHeader.tsx | 2 +- src/components/common/icons/Icons.tsx | 104 ++++-------------- 10 files changed, 38 insertions(+), 106 deletions(-) diff --git a/src/components/DetailSectionTop/DetailAddSchedule.tsx b/src/components/DetailSectionTop/DetailAddSchedule.tsx index 6f32843d..7605494e 100644 --- a/src/components/DetailSectionTop/DetailAddSchedule.tsx +++ b/src/components/DetailSectionTop/DetailAddSchedule.tsx @@ -85,8 +85,8 @@ const DetailAddSchedule = () => { @@ -244,8 +244,8 @@ const DetailAddSchedule = () => { } onConfirm={() => handleNavigate('/login')}> )} diff --git a/src/components/DetailSectionTop/DetailToursButtons.tsx b/src/components/DetailSectionTop/DetailToursButtons.tsx index 49de97fb..d25e517d 100644 --- a/src/components/DetailSectionTop/DetailToursButtons.tsx +++ b/src/components/DetailSectionTop/DetailToursButtons.tsx @@ -48,8 +48,8 @@ export default function DetailTourButtons({
diff --git a/src/components/DetailSectionTop/DetailToursInfo.tsx b/src/components/DetailSectionTop/DetailToursInfo.tsx index 8af2a5ee..7b3eaba3 100644 --- a/src/components/DetailSectionTop/DetailToursInfo.tsx +++ b/src/components/DetailSectionTop/DetailToursInfo.tsx @@ -9,7 +9,7 @@ export default function DetailToursInfo({ infoData }: DetailToursInfoProps) { return ( <> -
+
tour-image
-

- {title} -

+

{title}

diff --git a/src/components/DetailSectionTop/DetailToursMap.tsx b/src/components/DetailSectionTop/DetailToursMap.tsx index 651433f4..7bec6bc9 100644 --- a/src/components/DetailSectionTop/DetailToursMap.tsx +++ b/src/components/DetailSectionTop/DetailToursMap.tsx @@ -17,7 +17,7 @@ export default function DetailToursMap({ mapData }: DetailToursMapProps) { const MapStyle = { width: '100%', - height: '180px', + height: '160px', marginTop: '5px', marginBottom: '15px', }; diff --git a/src/components/DetailSectionTop/DetailToursRating.tsx b/src/components/DetailSectionTop/DetailToursRating.tsx index d92303d2..4f10b83d 100644 --- a/src/components/DetailSectionTop/DetailToursRating.tsx +++ b/src/components/DetailSectionTop/DetailToursRating.tsx @@ -44,7 +44,7 @@ export default function DetailToursRating({
{STAR_IDX_ARR.map((item, idx) => { return ( - + ); })} -
-

+

+

({reviewTotalCount})

diff --git a/src/components/Wish/WishCategory.tsx b/src/components/Wish/WishCategory.tsx index c288671b..a97b89ad 100644 --- a/src/components/Wish/WishCategory.tsx +++ b/src/components/Wish/WishCategory.tsx @@ -10,9 +10,9 @@ const WishCategory: React.FC = ({ onCategoryClick }) => { const categories = [ { code: null, name: '전체' }, - { code: 12, name: '관광지' }, { code: 32, name: '숙소' }, { code: 39, name: '식당' }, + { code: 12, name: '관광지' }, ]; const handleSelectCategory = (name: string) => { @@ -25,7 +25,7 @@ const WishCategory: React.FC = ({ onCategoryClick }) => { }; return ( -
+
{categories.map((category) => { return ( = ({ return ( ); diff --git a/src/components/Wish/WishItem.tsx b/src/components/Wish/WishItem.tsx index 8a27f666..1589ba30 100644 --- a/src/components/Wish/WishItem.tsx +++ b/src/components/Wish/WishItem.tsx @@ -33,12 +33,12 @@ const WishItem: React.FC = ({ wishList }) => { return (
navigate(`/detail/${id}`)}>
여행지 이미지 @@ -48,7 +48,7 @@ const WishItem: React.FC = ({ wishList }) => {
-
+

{title}

diff --git a/src/components/common/header/DetailHeader.tsx b/src/components/common/header/DetailHeader.tsx index c008416d..2350511d 100644 --- a/src/components/common/header/DetailHeader.tsx +++ b/src/components/common/header/DetailHeader.tsx @@ -13,7 +13,7 @@ export default function DetailHeader() { }; return ( -
+
diff --git a/src/components/common/icons/Icons.tsx b/src/components/common/icons/Icons.tsx index a33a26b2..13f9428f 100644 --- a/src/components/common/icons/Icons.tsx +++ b/src/components/common/icons/Icons.tsx @@ -34,7 +34,7 @@ export const HomeIcon: React.FC = ({ }; export const CalendarIcon: React.FC = ({ - size = 25, + size = 20, color = 'black', fill = 'none', className, @@ -44,77 +44,14 @@ export const CalendarIcon: React.FC = ({ xmlns="http://www.w3.org/2000/svg" width={size} height={size} - className={className} - viewBox="0 0 25 25" - fill={fill}> - - - - - - - - - + viewBox="0 0 21 21" + color={color} + fill={fill} + className={className}> @@ -342,7 +279,7 @@ export const MapIcon: React.FC = ({ }; export const PenIcon: React.FC = ({ - size = 25, + size = 20, color = 'black', fill = 'none', className, @@ -386,24 +323,21 @@ export const PenIcon: React.FC = ({ }; export const PhoneIcon: React.FC = ({ - size = 25, - color = 'black', - fill = 'none', + size = 20, + color = '#888888', + fill = '#888888', }) => { return ( - - - + viewBox="0 0 21 21" + fill={fill}> + ); }; From 62bfb61872d2c2cd86bb6b83bfdd8538acb52429 Mon Sep 17 00:00:00 2001 From: NohWookJin Date: Thu, 25 Jan 2024 16:40:46 +0900 Subject: [PATCH 46/68] =?UTF-8?q?style:=20nav=20=EC=8B=A0=EA=B7=9C=20?= =?UTF-8?q?=EB=94=94=EC=9E=90=EC=9D=B8=20=EB=B0=98=EC=98=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/common/nav/Nav.tsx | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/src/components/common/nav/Nav.tsx b/src/components/common/nav/Nav.tsx index 912da64f..e0b3e51c 100644 --- a/src/components/common/nav/Nav.tsx +++ b/src/components/common/nav/Nav.tsx @@ -1,6 +1,6 @@ import { useLocation, useNavigate } from 'react-router-dom'; import { - CalendarIcon, + CalendarIcon3, CalendarIcon2, HeartIcon, HomeIcon, @@ -45,7 +45,9 @@ const Nav = () => { fill={isActive('/') ? 'currentColor' : 'none'} />
-

+

+ 홈 +

{isLoggedIn ? ( @@ -56,10 +58,12 @@ const Nav = () => { {isActive('/mytrip') ? ( ) : ( - + )}
-

여정

+

+ 일정 +

) : ( { onConfirm={handleConfirm}>
-
-

- 여정 +

+ 일정

@@ -96,7 +100,7 @@ const Nav = () => { fill={isActive('/wishlist') ? 'currentColor' : 'none'} />
-

+

관심목록

@@ -118,7 +122,7 @@ const Nav = () => { fill={isActive('/wishlist') ? 'currentColor' : 'none'} />
-

+

관심목록

@@ -134,7 +138,9 @@ const Nav = () => { fill={isActive('/mypage') ? 'currentColor' : 'none'} />
-

내정보

+

+ 내정보 +

From 594822a1bcea7080fa23323182426f278402fbc1 Mon Sep 17 00:00:00 2001 From: NohWookJin Date: Thu, 25 Jan 2024 16:40:59 +0900 Subject: [PATCH 47/68] =?UTF-8?q?style:=20=EB=94=94=EC=9E=90=EC=9D=B8=20qa?= =?UTF-8?q?=20=EC=A0=81=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../LikedToursListCategory.tsx | 4 +- .../LikedToursListCategoryItem.tsx | 2 +- .../LikedToursLists/LikedToursListItem.tsx | 4 +- src/components/common/icons/Icons.tsx | 89 +++++++++++++++++++ 4 files changed, 94 insertions(+), 5 deletions(-) diff --git a/src/components/Trip/LikedToursLists/LikedToursListCategory.tsx b/src/components/Trip/LikedToursLists/LikedToursListCategory.tsx index 8a243c2f..8e78be04 100644 --- a/src/components/Trip/LikedToursLists/LikedToursListCategory.tsx +++ b/src/components/Trip/LikedToursLists/LikedToursListCategory.tsx @@ -12,9 +12,9 @@ const LikedToursListCategory: React.FC = ({ const categories = [ { code: null, name: '전체' }, - { code: 12, name: '관광지' }, { code: 32, name: '숙소' }, { code: 39, name: '식당' }, + { code: 12, name: '관광지' }, ]; const handleSelectCategory = (name: string) => { @@ -27,7 +27,7 @@ const LikedToursListCategory: React.FC = ({ }; return ( -
+
{categories.map((category) => { return ( + className={`body4 mr-[8px] flex h-[32px] w-[58px] items-center justify-center whitespace-nowrap rounded-[30px] border border-solid bg-[#28D8FF] px-[16px] py-[7px] leading-normal ${buttonStyle}`}> {category.name} ); diff --git a/src/components/Trip/LikedToursLists/LikedToursListItem.tsx b/src/components/Trip/LikedToursLists/LikedToursListItem.tsx index 9f7e72a5..1a49bd58 100644 --- a/src/components/Trip/LikedToursLists/LikedToursListItem.tsx +++ b/src/components/Trip/LikedToursLists/LikedToursListItem.tsx @@ -72,12 +72,12 @@ const LikedToursListItem: React.FC = ({ return (
navigate(`/detail/${tourItemId}`)}>
여행지 이미지 diff --git a/src/components/common/icons/Icons.tsx b/src/components/common/icons/Icons.tsx index 13f9428f..ac991698 100644 --- a/src/components/common/icons/Icons.tsx +++ b/src/components/common/icons/Icons.tsx @@ -133,6 +133,95 @@ export const CalendarIcon2: React.FC = ({ size = 25 }) => { ); }; +export const CalendarIcon3: React.FC = ({ + size = 25, + color = 'black', + fill = 'none', + className, +}) => { + return ( + + + + + + + + + + + + + ); +}; + export const HeartIcon: React.FC = ({ size = 25, color = 'black', From da052d1358575a2eb9811ad6b412fe93f7ec7595 Mon Sep 17 00:00:00 2001 From: NohWookJin Date: Thu, 25 Jan 2024 16:44:16 +0900 Subject: [PATCH 48/68] =?UTF-8?q?style:=20=ED=8F=B0=ED=8A=B8=20=EC=BD=94?= =?UTF-8?q?=EB=93=9C=20=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Trip/LikedToursLists/LikedToursListItem.tsx | 2 +- src/components/Wish/WishItem.tsx | 4 ++-- src/components/common/noData/NoDataMessage.tsx | 8 ++------ 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/src/components/Trip/LikedToursLists/LikedToursListItem.tsx b/src/components/Trip/LikedToursLists/LikedToursListItem.tsx index 1a49bd58..4d4c7e85 100644 --- a/src/components/Trip/LikedToursLists/LikedToursListItem.tsx +++ b/src/components/Trip/LikedToursLists/LikedToursListItem.tsx @@ -85,7 +85,7 @@ const LikedToursListItem: React.FC = ({
-

+

{title}

diff --git a/src/components/Wish/WishItem.tsx b/src/components/Wish/WishItem.tsx index 1589ba30..2dc9eb98 100644 --- a/src/components/Wish/WishItem.tsx +++ b/src/components/Wish/WishItem.tsx @@ -49,7 +49,7 @@ const WishItem: React.FC = ({ wishList }) => {
-

+

{title}

@@ -58,7 +58,7 @@ const WishItem: React.FC = ({ wishList }) => { ? (tourAddress.match(/(.*?[시군구])/)?.[0] || '') + (tourAddress .replace(/(.*?[시군구])/, '') - .match(/(특별시|광역시)?.*?[시군구]/)?.[0] || '') + .match(/(특별`시|광역시)?.*?[시군구]/)?.[0] || '') : tourAddress?.match(/(.*?[시군구])/)?.[0]}

diff --git a/src/components/common/noData/NoDataMessage.tsx b/src/components/common/noData/NoDataMessage.tsx index 6e15c2d2..cab01453 100644 --- a/src/components/common/noData/NoDataMessage.tsx +++ b/src/components/common/noData/NoDataMessage.tsx @@ -15,13 +15,9 @@ const NoDataMessage: React.FC = ({
{icon}
-
- {message1} -
+
{message1}
-
- {message2} -
+
{message2}
From abc82a7a6e073142326a9d7b4843eee6042dea1b Mon Sep 17 00:00:00 2001 From: NohWookJin Date: Thu, 25 Jan 2024 17:04:47 +0900 Subject: [PATCH 49/68] =?UTF-8?q?style:=20=EB=94=94=EC=9E=90=EC=9D=B8=20qa?= =?UTF-8?q?=20=EC=A0=81=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Trip/LikedToursList.tsx | 2 +- src/components/Trip/LikedToursLists/LikedToursListItem.tsx | 2 +- src/components/Wish/Wish.tsx | 2 +- src/components/Wish/WishCategory.tsx | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/Trip/LikedToursList.tsx b/src/components/Trip/LikedToursList.tsx index 407e398a..9fa49f59 100644 --- a/src/components/Trip/LikedToursList.tsx +++ b/src/components/Trip/LikedToursList.tsx @@ -68,7 +68,7 @@ export const LikedToursList = () => { }, []); return ( -
+
{data?.pages[0].data.content.length > 0 ? ( diff --git a/src/components/Trip/LikedToursLists/LikedToursListItem.tsx b/src/components/Trip/LikedToursLists/LikedToursListItem.tsx index 4d4c7e85..c9e73827 100644 --- a/src/components/Trip/LikedToursLists/LikedToursListItem.tsx +++ b/src/components/Trip/LikedToursLists/LikedToursListItem.tsx @@ -85,7 +85,7 @@ const LikedToursListItem: React.FC = ({
-

+

{title}

diff --git a/src/components/Wish/Wish.tsx b/src/components/Wish/Wish.tsx index 8554eab4..560a700a 100644 --- a/src/components/Wish/Wish.tsx +++ b/src/components/Wish/Wish.tsx @@ -44,7 +44,7 @@ const Wish = () => { } return ( -
+

나의 관심 목록

diff --git a/src/components/Wish/WishCategory.tsx b/src/components/Wish/WishCategory.tsx index a97b89ad..7e9d55af 100644 --- a/src/components/Wish/WishCategory.tsx +++ b/src/components/Wish/WishCategory.tsx @@ -25,7 +25,7 @@ const WishCategory: React.FC = ({ onCategoryClick }) => { }; return ( -
+
{categories.map((category) => { return ( Date: Thu, 25 Jan 2024 17:15:52 +0900 Subject: [PATCH 50/68] =?UTF-8?q?style:=20=EC=97=AC=EC=A0=95=20=EB=94=94?= =?UTF-8?q?=EC=9E=90=EC=9D=B8=20qa?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/MyTrip/MyTrip.tsx | 2 +- src/components/MyTrip/MyTripAfterList.tsx | 4 ++-- src/components/MyTrip/MyTripBeforeList.tsx | 4 ++-- src/components/MyTrip/MyTripIngItem.tsx | 6 +++--- src/components/MyTrip/MyTripItem.tsx | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/components/MyTrip/MyTrip.tsx b/src/components/MyTrip/MyTrip.tsx index 13ade56e..c80f12fc 100644 --- a/src/components/MyTrip/MyTrip.tsx +++ b/src/components/MyTrip/MyTrip.tsx @@ -32,7 +32,7 @@ const MyTrip = () => { return (
-

나의 여정

+

나의 여정

{data.length > 0 ? ( <> diff --git a/src/components/MyTrip/MyTripAfterList.tsx b/src/components/MyTrip/MyTripAfterList.tsx index 3afc4806..c5d65cb4 100644 --- a/src/components/MyTrip/MyTripAfterList.tsx +++ b/src/components/MyTrip/MyTripAfterList.tsx @@ -20,8 +20,8 @@ const MyTripAfterList: React.FC = ({ myTripsData }) => { if (sortedTrips.length > 0) { return ( <> -
-

지난 여행

+
+

지난 여행

{sortedTrips.map((myTripList: MyTripType) => ( diff --git a/src/components/MyTrip/MyTripBeforeList.tsx b/src/components/MyTrip/MyTripBeforeList.tsx index e4d27037..88dc770f 100644 --- a/src/components/MyTrip/MyTripBeforeList.tsx +++ b/src/components/MyTrip/MyTripBeforeList.tsx @@ -14,8 +14,8 @@ const MyTripBeforeList: React.FC = ({ myTripsData }) => { return ( <> -
-

다가오는 여행

+
+

다가오는 여행

{myTripsData.map((myTripList: MyTripType) => ( diff --git a/src/components/MyTrip/MyTripIngItem.tsx b/src/components/MyTrip/MyTripIngItem.tsx index a18c33da..e054b93f 100644 --- a/src/components/MyTrip/MyTripIngItem.tsx +++ b/src/components/MyTrip/MyTripIngItem.tsx @@ -30,12 +30,12 @@ const MyTripIngItem: React.FC = ({ myTripList }) => {
-
-
+
+
{tripName}
-
+
{startDate.replace(/-/g, '.')} -{' '} {endDate.replace(/-/g, '.').split('2024.')}{' '} {tripDuration === '0박 1일' ? null : ` (${tripDuration})`} diff --git a/src/components/MyTrip/MyTripItem.tsx b/src/components/MyTrip/MyTripItem.tsx index 72375a66..7776541d 100644 --- a/src/components/MyTrip/MyTripItem.tsx +++ b/src/components/MyTrip/MyTripItem.tsx @@ -66,10 +66,10 @@ const MyTripItem: React.FC = ({ myTripList }) => {
-
+
{tripName}
-
+
{startDate.replace(/-/g, '.')} -{' '} {endDate.replace(/-/g, '.').split('2024.')} {tripDuration === '0박 1일' ? null : ` (${tripDuration})`} From 8ae6076ae127246210dd9298b3da5932397ed32a Mon Sep 17 00:00:00 2001 From: Hojin Date: Fri, 26 Jan 2024 02:46:24 +0900 Subject: [PATCH 51/68] =?UTF-8?q?Feat:=20=EC=BB=A4=EC=84=9C=20=EA=B3=B5?= =?UTF-8?q?=EC=9C=A0=20=EA=B5=AC=ED=98=84=EC=99=84=EB=A3=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/@types/service.ts | 1 + src/@types/socket.types.ts | 1 + src/api/socket.ts | 2 - src/components/Plan/PlanCursor.tsx | 102 ++++++++++++++++-------- src/components/Plan/PlanItem.tsx | 17 +--- src/components/Plan/PlanOtherCursor.tsx | 66 ++++++++++----- src/components/Plan/PlanSectionTop.tsx | 20 ++--- src/hooks/useSocket.ts | 2 - 8 files changed, 127 insertions(+), 84 deletions(-) diff --git a/src/@types/service.ts b/src/@types/service.ts index b0fe82ae..5f9ff5d2 100644 --- a/src/@types/service.ts +++ b/src/@types/service.ts @@ -101,6 +101,7 @@ export type subCursorRes = { status: number; message: string; data: { + color: string; tripId: string; visitDate: string; memberId: number; diff --git a/src/@types/socket.types.ts b/src/@types/socket.types.ts index 227a7467..09e5e725 100644 --- a/src/@types/socket.types.ts +++ b/src/@types/socket.types.ts @@ -86,6 +86,7 @@ type subCursorMessage = (response: { status: number; message: string; data: { + color: string; tripId: string; visitDate: string; memberId: number; diff --git a/src/api/socket.ts b/src/api/socket.ts index ff4101db..505f2fda 100644 --- a/src/api/socket.ts +++ b/src/api/socket.ts @@ -154,7 +154,6 @@ export const pubConnectMember = (pubMember: pubMember, tripId: string) => { destination: `/pub/trips/${tripId}/connectMember`, body: JSON.stringify(pubMember), }); - console.log('입장발생'); }; // 멤버 여정 페이지 퇴장 이벤트 발생시 @@ -163,7 +162,6 @@ export const pubDisconnectMember = (pubMember: pubMember, tripId: string) => { destination: `/pub/trips/${tripId}/disconnectMember`, body: JSON.stringify(pubMember), }); - console.log('퇴장발생'); }; // 여정 편집 페이지 입장 이벤트 발생시(모든 sub 다받음) diff --git a/src/components/Plan/PlanCursor.tsx b/src/components/Plan/PlanCursor.tsx index 54e325db..bbca242d 100644 --- a/src/components/Plan/PlanCursor.tsx +++ b/src/components/Plan/PlanCursor.tsx @@ -1,25 +1,21 @@ -import { useEffect, useState, useContext } from 'react'; +import { useEffect, useState, useContext, RefObject } from 'react'; import { BsFillCursorFill } from 'react-icons/bs'; import { pubCursor } from '@api/socket'; import { socketContext } from '@hooks/useSocket'; import { useGetTripsAuthority } from '@hooks/useGetTripsAuthority'; - -type TripCursorData = { - memberId: number; - x: number; - y: number; - name: string; -}; +import { useRecoilValue } from 'recoil'; +import { visitDateState } from '@recoil/socket'; type PlanCursorProps = { - date: string; + props: RefObject; }; -const PlanCursor = ({ date }: PlanCursorProps) => { +const PlanCursor = ({ props }: PlanCursorProps) => { + const visitDate = useRecoilValue(visitDateState); const token = localStorage.getItem('accessToken'); const { memberId } = useGetTripsAuthority(); - const { callBackPub, tripId, tripMember } = useContext(socketContext); - const [position, setPosition] = useState({ x: 0, y: 0 }); + const { tripId, tripMember } = useContext(socketContext); + const [position, setPosition] = useState({ myX: 0, myY: 0 }); const myName = tripMember?.data?.tripMembers.find( (member) => member.memberId === memberId, @@ -27,43 +23,81 @@ const PlanCursor = ({ date }: PlanCursorProps) => { useEffect(() => { const handleMouseMove = (e: MouseEvent) => { - setPosition({ x: e.clientX, y: e.clientY }); + const myX = e.clientX; + const myY = e.clientY; + setPosition({ myX, myY }); + + const x = (e.clientX + window.scrollX) / window.innerWidth; + const y = (e.clientY + window.scrollY) / window.innerHeight; + + if (token && myName && visitDate && tripId) { + pubCursor( + { + token: token, + visitDate: visitDate.visitDate, + x, + y, + }, + tripId, + ); + } + }; + + const handleMouseEnter = () => { + cursorStyle('none'); + }; + + const handleMouseLeave = () => { + cursorStyle('auto'); }; + + const cursorArea = props.current; + const cursorStyle = (style: string): void => { document.querySelectorAll('*').forEach((el) => { const element = el as HTMLElement; element.style.cursor = style; }); }; - cursorStyle('none'); - document.addEventListener('mousemove', handleMouseMove); + + if (cursorArea) { + cursorArea.addEventListener('mousemove', handleMouseMove); + cursorArea.addEventListener('mouseenter', handleMouseEnter); + cursorArea.addEventListener('mouseleave', handleMouseLeave); + } + return () => { - cursorStyle('auto'); - document.removeEventListener('mousemove', handleMouseMove); + if (cursorArea) { + cursorStyle('auto'); + cursorArea.removeEventListener('mousemove', handleMouseMove); + cursorArea.removeEventListener('mouseenter', handleMouseEnter); + cursorArea.removeEventListener('mouseleave', handleMouseLeave); + } }; - }, []); - + }, [token, myName, visitDate, tripId]); - useEffect(() => { - if (token && position && myName && date && tripId) { - pubCursor( - { - token: token, - visitDate: date, - x: position.x, - y: position.y, - }, - tripId, - ); + const getColorByMemberId = (memberId: number | null) => { + if (memberId == null) { + return 'black'; } - }, [position]); + + const colors = ['#FF2167', '#7932FF', '#29DDF6', '#FFAC16', '#16E7A9']; + const remainder = memberId % 5; + return colors[remainder]; + }; return (
- -
+ style={{ left: `${position.myX}px`, top: `${position.myY}px` }}> + +
{myName?.name}
diff --git a/src/components/Plan/PlanItem.tsx b/src/components/Plan/PlanItem.tsx index 5c4e81bd..5ce5b3bb 100644 --- a/src/components/Plan/PlanItem.tsx +++ b/src/components/Plan/PlanItem.tsx @@ -11,8 +11,6 @@ import { visitDateState, isEditState } from '@recoil/socket'; import { pubGetPathAndItems, pubUpdateTransportation } from '@api/socket'; import { tapState } from '@recoil/plan'; import { useGetTripsAuthority } from '@hooks/useGetTripsAuthority'; -import PlanCursor from './PlanCursor'; -import PlanOtherCursor from './PlanOtherCursor'; type PlanItemProps = { date: string; @@ -26,8 +24,7 @@ const PlanItem: React.FC = ({ date, day }) => { const tap = useRecoilValue(tapState); const [, setVisitDate] = useRecoilState(visitDateState); - const { tripItem, tripPath, callBackPub, tripId, tripCursor } = - useContext(socketContext); + const { tripItem, tripPath, callBackPub, tripId } = useContext(socketContext); useEffect(() => { if (tap) { @@ -49,15 +46,6 @@ const PlanItem: React.FC = ({ date, day }) => { tripId: string, ) => { if (transportation !== transpo) { - // callBackPub(() => - // pubUpdateTransportation( - // { - // visitDate: date, - // transportation: transportation, - // }, - // tripId, - // ), - // ); pubUpdateTransportation( { visitDate: date, @@ -72,9 +60,6 @@ const PlanItem: React.FC = ({ date, day }) => { return ( <> - {/* - */} - {tripPath && }
{tripAuthority !== 'WRITE' || isEdit ? ( diff --git a/src/components/Plan/PlanOtherCursor.tsx b/src/components/Plan/PlanOtherCursor.tsx index fe98bb05..4fd5a687 100644 --- a/src/components/Plan/PlanOtherCursor.tsx +++ b/src/components/Plan/PlanOtherCursor.tsx @@ -1,56 +1,86 @@ import { useEffect, useState, useContext } from 'react'; import { BsFillCursorFill } from 'react-icons/bs'; -import { pubCursor } from '@api/socket'; import { socketContext } from '@hooks/useSocket'; import { useGetTripsAuthority } from '@hooks/useGetTripsAuthority'; +import { useRecoilValue } from 'recoil'; +import { visitDateState } from '@recoil/socket'; type TripCursorData = { + color: string; memberId: number; + tripId: string; + visitDate: string; x: number; y: number; name: string; }; -type PlanCursorProps = { - date: string; -}; - const PlanOtherCursor = () => { + const visitDate = useRecoilValue(visitDateState); const { memberId } = useGetTripsAuthority(); - const { tripCursor, tripMember } = useContext(socketContext); + const { tripCursor } = useContext(socketContext); const [otherCursors, setOtherCursors] = useState([]); useEffect(() => { - if ( - tripCursor && - tripCursor.data && - tripCursor.data.memberId !== memberId - ) { + if (tripCursor?.data && tripCursor.data.memberId !== memberId) { setOtherCursors((prevCursors) => { + if (!tripCursor.data) { + return prevCursors; + } + const existingCursorIndex = prevCursors.findIndex( - (cursor) => cursor.memberId === tripCursor.data!.memberId, + (cursor) => cursor.memberId === tripCursor?.data?.memberId, ); + const newCursor: TripCursorData = { + ...tripCursor.data, + x: tripCursor.data.x * window.innerWidth, + y: tripCursor.data.y * window.innerHeight, + }; + if (existingCursorIndex !== -1) { const updatedCursors = [...prevCursors]; - updatedCursors[existingCursorIndex] = tripCursor.data!; + updatedCursors[existingCursorIndex] = newCursor; return updatedCursors; } else { - return [...prevCursors, tripCursor.data!]; + return [...prevCursors, newCursor]; } }); } }, [tripCursor, memberId]); + useEffect(() => { + setOtherCursors([]); + }, [visitDate]); + + useEffect(() => { + const interval = setInterval(() => { + setOtherCursors([]); + }, 30000); + + return () => clearInterval(interval); + }, []); + return ( <> {otherCursors.map((cursor, index) => (
- -
+ className="pointer-events-none absolute z-50 -translate-x-2 -translate-y-2 transform" + style={{ + left: `${cursor.x}px`, + top: `${cursor.y}px`, + }}> + +
{cursor.name}
diff --git a/src/components/Plan/PlanSectionTop.tsx b/src/components/Plan/PlanSectionTop.tsx index 2c5d4d45..60cae7e6 100644 --- a/src/components/Plan/PlanSectionTop.tsx +++ b/src/components/Plan/PlanSectionTop.tsx @@ -5,7 +5,7 @@ import TripBudget from './TripBudget'; import Tab from '@components/common/tab/Tab'; import PlanItem from './PlanItem'; import { socketContext } from '@hooks/useSocket'; -import { useContext } from 'react'; +import { useContext, useRef } from 'react'; import { pubEnterMember, pubConnectMember, @@ -20,6 +20,8 @@ import { visitDateState } from '@recoil/socket'; import { useState } from 'react'; import { getItem } from '@utils/localStorageFun'; import PlanSchedule from './PlanSchedule'; +import PlanCursor from './PlanCursor'; +import PlanOtherCursor from './PlanOtherCursor'; const PlanSectionTop = () => { const navigate = useNavigate(); @@ -38,6 +40,8 @@ const PlanSectionTop = () => { const { startDate, endDate } = useGetTrips(); const [isEnter, setIsEnter] = useState(false); + const cursorAreaRef = useRef(null); + let DayArr: string[] = []; let DateArr: string[] = []; @@ -65,28 +69,20 @@ const PlanSectionTop = () => { useEffect(() => { if (isEnter) { - console.log('실행'); const accessToken = getItem('accessToken'); if (accessToken) { - // callBackPub(() => { - // pubConnectMember({ token: accessToken || '' }, tripId); - // }); - pubConnectMember({ token: accessToken || '' }, tripId); return () => { - // callBackPub(() => - // pubDisconnectMember({ token: accessToken || '' }, tripId), - // ); - pubDisconnectMember({ token: accessToken || '' }, tripId); }; } } }, [isEnter]); - return ( -
+
+ + { diff --git a/src/hooks/useSocket.ts b/src/hooks/useSocket.ts index dc5a8c1e..3de7e43f 100644 --- a/src/hooks/useSocket.ts +++ b/src/hooks/useSocket.ts @@ -103,11 +103,9 @@ export const useSocket = () => { if (tripId && visitDate) { socketConnect(tripId, visitDate.visitDate); } - console.log('소켓연결'); return () => { socketClient.deactivate(); - console.log('소켓해제'); }; }, [tripId, visitDate, socketCallback]); From aba4c38e2476d5f8ad77ab7a88cb2ccb4ae9c947 Mon Sep 17 00:00:00 2001 From: Hojin Date: Fri, 26 Jan 2024 03:14:10 +0900 Subject: [PATCH 52/68] =?UTF-8?q?Feat:=20=EC=BB=A4=EC=84=9C=20=EA=B3=B5?= =?UTF-8?q?=EC=9C=A0=20=EC=93=B0=EB=A1=9C=ED=8B=80=EB=A7=81=20=EC=A0=81?= =?UTF-8?q?=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 ++ pnpm-lock.yaml | 10 ++++++++++ src/api/socket.ts | 1 + src/components/Plan/PlanCursor.tsx | 25 ++++++++++++++++--------- 4 files changed, 29 insertions(+), 9 deletions(-) diff --git a/package.json b/package.json index 611f6d99..c962cb80 100644 --- a/package.json +++ b/package.json @@ -28,6 +28,7 @@ "@types/react-beautiful-dnd": "^13.1.8", "axios": "^1.6.2", "date-fns": "^3.1.0", + "lodash": "^4.17.21", "msw": "0.36.3", "path": "^0.12.7", "react": "^18.2.0", @@ -53,6 +54,7 @@ "websocket": "^1.0.34" }, "devDependencies": { + "@types/lodash": "^4.14.202", "@types/react": "^18.2.43", "@types/react-date-range": "^1.4.9", "@types/react-dom": "^18.2.17", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 71bfd5fe..abcef86b 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -59,6 +59,9 @@ dependencies: date-fns: specifier: ^3.1.0 version: 3.1.0 + lodash: + specifier: ^4.17.21 + version: 4.17.21 msw: specifier: 0.36.3 version: 0.36.3 @@ -130,6 +133,9 @@ dependencies: version: 1.0.34 devDependencies: + '@types/lodash': + specifier: ^4.14.202 + version: 4.14.202 '@types/react': specifier: ^18.2.43 version: 18.2.45 @@ -3025,6 +3031,10 @@ packages: resolution: {integrity: sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==} dev: true + /@types/lodash@4.14.202: + resolution: {integrity: sha512-OvlIYQK9tNneDlS0VN54LLd5uiPCBOp7gS5Z0f1mjoJYBrtStzgmJBxONW3U6OZqdtNzZPmn9BS/7WI7BFFcFQ==} + dev: true + /@types/node@20.10.5: resolution: {integrity: sha512-nNPsNE65wjMxEKI93yOP+NPGGBJz/PoN3kZsVLee0XMiJolxSekEVD8wRwBUBqkwc7UWop0edW50yrCQW4CyRw==} dependencies: diff --git a/src/api/socket.ts b/src/api/socket.ts index 505f2fda..84b67a6d 100644 --- a/src/api/socket.ts +++ b/src/api/socket.ts @@ -206,4 +206,5 @@ export const pubCursor = (pubCursor: pubCursor, tripId: string) => { destination: `/pub/trips/${tripId}/cursor`, body: JSON.stringify(pubCursor), }); + console.log('섭실행') }; diff --git a/src/components/Plan/PlanCursor.tsx b/src/components/Plan/PlanCursor.tsx index bbca242d..af496183 100644 --- a/src/components/Plan/PlanCursor.tsx +++ b/src/components/Plan/PlanCursor.tsx @@ -5,6 +5,7 @@ import { socketContext } from '@hooks/useSocket'; import { useGetTripsAuthority } from '@hooks/useGetTripsAuthority'; import { useRecoilValue } from 'recoil'; import { visitDateState } from '@recoil/socket'; +import { throttle } from 'lodash'; type PlanCursorProps = { props: RefObject; @@ -21,6 +22,20 @@ const PlanCursor = ({ props }: PlanCursorProps) => { (member) => member.memberId === memberId, ); + const throttledPubCursor = throttle((x, y) => { + if (token && visitDate) { + pubCursor( + { + token: token, + visitDate: visitDate.visitDate, + x, + y, + }, + tripId, + ); + } + }, 50); + useEffect(() => { const handleMouseMove = (e: MouseEvent) => { const myX = e.clientX; @@ -31,15 +46,7 @@ const PlanCursor = ({ props }: PlanCursorProps) => { const y = (e.clientY + window.scrollY) / window.innerHeight; if (token && myName && visitDate && tripId) { - pubCursor( - { - token: token, - visitDate: visitDate.visitDate, - x, - y, - }, - tripId, - ); + throttledPubCursor(x, y); } }; From 40e4c5058d3e1a3bc60d81a2db570f16d247a7b8 Mon Sep 17 00:00:00 2001 From: Hojin Date: Fri, 26 Jan 2024 03:25:35 +0900 Subject: [PATCH 53/68] =?UTF-8?q?Fix:=20=EC=86=8C=EC=BC=93=20=EC=83=88?= =?UTF-8?q?=EB=A1=9C=EA=B3=A0=EC=B9=A8=20=EC=B5=9C=EC=A0=81=ED=99=94(?= =?UTF-8?q?=EC=98=88=EC=82=B0,=20=EC=82=AD=EC=A0=9C,=20=EC=9D=B4=EB=8F=99,?= =?UTF-8?q?=20=EB=B3=80=EA=B2=BD)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Plan/PlanEditItemBox.tsx | 7 ++----- src/components/Plan/PlanMoveItem.tsx | 17 +++++++---------- src/components/Plan/TripBudget.tsx | 14 ++++++-------- 3 files changed, 15 insertions(+), 23 deletions(-) diff --git a/src/components/Plan/PlanEditItemBox.tsx b/src/components/Plan/PlanEditItemBox.tsx index 1e1a6fec..40283d57 100644 --- a/src/components/Plan/PlanEditItemBox.tsx +++ b/src/components/Plan/PlanEditItemBox.tsx @@ -34,7 +34,6 @@ const PlanEditItemBox = ({ return
Missing data
; } - const { callBackPub } = useContext(socketContext); const [, setIsEdit] = useRecoilState(isEditState); const [items, setItems] = useState(item); const [newData, setNewData] = useState(null); @@ -65,15 +64,13 @@ const PlanEditItemBox = ({ useEffect(() => { if (newData && tripId) { - callBackPub(() => pubUpdateTripItem(newData, tripId)); + pubUpdateTripItem(newData, tripId); } }, [newData]); const handleConfirm = () => { if (tripId && visitDate && selectedItemId) { - callBackPub(() => - pubDeleteItem({ tripId: tripId, visitDate: visitDate }, selectedItemId), - ); + pubDeleteItem({ tripId: tripId, visitDate: visitDate }, selectedItemId); } setToastPopUp(() => ({ isPopUp: true, diff --git a/src/components/Plan/PlanMoveItem.tsx b/src/components/Plan/PlanMoveItem.tsx index fdfa5d84..40f1357d 100644 --- a/src/components/Plan/PlanMoveItem.tsx +++ b/src/components/Plan/PlanMoveItem.tsx @@ -22,7 +22,6 @@ const PlanMoveItem: React.FC = ({ visitDate, }) => { const [, setIsEdit] = useRecoilState(isEditState); - const { callBackPub } = useContext(socketContext); const day = useRecoilValue(dayState); const date = useRecoilValue(dateState); @@ -37,15 +36,13 @@ const PlanMoveItem: React.FC = ({ return; } if (tripId && isCheck && visitDate) { - callBackPub(() => - pubUpdateVisitDate( - { - tripId: tripId, - oldVisitDate: visitDate, - newVisitDate: newVisitDate, - }, - isCheck, - ), + pubUpdateVisitDate( + { + tripId: tripId, + oldVisitDate: visitDate, + newVisitDate: newVisitDate, + }, + isCheck, ); } setToastPopUp(() => ({ diff --git a/src/components/Plan/TripBudget.tsx b/src/components/Plan/TripBudget.tsx index 181ceab4..e8ea6d82 100644 --- a/src/components/Plan/TripBudget.tsx +++ b/src/components/Plan/TripBudget.tsx @@ -8,7 +8,7 @@ import { useContext, useState } from 'react'; const TripBudget = () => { const { tripAuthority } = useGetTripsAuthority(); - const { callBackPub, tripBudget, tripId } = useContext(socketContext); + const { tripBudget, tripId } = useContext(socketContext); const budget = tripBudget?.data; @@ -28,13 +28,11 @@ const TripBudget = () => { const handleSetTargetBudget = (inputBudget: string) => { const newTargetBudget = parseInt(inputBudget, 10); // 문자열 숫자로 변환 if (!isNaN(newTargetBudget) && newTargetBudget !== budget?.budget) { - callBackPub(() => - pubUpdateBudget( - { - budget: newTargetBudget, - }, - tripId || '', - ), + pubUpdateBudget( + { + budget: newTargetBudget, + }, + tripId || '', ); setInputBudget(''); } From 6ec71439084d0ff140e90d663918c68674b1ee34 Mon Sep 17 00:00:00 2001 From: Hojin Date: Fri, 26 Jan 2024 03:33:57 +0900 Subject: [PATCH 54/68] =?UTF-8?q?Fix:=20=EC=83=81=ED=92=88=20=EC=88=9C?= =?UTF-8?q?=EC=84=9C=EB=B3=80=EA=B2=BD=20=EB=94=94=EB=B0=94=EC=9A=B4?= =?UTF-8?q?=EC=8B=B1=20=EC=A0=81=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/socket.ts | 2 +- src/components/Plan/PlanEditItemBox.tsx | 9 ++++++--- src/components/Plan/PlanMoveItem.tsx | 2 -- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/api/socket.ts b/src/api/socket.ts index 84b67a6d..2f22446e 100644 --- a/src/api/socket.ts +++ b/src/api/socket.ts @@ -113,6 +113,7 @@ export const pubUpdateTripItem = ( destination: `/pub/trips/${tripId}/updateTripItemOrder`, body: JSON.stringify(pubUpdateTripItem), }); + console.log('실행'); }; // 여행 날짜별 교통 수단 변경 이벤트 발생시 (01/16 업데이트) @@ -206,5 +207,4 @@ export const pubCursor = (pubCursor: pubCursor, tripId: string) => { destination: `/pub/trips/${tripId}/cursor`, body: JSON.stringify(pubCursor), }); - console.log('섭실행') }; diff --git a/src/components/Plan/PlanEditItemBox.tsx b/src/components/Plan/PlanEditItemBox.tsx index 40283d57..d996316b 100644 --- a/src/components/Plan/PlanEditItemBox.tsx +++ b/src/components/Plan/PlanEditItemBox.tsx @@ -8,14 +8,13 @@ import { } from 'react-beautiful-dnd'; import { useState, useEffect } from 'react'; import { pubUpdateTripItem, pubDeleteItem } from '@api/socket'; -import { useContext } from 'react'; -import { socketContext } from '@hooks/useSocket'; import { pubUpdateTripItemReq } from '@/@types/service'; import Alert from '@components/common/alert/Alert'; import ToastPopUp from '@components/common/toastpopup/ToastPopUp'; import PlanMoveItem from './PlanMoveItem'; import { useRecoilState } from 'recoil'; import { isEditState } from '@recoil/socket'; +import { debounce } from 'lodash'; type PlanItemBoxProps = { item: TripItem[]; @@ -62,9 +61,13 @@ const PlanEditItemBox = ({ }); }; + const debouncedPubUpdateTripItem = debounce((newData, tripId) => { + pubUpdateTripItem(newData, tripId); + }, 1000); + useEffect(() => { if (newData && tripId) { - pubUpdateTripItem(newData, tripId); + debouncedPubUpdateTripItem(newData, tripId); } }, [newData]); diff --git a/src/components/Plan/PlanMoveItem.tsx b/src/components/Plan/PlanMoveItem.tsx index 40f1357d..51d36b81 100644 --- a/src/components/Plan/PlanMoveItem.tsx +++ b/src/components/Plan/PlanMoveItem.tsx @@ -3,8 +3,6 @@ import { PaperIcon } from '@components/common/icons/Icons'; import { useRecoilValue } from 'recoil'; import { dayState, dateState } from '@recoil/plan'; import { pubUpdateVisitDate } from '@api/socket'; -import { useContext } from 'react'; -import { socketContext } from '@hooks/useSocket'; import { useState, useEffect } from 'react'; import ToastPopUp from '@components/common/toastpopup/ToastPopUp'; import { useRecoilState } from 'recoil'; From 3fb36fd2299005eca7a15e9a64a7332ac66e1b56 Mon Sep 17 00:00:00 2001 From: Hojin Date: Fri, 26 Jan 2024 03:48:50 +0900 Subject: [PATCH 55/68] =?UTF-8?q?Feat:=20=EC=BB=A4=EC=84=9C=EA=B3=B5?= =?UTF-8?q?=EC=9C=A0=20=EB=AA=A8=EB=B0=94=EC=9D=BC=ED=99=98=EA=B2=BD?= =?UTF-8?q?=EC=97=90=EC=84=A0=20=EC=95=88=EB=90=98=EA=B2=8C=20=EC=84=A4?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 1 + pnpm-lock.yaml | 18 ++++++++++++++++++ src/components/Plan/PlanSectionTop.tsx | 9 +++++++-- 3 files changed, 26 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index c962cb80..b572eba0 100644 --- a/package.json +++ b/package.json @@ -33,6 +33,7 @@ "path": "^0.12.7", "react": "^18.2.0", "react-beautiful-dnd": "^13.1.1", + "react-device-detect": "^2.2.3", "react-dom": "^18.2.0", "react-hook-form": "^7.49.2", "react-icons": "^5.0.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index abcef86b..95225e8f 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -74,6 +74,9 @@ dependencies: react-beautiful-dnd: specifier: ^13.1.1 version: 13.1.1(react-dom@18.2.0)(react@18.2.0) + react-device-detect: + specifier: ^2.2.3 + version: 2.2.3(react-dom@18.2.0)(react@18.2.0) react-dom: specifier: ^18.2.0 version: 18.2.0(react@18.2.0) @@ -5139,6 +5142,17 @@ packages: - react-native dev: false + /react-device-detect@2.2.3(react-dom@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-buYY3qrCnQVlIFHrC5UcUoAj7iANs/+srdkwsnNjI7anr3Tt7UY6MqNxtMLlr0tMBied0O49UZVK8XKs3ZIiPw==} + peerDependencies: + react: '>= 0.14.0' + react-dom: '>= 0.14.0' + dependencies: + react: 18.2.0 + react-dom: 18.2.0(react@18.2.0) + ua-parser-js: 1.0.37 + dev: false + /react-dom@18.2.0(react@18.2.0): resolution: {integrity: sha512-6IMTriUmvsjHUjNtEDudZfuDQUoWXVxKHhlEGSk81n4YFS+r/Kl99wXiwlVXtPBtJenozv2P+hxDsw9eA7Xo6g==} peerDependencies: @@ -5900,6 +5914,10 @@ packages: engines: {node: '>=14.17'} hasBin: true + /ua-parser-js@1.0.37: + resolution: {integrity: sha512-bhTyI94tZofjo+Dn8SN6Zv8nBDvyXTymAdM3LDI/0IboIUwTu1rEhW7v2TfiVsoYWgkQ4kOVqnI8APUFbIQIFQ==} + dev: false + /undici-types@5.26.5: resolution: {integrity: sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==} dev: false diff --git a/src/components/Plan/PlanSectionTop.tsx b/src/components/Plan/PlanSectionTop.tsx index 60cae7e6..0c84359f 100644 --- a/src/components/Plan/PlanSectionTop.tsx +++ b/src/components/Plan/PlanSectionTop.tsx @@ -22,6 +22,7 @@ import { getItem } from '@utils/localStorageFun'; import PlanSchedule from './PlanSchedule'; import PlanCursor from './PlanCursor'; import PlanOtherCursor from './PlanOtherCursor'; +import { isMobile } from 'react-device-detect'; const PlanSectionTop = () => { const navigate = useNavigate(); @@ -81,8 +82,12 @@ const PlanSectionTop = () => { }, [isEnter]); return (
- - + {!isMobile && ( + <> + + + + )} { From 1ac73b40545e2bd52f28ea7b73108dc0791bd56b Mon Sep 17 00:00:00 2001 From: Hojin Date: Fri, 26 Jan 2024 09:43:33 +0900 Subject: [PATCH 56/68] =?UTF-8?q?Fix:=20=EB=B9=8C=EB=93=9C=EC=97=90?= =?UTF-8?q?=EB=9F=AC=20=ED=95=B4=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Plan/PlanSectionTop.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Plan/PlanSectionTop.tsx b/src/components/Plan/PlanSectionTop.tsx index 245d2389..00d23134 100644 --- a/src/components/Plan/PlanSectionTop.tsx +++ b/src/components/Plan/PlanSectionTop.tsx @@ -22,7 +22,7 @@ import { getItem } from '@utils/localStorageFun'; import PlanSchedule from './PlanSchedule'; import PlanCursor from './PlanCursor'; import PlanOtherCursor from './PlanOtherCursor'; - +import ScrollTopButton from '@components/common/scrollTopButton/ScrollTopButton'; const PlanSectionTop = () => { const navigate = useNavigate(); From 743cfbc7bf34d4f719a9b6661d0eb35ccc431511 Mon Sep 17 00:00:00 2001 From: NohWookJin Date: Fri, 26 Jan 2024 10:00:08 +0900 Subject: [PATCH 57/68] =?UTF-8?q?style:=20=EC=97=AC=EB=B0=B1=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Trip/LikedToursLists/LikedToursListItem.tsx | 10 +++++----- src/components/Wish/WishItem.tsx | 14 +++++++------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/components/Trip/LikedToursLists/LikedToursListItem.tsx b/src/components/Trip/LikedToursLists/LikedToursListItem.tsx index c9e73827..f72641fa 100644 --- a/src/components/Trip/LikedToursLists/LikedToursListItem.tsx +++ b/src/components/Trip/LikedToursLists/LikedToursListItem.tsx @@ -72,7 +72,7 @@ const LikedToursListItem: React.FC = ({ return (
navigate(`/detail/${tourItemId}`)}>
@@ -83,13 +83,13 @@ const LikedToursListItem: React.FC = ({ />
-
-
-

+

+
+

{title}

-
+
diff --git a/src/components/Wish/WishItem.tsx b/src/components/Wish/WishItem.tsx index e1fb9a2c..75928caa 100644 --- a/src/components/Wish/WishItem.tsx +++ b/src/components/Wish/WishItem.tsx @@ -32,9 +32,9 @@ const WishItem: React.FC = ({ wishList }) => { return (
navigate(`/detail/${id}`)}> -
+
= ({ wishList }) => {

{title}

-
+

{isMetroIncluded && tourAddress ? (tourAddress.match(/(.*?[시군구])/)?.[0] || '') + @@ -63,9 +63,9 @@ const WishItem: React.FC = ({ wishList }) => {

-
+
-
+
@@ -78,10 +78,10 @@ const WishItem: React.FC = ({ wishList }) => {
-
+
- + {likedCount ? likedCount.toLocaleString() : likedCount}
From 80f7e8b5652f7e1fb62fdce84e2a4fb7a38cfe48 Mon Sep 17 00:00:00 2001 From: Hojin Date: Fri, 26 Jan 2024 11:58:54 +0900 Subject: [PATCH 58/68] =?UTF-8?q?Fix:=20planItem=20=EA=B0=84=EA=B2=A9=20?= =?UTF-8?q?=EC=9E=AC=EC=A1=B0=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Plan/PlanEditItemBox.tsx | 12 +++++++----- src/components/Plan/PlanItemBox.tsx | 14 ++++++++------ 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/src/components/Plan/PlanEditItemBox.tsx b/src/components/Plan/PlanEditItemBox.tsx index ff85fb4c..48230566 100644 --- a/src/components/Plan/PlanEditItemBox.tsx +++ b/src/components/Plan/PlanEditItemBox.tsx @@ -132,22 +132,24 @@ const PlanEditItemBox = ({ checked={selectedItemId === item.tripItemId}>
-
+
img -
+
{item.name.length > 17 ? item.name.slice(0, 17) + '...' : item.name}
-
- {item.category} +
+
+ {item.category} +
-
+
{item.price} 원
diff --git a/src/components/Plan/PlanItemBox.tsx b/src/components/Plan/PlanItemBox.tsx index 31a926b7..a09fb8cd 100644 --- a/src/components/Plan/PlanItemBox.tsx +++ b/src/components/Plan/PlanItemBox.tsx @@ -64,7 +64,7 @@ const PlanItemBox = ({ return ( <>
-
{day}
+
{day}
{item.map((item, index) => (
@@ -76,22 +76,24 @@ const PlanItemBox = ({
-
+
img -
+
{item.name.length > 19 ? item.name.slice(0, 19) + '...' : item.name}
-
- {item.category} +
+
+ {item.category} +
-
+
{item.price.toLocaleString()} 원 {tripAuthority == 'WRITE' && ( Date: Fri, 26 Jan 2024 12:06:00 +0900 Subject: [PATCH 59/68] =?UTF-8?q?Desigin:=20Nav,=20Tab=20=EA=B0=84?= =?UTF-8?q?=EA=B2=A9=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/common/nav/Nav.tsx | 24 ++++++++++++------------ src/components/common/tab/Tab.tsx | 6 ++++-- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/src/components/common/nav/Nav.tsx b/src/components/common/nav/Nav.tsx index e0b3e51c..b29f1d70 100644 --- a/src/components/common/nav/Nav.tsx +++ b/src/components/common/nav/Nav.tsx @@ -38,14 +38,14 @@ const Nav = () => { navigate('/'); window.scrollTo({ top: 0, left: 0, behavior: 'smooth' }); }} - className="cursor-pointer flex-col items-center justify-center px-2"> + className="w-[53.12px] cursor-pointer flex-col items-center justify-center px-2">
-

+

@@ -53,7 +53,7 @@ const Nav = () => { {isLoggedIn ? (
navigate('/mytrip')} - className="cursor-pointer flex-col items-center justify-center px-2"> + className="cursor-pointe w-[53.12px] flex-col items-center justify-center px-2">
{isActive('/mytrip') ? ( @@ -61,7 +61,7 @@ const Nav = () => { )}
-

+

일정

@@ -76,14 +76,14 @@ const Nav = () => { } onConfirm={handleConfirm}> -
+
-

+

일정

@@ -93,14 +93,14 @@ const Nav = () => { {isLoggedIn ? (
navigate('/wishlist')} - className="cursor-pointer flex-col items-center justify-center px-2"> + className="w-[53.12px] cursor-pointer flex-col items-center justify-center px-2">
-

+

관심목록

@@ -115,14 +115,14 @@ const Nav = () => { } onConfirm={handleConfirm}> -
+
-

+

관심목록

@@ -131,14 +131,14 @@ const Nav = () => {
navigate('/mypage')} - className="cursor-pointer flex-col items-center justify-center px-1"> + className="w-[53.12px] cursor-pointer flex-col items-center justify-center px-1 pt-[1px]">
-

+

내정보

diff --git a/src/components/common/tab/Tab.tsx b/src/components/common/tab/Tab.tsx index c75d14f2..7d012b00 100644 --- a/src/components/common/tab/Tab.tsx +++ b/src/components/common/tab/Tab.tsx @@ -29,14 +29,16 @@ const Tab = ({ lists, contents }: TabProps) => { defaultValue="tab0" onValueChange={handleTabChange}> {lists.map((list, index) => { return ( {list} From 7ed23e04f257412ed9bc6bccd132ebe713aa952e Mon Sep 17 00:00:00 2001 From: Hojin Date: Fri, 26 Jan 2024 12:45:27 +0900 Subject: [PATCH 60/68] =?UTF-8?q?Fix:=20=EA=B8=80=EC=9E=90=EC=88=98?= =?UTF-8?q?=EC=A0=9C=ED=95=9C=2019->16,=20=EC=9D=B4=EB=9F=B0=EC=A0=90?= =?UTF-8?q?=EC=9D=B4=EC=A2=8B=EC=95=98=EC=96=B4=EC=9A=94=20=EC=84=B8?= =?UTF-8?q?=EB=A1=9C=EA=B0=80=EC=9A=B4=EB=8D=B0=EC=A0=95=EB=A0=AC=20?= =?UTF-8?q?=EC=A0=81=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/DetailSectionBottom/DetailReviewStats.tsx | 2 +- src/components/Plan/PlanEditItemBox.tsx | 4 ++-- src/components/Plan/PlanItemBox.tsx | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/components/DetailSectionBottom/DetailReviewStats.tsx b/src/components/DetailSectionBottom/DetailReviewStats.tsx index 7a2342b4..ade45a12 100644 --- a/src/components/DetailSectionBottom/DetailReviewStats.tsx +++ b/src/components/DetailSectionBottom/DetailReviewStats.tsx @@ -25,7 +25,7 @@ const DetailReviewStats = () => { backgroundColor: getColor(data.keywordCount), }} /> -
+

{getEmoji(data.content)}

{data.content}

diff --git a/src/components/Plan/PlanEditItemBox.tsx b/src/components/Plan/PlanEditItemBox.tsx index 48230566..c1a3fa98 100644 --- a/src/components/Plan/PlanEditItemBox.tsx +++ b/src/components/Plan/PlanEditItemBox.tsx @@ -140,8 +140,8 @@ const PlanEditItemBox = ({ />
- {item.name.length > 17 - ? item.name.slice(0, 17) + '...' + {item.name.length > 16 + ? item.name.slice(0, 16) + '...' : item.name}
diff --git a/src/components/Plan/PlanItemBox.tsx b/src/components/Plan/PlanItemBox.tsx index a09fb8cd..4cdd0f64 100644 --- a/src/components/Plan/PlanItemBox.tsx +++ b/src/components/Plan/PlanItemBox.tsx @@ -84,8 +84,8 @@ const PlanItemBox = ({ />
- {item.name.length > 19 - ? item.name.slice(0, 19) + '...' + {item.name.length > 16 + ? item.name.slice(0, 16) + '...' : item.name}
From e0680a2a215be98ac73e584f475d0ac3086d2c32 Mon Sep 17 00:00:00 2001 From: Hojin Date: Fri, 26 Jan 2024 13:22:39 +0900 Subject: [PATCH 61/68] =?UTF-8?q?Fix:=20=EB=AA=A8=EB=B0=94=EC=9D=BC?= =?UTF-8?q?=ED=99=98=EA=B2=BD=EC=97=90=EC=84=9C=20=EB=82=A8=EC=9D=98?= =?UTF-8?q?=EC=BB=A4=EC=84=9C=EB=8A=94=20=EB=B3=BC=EC=88=98=EC=9E=88?= =?UTF-8?q?=EA=B2=8C=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Plan/PlanSectionTop.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Plan/PlanSectionTop.tsx b/src/components/Plan/PlanSectionTop.tsx index 00abda5b..afe01e17 100644 --- a/src/components/Plan/PlanSectionTop.tsx +++ b/src/components/Plan/PlanSectionTop.tsx @@ -86,9 +86,9 @@ const PlanSectionTop = () => { {!isMobile && ( <> - )} + { From f379969c882744780200fe7f1efdf6bf2e564c68 Mon Sep 17 00:00:00 2001 From: NohWookJin Date: Fri, 26 Jan 2024 14:19:26 +0900 Subject: [PATCH 62/68] =?UTF-8?q?fix:=20=EA=B0=84=EA=B2=A9=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/MyTrip/MyTripIngItem.tsx | 8 ++++---- src/components/MyTrip/MyTripItem.tsx | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/components/MyTrip/MyTripIngItem.tsx b/src/components/MyTrip/MyTripIngItem.tsx index e054b93f..479009a5 100644 --- a/src/components/MyTrip/MyTripIngItem.tsx +++ b/src/components/MyTrip/MyTripIngItem.tsx @@ -16,7 +16,7 @@ const MyTripIngItem: React.FC = ({ myTripList }) => {
navigate(`/trip/${tripId}`)}> -
+
= ({ myTripList }) => { alt="여행지 이미지" />
-
+
{tripStatus}
-
+
{tripName}
-
+
{startDate.replace(/-/g, '.')} -{' '} {endDate.replace(/-/g, '.').split('2024.')}{' '} {tripDuration === '0박 1일' ? null : ` (${tripDuration})`} diff --git a/src/components/MyTrip/MyTripItem.tsx b/src/components/MyTrip/MyTripItem.tsx index 7776541d..b5878161 100644 --- a/src/components/MyTrip/MyTripItem.tsx +++ b/src/components/MyTrip/MyTripItem.tsx @@ -64,8 +64,8 @@ const MyTripItem: React.FC = ({ myTripList }) => { alt="여행지 이미지" />
-
-
+
+
{tripName}
@@ -76,7 +76,7 @@ const MyTripItem: React.FC = ({ myTripList }) => {
-
+
{numberOfTripMember}명과 공유중
From a72392bea735b6c63ebfd9876caf8f6fe2d40642 Mon Sep 17 00:00:00 2001 From: NohWookJin Date: Fri, 26 Jan 2024 14:31:15 +0900 Subject: [PATCH 63/68] =?UTF-8?q?style:=20=EC=97=AC=EB=B0=B1=20=EC=A1=B0?= =?UTF-8?q?=EC=A0=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/MyTrip/MyTripIngItem.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/MyTrip/MyTripIngItem.tsx b/src/components/MyTrip/MyTripIngItem.tsx index 479009a5..3ff6392c 100644 --- a/src/components/MyTrip/MyTripIngItem.tsx +++ b/src/components/MyTrip/MyTripIngItem.tsx @@ -30,7 +30,7 @@ const MyTripIngItem: React.FC = ({ myTripList }) => {
-
+
{tripName}
From e9a3b81698ccc7798049ceae9837bb0d2fa6f416 Mon Sep 17 00:00:00 2001 From: NohWookJin Date: Fri, 26 Jan 2024 14:31:32 +0900 Subject: [PATCH 64/68] =?UTF-8?q?style:=20=EC=97=AC=EC=A0=95=20=EB=AC=B8?= =?UTF-8?q?=EA=B5=AC=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/common/nav/Nav.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/common/nav/Nav.tsx b/src/components/common/nav/Nav.tsx index e0b3e51c..3d0bf45e 100644 --- a/src/components/common/nav/Nav.tsx +++ b/src/components/common/nav/Nav.tsx @@ -62,7 +62,7 @@ const Nav = () => { )}

- 일정 + 여정

) : ( @@ -84,7 +84,7 @@ const Nav = () => { />

- 일정 + 여정

From 9b0e09483ecc46c2a18846112fed9c4d166a78ca Mon Sep 17 00:00:00 2001 From: Hojin Date: Fri, 26 Jan 2024 14:40:02 +0900 Subject: [PATCH 65/68] =?UTF-8?q?Fix:=20=EB=B9=84=EB=A1=9C=EA=B7=B8?= =?UTF-8?q?=EC=9D=B8=EC=8B=9C=20=EC=9D=BC=EC=A0=95=EC=B6=94=EA=B0=80=20?= =?UTF-8?q?=EC=9B=8C=EB=94=A9=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/DetailSectionTop/DetailAddSchedule.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/DetailSectionTop/DetailAddSchedule.tsx b/src/components/DetailSectionTop/DetailAddSchedule.tsx index 0b39bba6..9dd0d3f8 100644 --- a/src/components/DetailSectionTop/DetailAddSchedule.tsx +++ b/src/components/DetailSectionTop/DetailAddSchedule.tsx @@ -265,9 +265,9 @@ const DetailAddSchedule = () => { title={'로그인'} message={ <> - 새로운 여행 생성 시 로그인이 필요합니다. + 일정에 추가하려면 로그인이 필요해요.
- 로그인 하시겠습니까? + 로그인하러 가볼까요? } onConfirm={() => handleNavigate('/login')}> From c3922278979087563d04dfe01e35d52ba64f9c24 Mon Sep 17 00:00:00 2001 From: Hojin Date: Fri, 26 Jan 2024 14:43:16 +0900 Subject: [PATCH 66/68] =?UTF-8?q?Fix:=20=EC=9D=BC=EC=A0=95=20->=20?= =?UTF-8?q?=EC=97=AC=EC=A0=95=EC=9C=BC=EB=A1=9C=20=EB=AC=B8=EA=B5=AC?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/DetailSectionTop/DetailAddSchedule.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/DetailSectionTop/DetailAddSchedule.tsx b/src/components/DetailSectionTop/DetailAddSchedule.tsx index 9dd0d3f8..e976a48c 100644 --- a/src/components/DetailSectionTop/DetailAddSchedule.tsx +++ b/src/components/DetailSectionTop/DetailAddSchedule.tsx @@ -265,7 +265,7 @@ const DetailAddSchedule = () => { title={'로그인'} message={ <> - 일정에 추가하려면 로그인이 필요해요. + 여정에 추가하려면 로그인이 필요해요.
로그인하러 가볼까요? From 8363781352c3c804e4b131e3801452d82ccf9cf2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=96=B4=EC=8A=B9=EC=A4=80?= Date: Fri, 26 Jan 2024 18:35:38 +0900 Subject: [PATCH 67/68] =?UTF-8?q?Fix:=20=EB=94=94=EC=9E=90=EC=9D=B8=202?= =?UTF-8?q?=EC=B0=A8=20QA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.tsx | 2 +- .../DetailSectionBottom/ReviewItem.tsx | 40 ++++++---------- src/components/Review/CommentItem.tsx | 2 +- src/components/Review/ReviewComments.tsx | 2 +- src/components/Review/ReviewKeyword.tsx | 47 ++++++++----------- src/components/common/nav/InputComment.tsx | 5 +- 6 files changed, 39 insertions(+), 59 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index 030880f3..c3e90c27 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -18,7 +18,7 @@ const App = () => { - + {/* */} ); }; diff --git a/src/components/DetailSectionBottom/ReviewItem.tsx b/src/components/DetailSectionBottom/ReviewItem.tsx index c11e040e..2ff1c349 100644 --- a/src/components/DetailSectionBottom/ReviewItem.tsx +++ b/src/components/DetailSectionBottom/ReviewItem.tsx @@ -151,51 +151,41 @@ const Item: React.FC = (props: ReviewInfoItemProps) => {
{!showMoreKeywords && - keywords.slice(0, 2).map((keyword, idx) => ( + keywords.slice(0, 1).map((keyword, idx) => (
{getEmoji(keyword.content)} {keyword.content}
))} - {keywords.length > 2 && !showMoreKeywords && ( + {keywords.length > 1 && !showMoreKeywords && (
{ handleClickPlusButton(e); }}> - +{keywords.length - 2} + +{keywords.length - 1}
)}
+
- {showMoreKeywords && - Array.from({ length: Math.ceil(keywords.length / 2) }).map( - (_, lineIdx) => ( + {showMoreKeywords && ( +
+ {keywords.map((keyword, idx) => (
- {keywords - .slice(lineIdx * 2, lineIdx * 2 + 2) - .map((keyword, idx) => ( -
- {getEmoji(keyword.content)} {keyword.content} -
- ))} + key={idx} + className="rounded-md bg-gray1 px-2 py-1 text-xs text-gray6"> + {getEmoji(keyword.content)} {keyword.content}
- ), - )} + ))} +
+ )}
-
+
-
{commentCount}
+
{commentCount}
diff --git a/src/components/Review/CommentItem.tsx b/src/components/Review/CommentItem.tsx index c74ff1c5..929621b9 100644 --- a/src/components/Review/CommentItem.tsx +++ b/src/components/Review/CommentItem.tsx @@ -44,7 +44,7 @@ const CommentItem: React.FC = (props: CommentItemProps) => { }; return ( -
+
{!( diff --git a/src/components/Review/ReviewComments.tsx b/src/components/Review/ReviewComments.tsx index 05dd0244..fbf4858b 100644 --- a/src/components/Review/ReviewComments.tsx +++ b/src/components/Review/ReviewComments.tsx @@ -85,7 +85,7 @@ export default function ReviewComments() { 댓글 {commentDataLength}
-
+
{commentDataLength == 0 && (
diff --git a/src/components/Review/ReviewKeyword.tsx b/src/components/Review/ReviewKeyword.tsx index d6c24780..c33d7323 100644 --- a/src/components/Review/ReviewKeyword.tsx +++ b/src/components/Review/ReviewKeyword.tsx @@ -45,38 +45,29 @@ export default function ReviewKeyword() { } }; - // 5x2 형태로 배치하기 위해 행(row)과 열(column)을 계산 - // const rows = 5; - const columns = 2; - return ( <>
어떤 점이 좋았나요?
-
- {reviewKeywords?.data?.data?.keywords?.map( - (keyword: Keyword, index: number) => { - const row = Math.floor(index / columns) + 1; - const col = (index % columns) + 1; - - const isSelected = selectedKeywords.some( - (selectedKeyword) => - selectedKeyword.keywordId === keyword.keywordId, - ); +
+ {reviewKeywords?.data?.data?.keywords?.map((keyword: Keyword) => { + const isSelected = selectedKeywords.some( + (selectedKeyword) => + selectedKeyword.keywordId === keyword.keywordId, + ); - return ( - - ); - }, - )} + return ( + + ); + })}
); diff --git a/src/components/common/nav/InputComment.tsx b/src/components/common/nav/InputComment.tsx index 00a343dc..ebaad8f5 100644 --- a/src/components/common/nav/InputComment.tsx +++ b/src/components/common/nav/InputComment.tsx @@ -106,12 +106,11 @@ export const InputComment: React.FC = () => { }; return ( -
-
+
+
Date: Fri, 26 Jan 2024 18:37:10 +0900 Subject: [PATCH 68/68] =?UTF-8?q?Fix:=20=EB=94=94=EC=9E=90=EC=9D=B8=202?= =?UTF-8?q?=EC=B0=A8=20QA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/App.tsx b/src/App.tsx index c3e90c27..030880f3 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -18,7 +18,7 @@ const App = () => { - {/* */} + ); };