Skip to content

Commit

Permalink
Fix: 로그인 했을 때만 문의 채팅 가능하도록 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
eunji-0623 committed Jul 31, 2024
1 parent 19fd74b commit beaca8a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion components/ActivityDetails/ActivityDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ 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';

export default function ActivityDetails({ id }: ActivityDetailsProps) {
const router = useRouter();
Expand Down Expand Up @@ -113,6 +114,8 @@ export default function ActivityDetails({ id }: ActivityDetailsProps) {

const paginatedReviews = reviewData?.reviews || [];
const isAuthor = activityData?.userId === userData?.id;
const isLogined = useRecoilValue(loginState);
console.log(isAuthor);
const currentUrl = typeof window !== 'undefined' ? window.location.href : '';

return (
Expand Down Expand Up @@ -166,7 +169,7 @@ export default function ActivityDetails({ id }: ActivityDetailsProps) {
</div>
<div className="flex items-center t:items-center m:items-center">
<div className="flex gap-[12px]">
{!isAuthor && (
{isLogined && !isAuthor && (
<SendChat
receiver={Number(activityData?.userId)}
activityId={Number(activityData?.id)}
Expand Down

0 comments on commit beaca8a

Please sign in to comment.