Skip to content

Commit

Permalink
feat: 좋아요 로깅 추가 (#1392)
Browse files Browse the repository at this point in the history
  • Loading branch information
simeunseo authored Apr 28, 2024
1 parent 3c55094 commit 85a7d3b
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 16 deletions.
7 changes: 7 additions & 0 deletions src/components/eventLogger/events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,13 @@ export interface ClickEvents {
feedId: string;
};
feedUploadButton: undefined;
feedLike: {
feedId: string;
};
feedUnlike: {
feedId: string;
};

//다짐메시지
welcomeBannerResolution: {
isAlreadySubmitted: boolean;
Expand Down
34 changes: 18 additions & 16 deletions src/components/feed/list/FeedListItems.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -206,22 +206,24 @@ const FeedListItems: FC<FeedListItemsProps> = ({ categoryId, renderFeedDetailLin
</FeedDropdown>
}
like={
<FeedLike
isLiked={post.isLiked}
likes={post.likes}
onClick={(e) => {
e.stopPropagation();
e.preventDefault();
handleToggleLike({
postId: post.id,
isLiked: post.isLiked,
likes: post.likes,
allPostsQueryKey: useGetPostsInfiniteQuery.getKey(''),
postsQueryKey: useGetPostsInfiniteQuery.getKey(post.categoryId.toString()),
postQueryKey: getPost.cacheKey(post.id.toString()),
});
}}
/>
<LoggingClick eventKey={post.isLiked ? 'feedUnlike' : 'feedLike'} param={{ feedId: String(post.id) }}>
<FeedLike
isLiked={post.isLiked}
likes={post.likes}
onClick={(e) => {
e.stopPropagation();
e.preventDefault();
handleToggleLike({
postId: post.id,
isLiked: post.isLiked,
likes: post.likes,
allPostsQueryKey: useGetPostsInfiniteQuery.getKey(''),
postsQueryKey: useGetPostsInfiniteQuery.getKey(post.categoryId.toString()),
postQueryKey: getPost.cacheKey(post.id.toString()),
});
}}
/>
</LoggingClick>
}
>
{post.images.length !== 0 && (
Expand Down

0 comments on commit 85a7d3b

Please sign in to comment.