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

Commit 7e431ac

Browse files
committed
Add IconizedContextMenuOptionList label
Signed-off-by: Šimon Brandner <[email protected]>
1 parent bd305b0 commit 7e431ac

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

res/css/views/context_menus/_IconizedContextMenu.scss

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@ limitations under the License.
2525
padding-right: 20px;
2626
}
2727

28+
.mx_IconizedContextMenu_optionList_label {
29+
font-size: $font-15px;
30+
font-weight: $font-semi-bold;
31+
}
32+
2833
// the notFirst class is for cases where the optionList might be under a header of sorts.
2934
&:nth-child(n + 2), .mx_IconizedContextMenu_optionList_notFirst {
3035
// This is a bit of a hack when we could just use a simple border-top property,

src/components/views/context_menus/IconizedContextMenu.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ interface IProps extends IContextMenuProps {
3333
interface IOptionListProps {
3434
first?: boolean;
3535
red?: boolean;
36+
label?: string;
3637
className?: string;
3738
}
3839

@@ -101,13 +102,20 @@ export const IconizedContextMenuOption: React.FC<IOptionProps> = ({ label, iconC
101102
</MenuItem>;
102103
};
103104

104-
export const IconizedContextMenuOptionList: React.FC<IOptionListProps> = ({ first, red, className, children }) => {
105+
export const IconizedContextMenuOptionList: React.FC<IOptionListProps> = ({
106+
first,
107+
red,
108+
className,
109+
label,
110+
children,
111+
}) => {
105112
const classes = classNames("mx_IconizedContextMenu_optionList", className, {
106113
mx_IconizedContextMenu_optionList_notFirst: !first,
107114
mx_IconizedContextMenu_optionList_red: red,
108115
});
109116

110117
return <div className={classes}>
118+
{ label && <div><span className="mx_IconizedContextMenu_optionList_label">{ label }</span></div> }
111119
{ children }
112120
</div>;
113121
};

0 commit comments

Comments
 (0)