Skip to content

Commit

Permalink
[#218] QA: 요구사항 반영 (#219)
Browse files Browse the repository at this point in the history
  • Loading branch information
HoberMin authored Jul 28, 2024
1 parent 603fc03 commit 754b59f
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ import { PropsWithChildren } from 'react';

import Image from 'next/image';
import Link from 'next/link';
import { useParams } from 'next/navigation';

import { useGetPostDetailAPI } from '@/src/apis/postDetail';
import { formatDateCustom } from '@/src/utils/formatDate';

import OwnCommentChip from './OwnCommentChip';
Expand All @@ -20,11 +22,13 @@ const CommentItem = ({
nickname,
content,
createdAt,
isOwnComment,
children,
authorId,
profileImageUrl,
authorId,
}: PropsWithChildren<CommentItemProps>) => {
const { postId } = useParams() as { postId: string };
const { authorId: postAuthorId } = useGetPostDetailAPI(postId);

return (
<div className='flex w-full flex-col gap-2'>
<div className='flex items-center justify-between'>
Expand All @@ -38,7 +42,7 @@ const CommentItem = ({
className='h-[24px] w-[24px] rounded-[4px]'
/>
<span className='font-title-1-md'>{nickname}</span>
{isOwnComment && <OwnCommentChip />}
{postAuthorId === authorId && <OwnCommentChip />}
</div>
</Link>
{children}
Expand Down
27 changes: 13 additions & 14 deletions src/app/users/_components/badge.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,23 +27,25 @@ const BadgeBlock = () => {
/>
<span
className={cn('font-text-2-md', posting < 4 && 'text-gray-accent3')}
>{`글 ${posting} 작성`}</span>
>{`글 3회 작성`}</span>
</div>
<div className='flex flex-col items-center gap-3'>
<Image
src={voting > 15 ? '/badge/vote-fill.svg' : '/badge/vote-line.svg'}
src={voting > 5 ? '/badge/vote-fill.svg' : '/badge/vote-line.svg'}
alt='포스팅뱃지'
width={55}
height={55}
/>
<span
className={cn('font-text-2-md', voting < 16 && 'text-gray-accent3')}
>{`투표 ${voting}회`}</span>
className={cn('font-text-2-md', voting < 6 && 'text-gray-accent3')}
>
투표 5회
</span>
</div>
<div className='flex flex-col items-center gap-3'>
<Image
src={
comment > 10
comment > 5
? '/badge/comment-fill.svg'
: '/badge/comment-line.svg'
}
Expand All @@ -52,22 +54,19 @@ const BadgeBlock = () => {
height={55}
/>
<span
className={cn(
'font-text-2-md',
comment < 10 && 'text-gray-accent3',
)}
>{`댓글 ${comment}회`}</span>
className={cn('font-text-2-md', comment < 6 && 'text-gray-accent3')}
>{`댓글 5회`}</span>
</div>
<div className='flex flex-col items-center gap-3'>
<Image
src={like > 20 ? '/badge/like-fill.svg' : '/badge/like-line.svg'}
src={like > 10 ? '/badge/like-fill.svg' : '/badge/like-line.svg'}
alt='포스팅뱃지'
width={55}
height={55}
/>
<span
className={cn('font-text-2-md', like < 21 && 'text-gray-accent3')}
>{`좋아요 ${like}`}</span>
className={cn('font-text-2-md', like < 11 && 'text-gray-accent3')}
>{`좋아요 11회`}</span>
</div>
<div className='flex flex-col items-center gap-3'>
<Image
Expand All @@ -80,7 +79,7 @@ const BadgeBlock = () => {
/>
<span
className={cn('font-text-2-md', follow < 11 && 'text-gray-accent3')}
>{`팔로워 ${follow}`}</span>
>{`팔로워 10명`}</span>
</div>
</div>
</div>
Expand Down

0 comments on commit 754b59f

Please sign in to comment.