mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-08 08:53:51 +00:00
refactor: create destructive menu type
This commit is contained in:
committed by
Carlos Valente
parent
32bf0f53f6
commit
812b17a221
@@ -27,7 +27,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.item {
|
||||
outline: 0;
|
||||
cursor: default;
|
||||
@@ -61,6 +60,13 @@
|
||||
border-radius: 3px;
|
||||
background-color: $gray-1000;
|
||||
}
|
||||
|
||||
&[data-type='destructive'] {
|
||||
color: $red-500;
|
||||
svg {
|
||||
color: $red-500;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.separator {
|
||||
|
||||
@@ -6,7 +6,7 @@ import style from './DropdownMenu.module.scss';
|
||||
|
||||
type DropdownMenuItemDivider = { type: 'divider' };
|
||||
type DropdownMenuItem = {
|
||||
type: 'item';
|
||||
type: 'item' | 'destructive';
|
||||
label: string;
|
||||
icon?: IconType;
|
||||
disabled?: boolean;
|
||||
@@ -31,7 +31,7 @@ export function DropdownMenu({ items, children, ...triggerProps }: PropsWithChil
|
||||
return <BaseMenu.Separator key={index} className={style.separator} />;
|
||||
}
|
||||
return (
|
||||
<BaseMenu.Item key={index} className={style.item} onClick={item.onClick} disabled={item.disabled}>
|
||||
<BaseMenu.Item key={index} className={style.item} onClick={item.onClick} disabled={item.disabled} data-type={item.type}>
|
||||
{item.icon && <item.icon />}
|
||||
{item.label}
|
||||
</BaseMenu.Item>
|
||||
|
||||
Reference in New Issue
Block a user