mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
Enhance delete button in context menu (#2591)
This commit is contained in:
parent
bfeb3c7dfd
commit
f919907855
3 changed files with 21 additions and 3 deletions
|
@ -26,7 +26,6 @@ const ContextMenu = ({ options, onCloseRequest, top, left }: Props) => {
|
|||
const isDarkTheme = !!document
|
||||
.querySelector(".excalidraw")
|
||||
?.classList.contains("Appearance_dark");
|
||||
|
||||
return (
|
||||
<div
|
||||
className={clsx("excalidraw", {
|
||||
|
@ -45,7 +44,12 @@ const ContextMenu = ({ options, onCloseRequest, top, left }: Props) => {
|
|||
>
|
||||
{options.map(({ action, shortcutName, label }, idx) => (
|
||||
<li data-testid={shortcutName} key={idx} onClick={onCloseRequest}>
|
||||
<button className="context-menu-option" onClick={action}>
|
||||
<button
|
||||
className={`context-menu-option ${
|
||||
shortcutName === "delete" ? "dangerous" : ""
|
||||
}`}
|
||||
onClick={action}
|
||||
>
|
||||
<div>{label}</div>
|
||||
<div>
|
||||
{shortcutName
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue