Skip to content

Commit

Permalink
[feat] modify modal router url by post type
Browse files Browse the repository at this point in the history
  • Loading branch information
lee1nna committed Nov 5, 2024
1 parent a4cb777 commit 76875cd
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,12 @@ const FeedContentBox = ({ feed }: FeedContentBoxProps) => {
const router = useRouter();

const onClickMoreButton = () => {
router.push('?f=1');
if (feed.post.postType === 'BASIC') {
router.push('?cf=1');
}
if (feed.post.postType === 'DEBATE') {
router.push('?df=1');
}
};

return (
Expand Down
9 changes: 7 additions & 2 deletions src/app/(MainLayout)/components/FeedCountBox/FeedCountBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,17 @@ const FeedCountBox = ({ post }: FeedCountBoxProps) => {
const router = useRouter();

const onClickMessageIcon = () => {
router.push('?f=1');
if (post.postType === 'BASIC') {
router.push('?cf=1');
}
if (post.postType === 'DEBATE') {
router.push('?df=1');
}
};

return (
<div className={styles.count_box}>
<LikeButton size="medium" postId={post.postId} />
<LikeButton isLike={false} size="medium" postId={post.postId} />
<div className={styles.like_count}>
{digitNumberFormatter(post.likeCount)}
</div>
Expand Down

0 comments on commit 76875cd

Please sign in to comment.