From d67cb04393d9866bb1060e948f8a30043f0b66c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9D=80=EC=A7=80?= <103625348+eunji-0623@users.noreply.github.com> Date: Wed, 31 Jul 2024 18:11:21 +0900 Subject: [PATCH] =?UTF-8?q?Revert=20"Feat:=20=EC=B1=84=ED=8C=85=20?= =?UTF-8?q?=ED=8C=9D=EC=97=85=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 --- .../ActivityDetails/ActivityDetails.tsx | 8 +- components/Chat/SendChat.tsx | 37 ++++----- components/Chat/SendChat.types.ts | 2 - components/MyActivity/Card/Card.tsx | 12 +-- components/Popup/ChatPopup.tsx | 83 ++++--------------- components/Popup/ChatPopup.types.tsx | 6 -- public/icon/chat_close.svg | 1 - public/icon/prev_arrow.svg | 1 - server/server.js | 1 - 9 files changed, 36 insertions(+), 115 deletions(-) delete mode 100644 public/icon/chat_close.svg delete mode 100644 public/icon/prev_arrow.svg diff --git a/components/ActivityDetails/ActivityDetails.tsx b/components/ActivityDetails/ActivityDetails.tsx index dcbef29..29e75ef 100644 --- a/components/ActivityDetails/ActivityDetails.tsx +++ b/components/ActivityDetails/ActivityDetails.tsx @@ -28,7 +28,6 @@ import { usePopup } from '@/hooks/usePopup'; import { darkModeState } from '@/states/themeState'; import SendChat from '../Chat/SendChat'; import { ShareButton } from '../ShareButton/ShareButton'; -import { loginState } from '@/states/loginState'; import { ViewedActivitiesState } from '@/states/ViewedState'; import { ViewedActivityProps } from '../ViewedActivities/ViewedActivities.type'; @@ -36,7 +35,6 @@ export default function ActivityDetails({ id }: ActivityDetailsProps) { const router = useRouter(); const [isOpen, setIsOpen] = useState(false); const isDarkMode = useRecoilValue(darkModeState); - const isLogined = useRecoilValue(loginState); const [currentPage, setCurrentPage] = useState( router.query.page ? parseInt(router.query.page as string, 10) : 1 ); @@ -205,14 +203,12 @@ export default function ActivityDetails({ id }: ActivityDetailsProps) { -
+
- {isLogined && !isAuthor && ( + {!isAuthor && ( )} - {isPopupOpen && ( - + )} ); diff --git a/components/Chat/SendChat.types.ts b/components/Chat/SendChat.types.ts index 9db2d2a..e67e308 100644 --- a/components/Chat/SendChat.types.ts +++ b/components/Chat/SendChat.types.ts @@ -1,6 +1,4 @@ export interface SendChatProps { receiver: number; activityId: number; - activityTitle: string; - activityImage: string; } diff --git a/components/MyActivity/Card/Card.tsx b/components/MyActivity/Card/Card.tsx index 3cdabef..1f2af02 100644 --- a/components/MyActivity/Card/Card.tsx +++ b/components/MyActivity/Card/Card.tsx @@ -12,8 +12,6 @@ import Link from 'next/link'; import ChatPopup from '@/components/Popup/ChatPopup'; import { useUserData } from '@/hooks/useUserData'; import socket from '@/server/server'; -import { useRecoilValue } from 'recoil'; -import { darkModeState } from '@/states/themeState'; function PopoverButton({ children, onClick }: PopoverButtonProps) { return ( @@ -71,7 +69,7 @@ function Card({ }: CardProps) { const [isPopoverOpen, setIsPopoverOpen] = useState(false); const [isPopupOpen, setIsPopupOpen] = useState(false); - const isDarkMode = useRecoilValue(darkModeState); + const { userData } = useUserData(); const handleClickMeatball = () => { setIsPopoverOpen(!isPopoverOpen); @@ -134,11 +132,7 @@ function Card({
- )} - +
@@ -106,10 +60,6 @@ function ChatPopup({ activityId={activityId} handleSenderId={setSenderId} handleSendEnable={setIsSendEnabled} - isEnter={isEnter} - handleIsEnter={setIsEnter} - handleNickName={setNickName} - handleProfile={setProfile} /> ) : ( @@ -141,23 +91,18 @@ function ShowChatRoomList({ activityId, handleSenderId, handleSendEnable, - isEnter, - handleIsEnter, - handleNickName, - handleProfile, }: ChatRoomPopupProps) { const [rooms, setRooms] = useState([]); + const [isEnter, setIsEnter] = useState(false); const { userData } = useUserData(); - const handleClickRoom = (userId: number, index: number) => { + const handleClickRoom = (userId: number) => { socket.emit('inquiryAdmin', userData.id, activityId, userId, (res: any) => { console.log('inquiryAdmin res', res); }); - handleIsEnter(true); + setIsEnter(true); handleSenderId(userId); handleSendEnable(true); - handleNickName(rooms[index].user.name); - handleProfile(rooms[index].user.profile); }; useEffect(() => { @@ -184,8 +129,8 @@ function ShowChatRoomList({