Replace compose context menu with IconizedContextMenu (#22046)
Signed-off-by: Michael Weimann <michaelw@matrix.org>
This commit is contained in:
parent
c86040b77a
commit
7e63202f9a
4 changed files with 29 additions and 46 deletions
|
@ -20,27 +20,27 @@ import classNames from 'classnames';
|
|||
import AccessibleTooltipButton from "../elements/AccessibleTooltipButton";
|
||||
import { MenuItem } from "../../structures/ContextMenu";
|
||||
import { OverflowMenuContext } from './MessageComposerButtons';
|
||||
import { IconizedContextMenuOption } from '../context_menus/IconizedContextMenu';
|
||||
|
||||
interface ICollapsibleButtonProps extends ComponentProps<typeof MenuItem> {
|
||||
title: string;
|
||||
iconClassName: string;
|
||||
}
|
||||
|
||||
export const CollapsibleButton = ({ title, children, className, ...props }: ICollapsibleButtonProps) => {
|
||||
export const CollapsibleButton = ({ title, children, className, iconClassName, ...props }: ICollapsibleButtonProps) => {
|
||||
const inOverflowMenu = !!useContext(OverflowMenuContext);
|
||||
if (inOverflowMenu) {
|
||||
return <MenuItem
|
||||
return <IconizedContextMenuOption
|
||||
{...props}
|
||||
className={classNames("mx_CallContextMenu_item", className)}
|
||||
>
|
||||
{ title }
|
||||
{ children }
|
||||
</MenuItem>;
|
||||
iconClassName={iconClassName}
|
||||
label={title}
|
||||
/>;
|
||||
}
|
||||
|
||||
return <AccessibleTooltipButton
|
||||
{...props}
|
||||
title={title}
|
||||
className={className}
|
||||
className={classNames(className, iconClassName)}
|
||||
>
|
||||
{ children }
|
||||
</AccessibleTooltipButton>;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue