diff --git a/components/ActivityDetails/ActivityDetails.tsx b/components/ActivityDetails/ActivityDetails.tsx index 29e75ef..577b758 100644 --- a/components/ActivityDetails/ActivityDetails.tsx +++ b/components/ActivityDetails/ActivityDetails.tsx @@ -26,10 +26,10 @@ import { ActivityDetailsPageMeta } from '../MetaData/MetaData'; import useDeleteActivity from '@/hooks/myActivity/useDeleteActivity'; import { usePopup } from '@/hooks/usePopup'; import { darkModeState } from '@/states/themeState'; -import SendChat from '../Chat/SendChat'; import { ShareButton } from '../ShareButton/ShareButton'; import { ViewedActivitiesState } from '@/states/ViewedState'; import { ViewedActivityProps } from '../ViewedActivities/ViewedActivities.type'; +import profileThumbnail from '@/public/image/profile-circle-icon-512x512-zxne30hp.png'; export default function ActivityDetails({ id }: ActivityDetailsProps) { const router = useRouter(); @@ -203,22 +203,14 @@ export default function ActivityDetails({ id }: ActivityDetailsProps) { -
-
- {!isAuthor && ( - - )} - -
+
+ {isAuthor && (
@@ -252,7 +244,7 @@ export default function ActivityDetails({ id }: ActivityDetailsProps) { /> )}
-
+

@@ -302,7 +294,7 @@ export default function ActivityDetails({ id }: ActivityDetailsProps) { >

{`${review.user.nickname}의 { const [showButton, setShowButton] = useState(false); + const router = useRouter(); + const isActivityDetailPage = router.pathname.startsWith('/activity-details/'); const scrollToTop = () => { window.scroll({ @@ -26,7 +29,13 @@ const TopButton = () => { return ( <> {showButton && ( -
+
{isPopupOpen && ( - + )} ); diff --git a/components/Chat/SendChat.types.ts b/components/Chat/SendChat.types.ts index e67e308..9db2d2a 100644 --- a/components/Chat/SendChat.types.ts +++ b/components/Chat/SendChat.types.ts @@ -1,4 +1,6 @@ export interface SendChatProps { receiver: number; activityId: number; + activityTitle: string; + activityImage: string; } diff --git a/components/Lander/AllActivities.tsx b/components/Lander/AllActivities.tsx index 49564db..5cc966e 100644 --- a/components/Lander/AllActivities.tsx +++ b/components/Lander/AllActivities.tsx @@ -157,7 +157,7 @@ function AllActivities() { return (
-
+
{Kategories.map((Kategorie, index) => ( diff --git a/components/MyActivity/Card/Card.tsx b/components/MyActivity/Card/Card.tsx index 1f2af02..3cdabef 100644 --- a/components/MyActivity/Card/Card.tsx +++ b/components/MyActivity/Card/Card.tsx @@ -12,6 +12,8 @@ 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 ( @@ -69,7 +71,7 @@ function Card({ }: CardProps) { const [isPopoverOpen, setIsPopoverOpen] = useState(false); const [isPopupOpen, setIsPopupOpen] = useState(false); - const { userData } = useUserData(); + const isDarkMode = useRecoilValue(darkModeState); const handleClickMeatball = () => { setIsPopoverOpen(!isPopoverOpen); @@ -132,7 +134,11 @@ function Card({
+ )} +
@@ -60,6 +107,10 @@ function ChatPopup({ activityId={activityId} handleSenderId={setSenderId} handleSendEnable={setIsSendEnabled} + isEnter={isEnter} + handleIsEnter={setIsEnter} + handleNickName={setNickName} + handleProfile={setProfile} /> ) : ( @@ -91,18 +142,23 @@ 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) => { + const handleClickRoom = (userId: number, index: number) => { socket.emit('inquiryAdmin', userData.id, activityId, userId, (res: any) => { console.log('inquiryAdmin res', res); }); - setIsEnter(true); + handleIsEnter(true); handleSenderId(userId); handleSendEnable(true); + handleNickName(rooms[index].user.name); + handleProfile(rooms[index].user.profile); }; useEffect(() => { @@ -129,8 +185,8 @@ function ShowChatRoomList({