From c458ba82477b0c625b788efcc92997c8fceb2bf4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=96=B4=EC=8A=B9=EC=A4=80?= Date: Thu, 18 Jan 2024 12:53:14 +0900 Subject: [PATCH 1/8] =?UTF-8?q?Fix:=20=EC=95=84=EC=9D=B4=EC=BD=98=20?= =?UTF-8?q?=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Trip/PlanTripButton.tsx | 12 ++++------ src/components/Trip/TripPreference.tsx | 4 +++- src/components/common/icons/Icons.tsx | 32 ++++++++++++++++++++++++++ 3 files changed, 40 insertions(+), 8 deletions(-) diff --git a/src/components/Trip/PlanTripButton.tsx b/src/components/Trip/PlanTripButton.tsx index bd5ac6fc..db7b4639 100644 --- a/src/components/Trip/PlanTripButton.tsx +++ b/src/components/Trip/PlanTripButton.tsx @@ -1,18 +1,16 @@ -import { PlanIcon, RightIcon } from '@components/common/icons/Icons'; +import { PlanColorIcon, RightIcon } from '@components/common/icons/Icons'; const PlanTripButton = () => { return ( - ); diff --git a/src/components/Trip/TripPreference.tsx b/src/components/Trip/TripPreference.tsx index 02f71976..368086d7 100644 --- a/src/components/Trip/TripPreference.tsx +++ b/src/components/Trip/TripPreference.tsx @@ -32,7 +32,9 @@ const TripPreferenceButton: React.FC = () => {
-

내 여행 취향 설정하러 가기

+

+ 내 여행 취향 설정하러 가기 +

diff --git a/src/components/common/icons/Icons.tsx b/src/components/common/icons/Icons.tsx index 3d70d69e..bbd4e328 100644 --- a/src/components/common/icons/Icons.tsx +++ b/src/components/common/icons/Icons.tsx @@ -1297,3 +1297,35 @@ export const CounterIcon: React.FC< ); }; + +export const PlanColorIcon: React.FC = ({ size = 21 }) => { + return ( + + + + + + + ); +}; From 8d6e4e29eb24c199f4e940eb98c5973f9472da76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=96=B4=EC=8A=B9=EC=A4=80?= Date: Thu, 18 Jan 2024 16:22:27 +0900 Subject: [PATCH 2/8] =?UTF-8?q?Feat:=20=EC=A0=91=EC=86=8D=EC=A4=91=20?= =?UTF-8?q?=EA=B3=B5=EC=9C=A0=EB=A9=A4=EB=B2=84=20=EA=B8=B0=EB=8A=A5=20?= =?UTF-8?q?=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/@types/service.ts | 6 +- src/@types/socket.types.ts | 6 +- src/components/Plan/PlanSectionTop.tsx | 8 ++- src/components/Trip/TripInfo.tsx | 17 +----- src/components/Trip/TripRealtimeEditor.tsx | 66 ++++++++++++++++++++++ src/components/Trip/TripSchedule.tsx | 22 ++++++++ 6 files changed, 97 insertions(+), 28 deletions(-) create mode 100644 src/components/Trip/TripRealtimeEditor.tsx create mode 100644 src/components/Trip/TripSchedule.tsx diff --git a/src/@types/service.ts b/src/@types/service.ts index 8706a8da..26d684d6 100644 --- a/src/@types/service.ts +++ b/src/@types/service.ts @@ -78,15 +78,11 @@ export type subMemberRes = { message: string; data: { tripId: number; - connectedMembers: { - memberId: number; - name: string; - thumbnailUrl: string; - }[]; tripMembers: { memberId: number; name: string; thumbnailUrl: string; + connected: boolean; }[]; numberOfPeople: number; } | null; diff --git a/src/@types/socket.types.ts b/src/@types/socket.types.ts index be9c82fa..128a9d20 100644 --- a/src/@types/socket.types.ts +++ b/src/@types/socket.types.ts @@ -62,15 +62,11 @@ type subMemberMessage = (response: { message: string; data: { tripId: number; - connectedMembers: { - memberId: number; - name: string; - thumbnailUrl: string; - }[]; tripMembers: { memberId: number; name: string; thumbnailUrl: string; + connected: boolean; }[]; numberOfPeople: number; }; diff --git a/src/components/Plan/PlanSectionTop.tsx b/src/components/Plan/PlanSectionTop.tsx index 37224884..9d24dd6f 100644 --- a/src/components/Plan/PlanSectionTop.tsx +++ b/src/components/Plan/PlanSectionTop.tsx @@ -1,4 +1,4 @@ -import TripInfo from '@components/Trip/TripInfo'; +import TripRealtimeEditor from '@components/Trip/TripRealtimeEditor'; import { BackBox } from '@components/common'; import { useNavigate } from 'react-router-dom'; import TripBudget from './TripBudget'; @@ -11,6 +11,7 @@ import { useEffect } from 'react'; import { useRecoilValue } from 'recoil'; import { tripIdState, memberIdState } from '@recoil/socket'; import { calculateDayAndDate } from '@utils/utils'; +import { TripSchedule } from '@components/Trip/TripSchedule'; const PlanSectionTop = () => { const navigate = useNavigate(); @@ -36,7 +37,7 @@ const PlanSectionTop = () => { if (startDate && endDate) { ({ DayArr, DateArr } = calculateDayAndDate(startDate, endDate)); } - + return (
{ navigate(-1); }} /> - + + {
{isAccordion && } -
-
-
-
강릉 여행 일정
-
- - 5 -
-
- -
- 23.12.23 - 23.12.25 +
{modalChildren === 'TripSurveyMember' && } diff --git a/src/components/Trip/TripRealtimeEditor.tsx b/src/components/Trip/TripRealtimeEditor.tsx new file mode 100644 index 00000000..2e5428ca --- /dev/null +++ b/src/components/Trip/TripRealtimeEditor.tsx @@ -0,0 +1,66 @@ +import { useRecoilValue } from 'recoil'; +import { tripIdState, memberIdState } from '@recoil/socket'; +import { useEffect } from 'react'; +import { socketContext } from '@hooks/useSocket'; +import { useContext } from 'react'; +import { pubConnectMember, pubDisconnectMember } from '@api/socket'; +import { UserIcon } from '@components/common/icons/Icons'; + +const TripRealtimeEditor = () => { + const tripId = useRecoilValue(tripIdState); + const pubMember = useRecoilValue(memberIdState); + if (!pubMember || !tripId) { + return
에러
; + } + + const { callBackPub, tripMember } = useContext(socketContext); + + useEffect(() => { + callBackPub(() => pubConnectMember(pubMember, tripId)); + return () => { + callBackPub(() => pubDisconnectMember(pubMember, tripId)); + }; + }, []); + + const tripMemberData = tripMember?.data; + + return ( +
+ {tripMemberData?.tripMembers?.map((member) => { + const isConnected = member?.connected; + const thumbnailUrl = member?.thumbnailUrl; + const isImageUrlValid = + thumbnailUrl && thumbnailUrl !== 'http://asiduheimage.jpg'; + const imageUrl = isImageUrlValid ? thumbnailUrl : null; + + return ( +
+ {imageUrl ? ( + 유저 프로필 + ) : ( +
+ +
+ )} +
+ + {member?.name} + +
+
+ ); + })} +
+ ); +}; + +export default TripRealtimeEditor; diff --git a/src/components/Trip/TripSchedule.tsx b/src/components/Trip/TripSchedule.tsx new file mode 100644 index 00000000..efca618b --- /dev/null +++ b/src/components/Trip/TripSchedule.tsx @@ -0,0 +1,22 @@ +import { UserIcon } from '@components/common/icons/Icons'; + +export const TripSchedule = () => { + return ( + <> +
+
+
+
강릉 여행 일정
+
+ + 5 +
+
+ +
+ 23.12.23 - 23.12.25 + + ); +}; From 273f84251b7024fa0c042620d3bc53f20afd4c66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=96=B4=EC=8A=B9=EC=A4=80?= Date: Thu, 18 Jan 2024 16:33:44 +0900 Subject: [PATCH 3/8] =?UTF-8?q?Fix:=20alert=20=EC=B0=BD=20=EB=94=94?= =?UTF-8?q?=EC=9E=90=EC=9D=B8=20=EA=B0=9C=EC=84=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Trip/TripSchedule.tsx | 3 ++- src/components/common/modal/Modal.tsx | 10 +++++----- src/components/common/modal/children/MyAlert.tsx | 2 +- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/components/Trip/TripSchedule.tsx b/src/components/Trip/TripSchedule.tsx index efca618b..878d730a 100644 --- a/src/components/Trip/TripSchedule.tsx +++ b/src/components/Trip/TripSchedule.tsx @@ -1,9 +1,10 @@ import { UserIcon } from '@components/common/icons/Icons'; +import { ReactComponent as NullUser } from '@assets/images/NullUser.svg'; export const TripSchedule = () => { return ( <> -
+
강릉 여행 일정
diff --git a/src/components/common/modal/Modal.tsx b/src/components/common/modal/Modal.tsx index c8ec7ed8..bb558735 100644 --- a/src/components/common/modal/Modal.tsx +++ b/src/components/common/modal/Modal.tsx @@ -43,8 +43,8 @@ export const getModalStyles = (modalChildren: string) => { maxWidth: '412px', width: '100%', height: '186px', - borderTopLeftRadius: '2rem', - borderTopRightRadius: '2rem', + borderTopLeftRadius: '16px', + borderTopRightRadius: '16px', }, overlay: { backgroundColor: 'rgba(0, 0, 0, 0.25)', @@ -62,7 +62,7 @@ export const getModalStyles = (modalChildren: string) => { transform: 'translate(-50%, -50%)', width: '309px', height: '192px', - borderRadius: '2rem', + borderRadius: '16px', }, overlay: { backgroundColor: 'rgba(0, 0, 0, 0.25)', @@ -81,8 +81,8 @@ export const getModalStyles = (modalChildren: string) => { maxWidth: '412px', width: '100%', height: '280px', - borderTopLeftRadius: '2rem', - borderTopRightRadius: '2rem', + borderTopLeftRadius: '16px', + borderTopRightRadius: '16px', }, overlay: { backgroundColor: 'rgba(0, 0, 0, 0.25)', diff --git a/src/components/common/modal/children/MyAlert.tsx b/src/components/common/modal/children/MyAlert.tsx index e5f50f7e..7e226d68 100644 --- a/src/components/common/modal/children/MyAlert.tsx +++ b/src/components/common/modal/children/MyAlert.tsx @@ -69,7 +69,7 @@ const MyAlert: React.FC = ({ title, content }) => {
{title}
- {content.split('. ').map((sentence, index) => ( + {content.split(/(?<=\.) /).map((sentence, index) => (
{sentence}
From d335cda13fa3587d40ba8702ecc6f5e9556ceb4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=96=B4=EC=8A=B9=EC=A4=80?= Date: Thu, 18 Jan 2024 17:53:19 +0900 Subject: [PATCH 4/8] =?UTF-8?q?Fix:=20=EA=B8=B0=EB=B3=B8=20=ED=94=84?= =?UTF-8?q?=EB=A1=9C=ED=95=84=20=EC=84=A4=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Trip/TripInfo.tsx | 19 ++++- src/components/Trip/TripParticipant.tsx | 11 ++- src/components/Trip/TripRealtimeEditor.tsx | 80 +++++++++++++--------- 3 files changed, 73 insertions(+), 37 deletions(-) diff --git a/src/components/Trip/TripInfo.tsx b/src/components/Trip/TripInfo.tsx index 306db026..b0f82678 100644 --- a/src/components/Trip/TripInfo.tsx +++ b/src/components/Trip/TripInfo.tsx @@ -6,9 +6,10 @@ import { Modal } from '@components/common/modal'; import { useQuery } from '@tanstack/react-query'; import { getTripsMembers } from '@api/trips'; import { tripIdState } from '@recoil/socket'; -import { ReactComponent as NullUser } from '@assets/images/NullUser.svg'; +// import { ReactComponent as NullUser } from '@assets/images/NullUser.svg'; import { DownIcon } from '@components/common/icons/Icons'; import { useState } from 'react'; +import { UserIcon } from '@components/common/icons/Icons'; const ShareList = () => { const tripId = Number(useRecoilValue(tripIdState)); @@ -35,7 +36,13 @@ const ShareList = () => { className="h-[32px] w-[32px] rounded-full" /> ) : ( - +
+ +
+ // )}
{member.nickname}
@@ -81,7 +88,13 @@ const TripInfo = () => { className="h-[32px] w-[32px] rounded-full border-2 border-solid border-white" /> ) : ( - +
+ +
+ // )}
))} diff --git a/src/components/Trip/TripParticipant.tsx b/src/components/Trip/TripParticipant.tsx index 934aa95e..f8fac765 100644 --- a/src/components/Trip/TripParticipant.tsx +++ b/src/components/Trip/TripParticipant.tsx @@ -1,6 +1,7 @@ -import { ReactComponent as NullUser } from '@assets/images/NullUser.svg'; +// import { ReactComponent as NullUser } from '@assets/images/NullUser.svg'; import { useRecoilValue } from 'recoil'; import { participantsState } from '@recoil/trip'; +import { UserIcon } from '@components/common/icons/Icons'; interface ParticipantStatusProps { status: string; @@ -19,7 +20,13 @@ const ParticipantList: React.FC<{ infos: any[] }> = ({ infos }) => ( className="h-[32px] w-[32px] rounded-full" /> ) : ( - +
+ +
+ // )}
{info.nickname}
diff --git a/src/components/Trip/TripRealtimeEditor.tsx b/src/components/Trip/TripRealtimeEditor.tsx index 2e5428ca..dc9a9232 100644 --- a/src/components/Trip/TripRealtimeEditor.tsx +++ b/src/components/Trip/TripRealtimeEditor.tsx @@ -5,6 +5,8 @@ import { socketContext } from '@hooks/useSocket'; import { useContext } from 'react'; import { pubConnectMember, pubDisconnectMember } from '@api/socket'; import { UserIcon } from '@components/common/icons/Icons'; +import { Swiper, SwiperSlide } from 'swiper/react'; +import { Navigation } from 'swiper/modules'; const TripRealtimeEditor = () => { const tripId = useRecoilValue(tripIdState); @@ -25,40 +27,54 @@ const TripRealtimeEditor = () => { const tripMemberData = tripMember?.data; return ( -
- {tripMemberData?.tripMembers?.map((member) => { - const isConnected = member?.connected; - const thumbnailUrl = member?.thumbnailUrl; - const isImageUrlValid = - thumbnailUrl && thumbnailUrl !== 'http://asiduheimage.jpg'; - const imageUrl = isImageUrlValid ? thumbnailUrl : null; +
+ console.log('slide change')} + onSwiper={(swiper) => console.log(swiper)} + navigation={true} + modules={[Navigation]} + className="flex w-[375px] items-center justify-center"> + {tripMemberData?.tripMembers?.map((member) => { + const isConnected = member?.connected; + const thumbnailUrl = member?.thumbnailUrl; + const isImageUrlValid = + thumbnailUrl && thumbnailUrl !== 'http://asiduheimage.jpg'; + const imageUrl = isImageUrlValid ? thumbnailUrl : null; - return ( -
- {imageUrl ? ( - 유저 프로필 - ) : ( -
- + return ( + +
+ {imageUrl ? ( + 유저 프로필 + ) : ( +
+ +
+ )} +
+ + {member?.name} + +
- )} -
- - {member?.name} - -
-
- ); - })} + + ); + })} +
); }; From fda0ccb02693dc9b7e8748562b8556707968d427 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=96=B4=EC=8A=B9=EC=A4=80?= Date: Thu, 18 Jan 2024 18:25:44 +0900 Subject: [PATCH 5/8] =?UTF-8?q?Feat:=20swiper=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 | 3 ++- src/components/Review/CommentItem.tsx | 6 +++--- src/components/Trip/TripRealtimeEditor.tsx | 3 ++- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/api/socket.ts b/src/api/socket.ts index 94033e68..6d70c14c 100644 --- a/src/api/socket.ts +++ b/src/api/socket.ts @@ -140,6 +140,7 @@ export const pubConnectMember = (pubMember: pubMember, tripId: string) => { destination: `/pub/trips/${tripId}/connectMember`, body: JSON.stringify(pubMember), }); + console.log('펍실행', pubMember); }; // 멤버 여정 페이지 퇴장 이벤트 발생시 @@ -163,7 +164,7 @@ export const pubGetPathAndItems = ( pubGetPathAndItems: pubGetPathAndItems, tripId: string, ) => { - console.log('펍내부',pubGetPathAndItems); + console.log('펍내부', pubGetPathAndItems); socketClient.publish({ destination: `/pub/trips/${tripId}/getPathAndItems`, body: JSON.stringify(pubGetPathAndItems), diff --git a/src/components/Review/CommentItem.tsx b/src/components/Review/CommentItem.tsx index c4e4d264..33712b0c 100644 --- a/src/components/Review/CommentItem.tsx +++ b/src/components/Review/CommentItem.tsx @@ -57,7 +57,7 @@ const CommentItem: React.FC = (props: ItemProps) => { return (
-
+
{!( authorProfileImageUrl === 'http://asiduheimage.jpg' || authorProfileImageUrl === null @@ -65,7 +65,7 @@ const CommentItem: React.FC = (props: ItemProps) => { 유저 프로필 ) : ( @@ -85,7 +85,7 @@ const CommentItem: React.FC = (props: ItemProps) => {
)}
-
{content}
+
{content}
); }; diff --git a/src/components/Trip/TripRealtimeEditor.tsx b/src/components/Trip/TripRealtimeEditor.tsx index dc9a9232..d151ed59 100644 --- a/src/components/Trip/TripRealtimeEditor.tsx +++ b/src/components/Trip/TripRealtimeEditor.tsx @@ -17,6 +17,7 @@ const TripRealtimeEditor = () => { const { callBackPub, tripMember } = useContext(socketContext); + console.log('pubMember', pubMember); useEffect(() => { callBackPub(() => pubConnectMember(pubMember, tripId)); return () => { @@ -27,7 +28,7 @@ const TripRealtimeEditor = () => { const tripMemberData = tripMember?.data; return ( -
+
console.log('slide change')} From 98abf65ad7c7381fefe8805e6490a0d46454810b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=96=B4=EC=8A=B9=EC=A4=80?= Date: Fri, 19 Jan 2024 18:27:57 +0900 Subject: [PATCH 6/8] =?UTF-8?q?Fix:=20=EC=9D=98=EC=A1=B4=EC=84=B1=EB=B0=B0?= =?UTF-8?q?=EC=97=B4=EC=97=90=20=ED=86=A0=ED=81=B0=EA=B0=9D=EC=B2=B4=20?= =?UTF-8?q?=EB=84=A3=EC=96=B4=20=EC=8B=A4=EC=8B=9C=EA=B0=84=ED=8E=B8?= =?UTF-8?q?=EC=A7=91=EC=A4=91=EB=A9=A4=EB=B2=84=20=EB=94=94=EB=B2=84?= =?UTF-8?q?=EA=B9=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/@types/socket.types.ts | 2 +- src/api/socket.ts | 1 - src/components/Plan/PlanSectionTop.tsx | 14 +++++--- src/components/Trip/TripRealtimeEditor.tsx | 42 ++++++++++++++-------- src/hooks/useSocket.ts | 1 + src/recoil/socket.ts | 4 +-- 6 files changed, 40 insertions(+), 24 deletions(-) diff --git a/src/@types/socket.types.ts b/src/@types/socket.types.ts index 128a9d20..5b9697ef 100644 --- a/src/@types/socket.types.ts +++ b/src/@types/socket.types.ts @@ -128,7 +128,7 @@ interface pubDeleteItem { } interface pubMember { - memberId: number; + token: string; } interface pubGetPathAndItems { diff --git a/src/api/socket.ts b/src/api/socket.ts index 6d70c14c..2f84b64c 100644 --- a/src/api/socket.ts +++ b/src/api/socket.ts @@ -140,7 +140,6 @@ export const pubConnectMember = (pubMember: pubMember, tripId: string) => { destination: `/pub/trips/${tripId}/connectMember`, body: JSON.stringify(pubMember), }); - console.log('펍실행', pubMember); }; // 멤버 여정 페이지 퇴장 이벤트 발생시 diff --git a/src/components/Plan/PlanSectionTop.tsx b/src/components/Plan/PlanSectionTop.tsx index 9d24dd6f..e37c6089 100644 --- a/src/components/Plan/PlanSectionTop.tsx +++ b/src/components/Plan/PlanSectionTop.tsx @@ -12,20 +12,24 @@ import { useRecoilValue } from 'recoil'; import { tripIdState, memberIdState } from '@recoil/socket'; import { calculateDayAndDate } from '@utils/utils'; import { TripSchedule } from '@components/Trip/TripSchedule'; +import { getItem } from '@utils/localStorageFun'; const PlanSectionTop = () => { const navigate = useNavigate(); const tripId = useRecoilValue(tripIdState); - const pubMember = useRecoilValue(memberIdState); + const token = getItem('accessToken'); + const pubMember = { token: token || '' }; - if (!pubMember || !tripId) { - return
에러
; - } + // if (!pubMember.token || !tripId) { + // return
에러
; + // } const { callBackPub, tripInfo } = useContext(socketContext); useEffect(() => { - callBackPub(() => pubEnterMember(pubMember, tripId)); + if (pubMember && tripId) { + callBackPub(() => pubEnterMember(pubMember, tripId)); + } }, []); let DayArr: string[] = []; diff --git a/src/components/Trip/TripRealtimeEditor.tsx b/src/components/Trip/TripRealtimeEditor.tsx index d151ed59..4d810455 100644 --- a/src/components/Trip/TripRealtimeEditor.tsx +++ b/src/components/Trip/TripRealtimeEditor.tsx @@ -1,38 +1,50 @@ import { useRecoilValue } from 'recoil'; -import { tripIdState, memberIdState } from '@recoil/socket'; -import { useEffect } from 'react'; +import { tripIdState } from '@recoil/socket'; +import { useEffect, useState } from 'react'; import { socketContext } from '@hooks/useSocket'; import { useContext } from 'react'; import { pubConnectMember, pubDisconnectMember } from '@api/socket'; import { UserIcon } from '@components/common/icons/Icons'; import { Swiper, SwiperSlide } from 'swiper/react'; import { Navigation } from 'swiper/modules'; +import { getItem } from '@utils/localStorageFun'; const TripRealtimeEditor = () => { const tripId = useRecoilValue(tripIdState); - const pubMember = useRecoilValue(memberIdState); - if (!pubMember || !tripId) { - return
에러
; - } - const { callBackPub, tripMember } = useContext(socketContext); + const [token, setToken] = useState(''); + const [pubMember, setPubMember] = useState({ token: '' }); - console.log('pubMember', pubMember); useEffect(() => { - callBackPub(() => pubConnectMember(pubMember, tripId)); - return () => { - callBackPub(() => pubDisconnectMember(pubMember, tripId)); - }; + const accessToken = getItem('accessToken'); + if (accessToken) { + setToken(accessToken); + } }, []); - const tripMemberData = tripMember?.data; + useEffect(() => { + setPubMember({ token: token || '' }); + }, [token]); + useEffect(() => { + if (pubMember && tripId) { + callBackPub(() => { + pubConnectMember(pubMember, tripId); + }); + return () => { + callBackPub(() => pubDisconnectMember(pubMember, tripId)); + }; + } + }, [pubMember]); + + const tripMemberData = tripMember?.data; + useEffect(() => { + console.log('tripMemberData', tripMemberData); + }, [tripMemberData]); return (
console.log('slide change')} - onSwiper={(swiper) => console.log(swiper)} navigation={true} modules={[Navigation]} className="flex w-[375px] items-center justify-center"> diff --git a/src/hooks/useSocket.ts b/src/hooks/useSocket.ts index 50c9e2d6..ba204b5b 100644 --- a/src/hooks/useSocket.ts +++ b/src/hooks/useSocket.ts @@ -63,6 +63,7 @@ export const useSocket = (tripId: string, visitDate: string) => { subMember(tripId, (res) => { if (res) { + // console.log('subMemberRes', res); setTripMember(res); } }); diff --git a/src/recoil/socket.ts b/src/recoil/socket.ts index d722c733..ab7bb76b 100644 --- a/src/recoil/socket.ts +++ b/src/recoil/socket.ts @@ -10,7 +10,7 @@ export const visitDateState = atom<{ visitDate: string } | null>({ default: { visitDate: '2024-01-03' }, }); -export const memberIdState = atom<{ memberId: number } | null>({ +export const memberIdState = atom<{ token: number | null }>({ key: 'memberIdState', - default: { memberId: 1 }, + default: { token: null }, }); From f54530a4b8939bcdc87cd8bfa25bce02fe781742 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=96=B4=EC=8A=B9=EC=A4=80?= Date: Fri, 19 Jan 2024 18:45:02 +0900 Subject: [PATCH 7/8] =?UTF-8?q?Fix:=20=EC=95=84=EC=BD=94=EB=94=94=EC=96=B8?= =?UTF-8?q?=20=EC=8A=A4=ED=81=AC=EB=A1=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Trip/PlanTripButton.tsx | 11 ++++++++++- src/components/Trip/TripInfo.tsx | 2 +- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/components/Trip/PlanTripButton.tsx b/src/components/Trip/PlanTripButton.tsx index db7b4639..34ce58a5 100644 --- a/src/components/Trip/PlanTripButton.tsx +++ b/src/components/Trip/PlanTripButton.tsx @@ -1,8 +1,17 @@ import { PlanColorIcon, RightIcon } from '@components/common/icons/Icons'; +import { useNavigate } from 'react-router-dom'; const PlanTripButton = () => { + const navigate = useNavigate(); + + const handleButtonClick = () => { + navigate('plan'); + }; + return ( -