-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'dev' of https://github.com/boostcampwm-2024/web33-Nocta …
…into Feature/#183_게스트,_유저별_workspace를_생성하고_불러오기
- Loading branch information
Showing
33 changed files
with
2,055 additions
and
164 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,28 @@ | ||
import { pageItemContainer, iconBox, textBox } from "./PageItem.style"; | ||
import CloseIcon from "@assets/icons/close.svg?react"; | ||
import { pageItemContainer, iconBox, textBox, deleteBox } from "./PageItem.style"; | ||
|
||
interface PageItemProps { | ||
id: string; | ||
title: string; | ||
icon?: string; | ||
onClick: () => void; | ||
onDelete?: (id: string) => void; // 추가: 삭제 핸들러 | ||
} | ||
|
||
export const PageItem = ({ icon, title, onClick }: PageItemProps) => { | ||
export const PageItem = ({ id, icon, title, onClick, onDelete }: PageItemProps) => { | ||
// 삭제 버튼 클릭 핸들러 | ||
const handleDelete = (e: React.MouseEvent) => { | ||
e.stopPropagation(); // 상위 요소로의 이벤트 전파 중단 | ||
onDelete?.(id); | ||
}; | ||
|
||
return ( | ||
<div className={pageItemContainer} onClick={onClick}> | ||
<span className={iconBox}>{icon}</span> | ||
<span className={textBox}>{title}</span> | ||
<span className={`delete_box ${deleteBox}`} onClick={handleDelete}> | ||
<CloseIcon width={16} height={16} /> | ||
</span> | ||
</div> | ||
); | ||
}; |
Oops, something went wrong.