Skip to content

Commit

Permalink
[Fix] 댓글 갯수 보여지게 수정, 공유 갯수 삭제 #32
Browse files Browse the repository at this point in the history
입력된 댓글 갯수 연결
댓글 입력할 때 자동으로 카운트가 올라가지는 않습니다..
  • Loading branch information
WooYeonSeo committed Dec 13, 2019
1 parent c1aac4f commit 404a2e9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions client/src/composition/Feed/Feed.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ function Feed({ content, createdAt, feedinfo }: Iprops) {
hasLiked={hasLiked}
setHasLiked={setHasLiked}
feedId={feedinfo.feedId}
commentCount={feedinfo.comments ? feedinfo.comments.length : 0}
/>
</FeedContentDiv>

Expand Down
6 changes: 4 additions & 2 deletions client/src/composition/Feed/FeedFooter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ interface Iprops {
hasLiked: boolean;
setHasLiked: any;
feedId: number | null | undefined;
commentCount: number;
}

const SEND_LIKE = gql`
Expand All @@ -84,7 +85,8 @@ const FeedFooter = ({
setLikeCnt,
hasLiked,
setHasLiked,
feedId
feedId,
commentCount
}: Iprops) => {
const [updateLike] = useMutation(SEND_LIKE);

Expand All @@ -110,7 +112,7 @@ const FeedFooter = ({
</LikeShowDiv>

<ActionStateDiv>
<span>댓글 2개 </span> <span> 공유 5회</span>
<span>댓글 {commentCount}</span>
</ActionStateDiv>
</FeedActionDiv>
<ActionbtnDiv>
Expand Down

0 comments on commit 404a2e9

Please sign in to comment.