Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: 문의 채팅 버튼이 뜨지 않는 오류 수정 #78

Merged
merged 2 commits into from
Aug 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 21 additions & 8 deletions components/ActivityDetails/ActivityDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,15 @@ import { darkModeState } from '@/states/themeState';
import { ShareButton } from '../ShareButton/ShareButton';
import { ViewedActivitiesState } from '@/states/ViewedState';
import { ViewedActivityProps } from '../ViewedActivities/ViewedActivities.type';
import useLoginState from '@/hooks/useLoginState';
import profileThumbnail from '@/public/image/profile-circle-icon-512x512-zxne30hp.png';
import SendChat from '../Chat/SendChat';

export default function ActivityDetails({ id }: ActivityDetailsProps) {
const router = useRouter();
const [isOpen, setIsOpen] = useState(false);
const isDarkMode = useRecoilValue(darkModeState);
const isLogined = useLoginState();
const [currentPage, setCurrentPage] = useState<number>(
router.query.page ? parseInt(router.query.page as string, 10) : 1
);
Expand Down Expand Up @@ -203,14 +206,24 @@ export default function ActivityDetails({ id }: ActivityDetailsProps) {
</div>
</div>
</div>
<div className="flex t:items-center m:items-end">
<ShareButton
type="none-bg"
title={activityData?.title}
bannerImageUrl={activityData?.bannerImageUrl}
description={activityData?.description}
activityId={id}
/>
<div className="flex items-center t:items-center m:items-center">
<div className="flex gap-[12px]">
{isLogined.isLoggedIn && !isAuthor && (
<SendChat
receiver={Number(activityData?.userId)}
activityId={Number(activityData?.id)}
activityTitle={String(activityData?.title)}
activityImage={String(activityData?.bannerImageUrl)}
/>
)}
<ShareButton
type="none-bg"
title={activityData?.title}
bannerImageUrl={activityData?.bannerImageUrl}
description={activityData?.description}
activityId={id}
/>
</div>
{isAuthor && (
<div className="flex items-center">
<MeatballButton onClick={toggleMenu} />
Expand Down