Skip to content

Commit 9e40dbf

Browse files
Fix follower 코드수정
Fix follower 코드수정
2 parents a080760 + 62418b1 commit 9e40dbf

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

Diff for: src/components/follow/FollowerCard.jsx

+8-8
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ const FollowerCard = ({ follower }) => {
1111
const navigate = useNavigate();
1212
const dispatch = useDispatch();
1313
const [isFollowed, setIsFollowed] = useState(
14-
follower.followStatus === "ACTIVE" || "INIT"
14+
follower.followStatus === "INACTIVE"
1515
);
1616

1717
const [btnColor, setBtnColor] = useState(
18-
follower.followStatus === "ACTIVE" || "INIT" ? "#A31414" : "#002C51"
18+
follower.followStatus === "INACTIVE" ? "#002C51" : "#A31414"
1919
);
2020

2121
const handleClick = (e) => {
@@ -24,8 +24,8 @@ const FollowerCard = ({ follower }) => {
2424
};
2525

2626
useLayoutEffect(() => {
27-
if (isFollowed) setBtnColor("#A31414");
28-
else setBtnColor("#002C51");
27+
if (isFollowed) setBtnColor("#002C51");
28+
else setBtnColor("#A31414");
2929
}, [follower]);
3030

3131
return (
@@ -48,13 +48,13 @@ const FollowerCard = ({ follower }) => {
4848
<div className="flex w-[119px] items-center">{follower.username}</div>
4949
</div>
5050
{isFollowed ? (
51-
<div className="flex items-center w-[62px] h-[39px] justify-center text-sm rounded-[4px] text-white bg-[#A31414]">
52-
<span onClick={handleClick}>삭제</span>
53-
</div>
54-
) : (
5551
<div className="flex items-center w-[62px] h-[39px] justify-center text-sm rounded-[4px] text-white bg-[#002C51]">
5652
<span onClick={handleClick}>팔로우</span>
5753
</div>
54+
) : (
55+
<div className="flex items-center w-[62px] h-[39px] justify-center text-sm rounded-[4px] text-white bg-[#A31414]">
56+
<span onClick={handleClick}>삭제</span>
57+
</div>
5858
)}
5959
</div>
6060
);

0 commit comments

Comments
 (0)