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({