Skip to content

Commit a4fa049

Browse files
authored
Merge pull request #217 from SystemConsultantGroup/fix/hynseok-patch-6
[FIX] 프로젝트 페이지 탭이동시 좋아요, 북마크 등 고정되어있는 버그 수정
2 parents fb9bfac + 7fefc5a commit a4fa049

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/components/common/ProjectCard/ProjectCardLikeSection.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import {
88
IconThumbUpFilled,
99
} from "@tabler/icons-react";
1010
import classes from "./ProjectCard.module.css";
11-
import { useState } from "react";
11+
import { useEffect, useState } from "react";
1212
import { useAuth } from "../Auth";
1313

1414
export interface ProjectCardLikeSectionProps {
@@ -49,6 +49,13 @@ export function ProjectCardLikeSection({
4949
alert("프로젝트를 북마크에 추가하려면 로그인해야 합니다.");
5050
}
5151
};
52+
53+
useEffect(() => {
54+
setLike(likes);
55+
setIsLike(isLiked);
56+
setIsMark(isMarked);
57+
}, [likes, isLiked, isMarked]);
58+
5259
return (
5360
<CardSection className={classes["like-section"]}>
5461
<Group align="center" justify="space-between" p="8px 16px">

0 commit comments

Comments
 (0)