Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions components/Dropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,24 @@ const Dropdown = ({ items }: DropdownProps) => {

return (
<div className="absolute top-[17px] right-0 flex flex-col gap-[2px] min-w-[100px] bg-white shadow-lg rounded">
{items.map((item, index) =>
{items.map((item) =>
// href가 있으면 Link로 렌더링
item.href ? (
<Link key={index} href={item.href} className={buttonStyle}>
<Link
key={item.label}
href={item.href}
onClick={item.onClick}
className={`${buttonStyle} text-center `}
>
{item.label}
</Link>
) : (
// href가 없으면 버튼으로 렌더링
<button key={index} onClick={item.onClick} className={buttonStyle}>
<button
key={item.label}
onClick={item.onClick}
className={buttonStyle}
>
{item.label}
</button>
)
Expand Down
3 changes: 2 additions & 1 deletion components/HeaderMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ const HeaderMenu = () => {
},
{
label: "로그아웃",
href: "/",
onClick: logout,
},
];
Expand Down Expand Up @@ -58,7 +59,7 @@ const HeaderMenu = () => {
즐겨찾기
</Link>
<div
className="flex items-center gap-[6px] text-[14px] leading-[16.71px] font-normal"
className="flex items-center gap-[6px] text-[14px] leading-[16.71px] font-normal cursor-pointer"
onClick={() => setIsOpen(!isOpen)}
>
<Image src={Profile} width={28} height={28} alt="프로필" />
Expand Down
Loading