Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit 38cb29b

Browse files
author
Kerry Archibald
committed
add destructive option and close on interaction options
1 parent 73a396d commit 38cb29b

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

res/css/views/context_menus/_IconizedContextMenu.pcss

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,8 @@ limitations under the License.
8282
display: flex;
8383
align-items: center;
8484

85-
&:hover {
85+
&:hover,
86+
&:focus {
8687
background-color: $menu-selected-color;
8788
}
8889

@@ -187,3 +188,7 @@ limitations under the License.
187188
color: $tertiary-content;
188189
}
189190
}
191+
192+
.mx_IconizedContextMenu_item.mx_IconizedContextMenu_itemDestructive {
193+
color: $alert !important;
194+
}

src/components/views/context_menus/IconizedContextMenu.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ interface IOptionListProps {
3939

4040
interface IOptionProps extends React.ComponentProps<typeof MenuItem> {
4141
iconClassName?: string;
42+
isDestructive?: boolean;
4243
}
4344

4445
interface ICheckboxProps extends React.ComponentProps<typeof MenuItemCheckbox> {
@@ -112,12 +113,14 @@ export const IconizedContextMenuOption: React.FC<IOptionProps> = ({
112113
className,
113114
iconClassName,
114115
children,
116+
isDestructive,
115117
...props
116118
}) => {
117119
return <MenuItem
118120
{...props}
119121
className={classNames(className, {
120122
mx_IconizedContextMenu_item: true,
123+
mx_IconizedContextMenu_itemDestructive: isDestructive,
121124
})}
122125
label={label}
123126
>

0 commit comments

Comments
 (0)