Skip to content

Commit

Permalink
FE-43✨ 에피그램 상세페이지 더보기 드롭다운 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
jisurk committed Jul 14, 2024
1 parent 657d74d commit 8cde498
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
20 changes: 20 additions & 0 deletions src/components/epigram/MoreOptionMenu.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import Image from 'next/image';
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from '../ui/dropdown-menu';

function MoreOptionsMenu() {
return (
<DropdownMenu>
<DropdownMenuTrigger asChild>
<button type='button'>
<Image src='/meatballIcon.svg' alt='더 보기 아이콘' width={36} height={36} />
</button>
</DropdownMenuTrigger>
<DropdownMenuContent>
<DropdownMenuItem>수정</DropdownMenuItem>
<DropdownMenuItem>삭제</DropdownMenuItem>
</DropdownMenuContent>
</DropdownMenu>
);
}

export default MoreOptionsMenu;
5 changes: 3 additions & 2 deletions src/pageLayout/Epigram/EpigramFigure.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { EpigramFigureProps } from '@/types/epigram.types';
import Image from 'next/image';
import MoreOptionsMenu from '@/components/epigram/MoreOptionMenu';
import { EpigramFigureProps } from '@/types/epigram.types';

function EpigramFigure({ epigram, currentUserId }: EpigramFigureProps) {
const isAuthor = currentUserId === epigram.writerId;
Expand All @@ -12,7 +13,7 @@ function EpigramFigure({ epigram, currentUserId }: EpigramFigureProps) {
#{tag.name}
</p>
))}
{isAuthor && <Image src='/meatballIcon.svg' alt='더 보기 아이콘' width={36} height={36} />}
{isAuthor && <MoreOptionsMenu />}
</div>
<blockquote className=''>
<p className='text-2xl lg:text-3xl font-normal'>{epigram.content}</p>
Expand Down

0 comments on commit 8cde498

Please sign in to comment.