Skip to content

Commit

Permalink
Merge pull request #64 from Team-INSERT/feat/like
Browse files Browse the repository at this point in the history
feat : 좋아요 버튼
  • Loading branch information
winternuary authored Sep 14, 2023
2 parents d71af83 + e85a0b9 commit 8b86e21
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/page/forum-post/layouts/PostBody/CountBox.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
import React from "react";
import styled from "styled-components";
import { Row } from "@/components/Flex";
import { font } from "@/styles";
import { CommentIcon, Like } from "@/assets/icons";
import { CommentIcon, Like, LikeIcon } from "@/assets/icons";

interface ICountBoxProps {
commentCount: number;
likeCount: number;
}

const CountBox = ({ likeCount, commentCount }: ICountBoxProps) => {
const [isLiked, setIsLikded] = React.useState(false);
return (
<Row gap="22px">
<LikeBox>
<Like width={18} height={18} />
<LikeBox onClick={() => setIsLikded(!isLiked)}>
{isLiked ? <LikeIcon width={18} /> : <Like width={18} height={18} />}
<LikeText>{likeCount}</LikeText>
</LikeBox>
<Row alignItems="center" gap="4px">
Expand Down

0 comments on commit 8b86e21

Please sign in to comment.