Simplify Composer buttons (#7678)

* Render a CollapsibleButton's children (needed by UploadButton)

* Make UploadButton ready to live inside an overflow menu

* Always show overflow menu in composer: main buttons are emoji and attach

* Re-order composer buttons as per design

* Re-word composer button captions to be simple nouns

* Don't rotate More options button when clicked

* Move the composer menu and dialogs 16px in from right

* Reduce shadow on composer More menu

* From review: remove else clause

* From review: take input out of button

* Update test snapshots

* Update snapshots
This commit is contained in:
Andy Balaam 2022-02-02 09:30:53 +00:00 committed by GitHub
parent c011fb7475
commit f5226f9d5b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 110 additions and 98 deletions

View file

@ -25,7 +25,7 @@ interface ICollapsibleButtonProps extends ComponentProps<typeof MenuItem> {
title: string;
}
export const CollapsibleButton = ({ title, className, ...props }: ICollapsibleButtonProps) => {
export const CollapsibleButton = ({ title, children, className, ...props }: ICollapsibleButtonProps) => {
const inOverflowMenu = !!useContext(OverflowMenuContext);
if (inOverflowMenu) {
return <MenuItem
@ -33,10 +33,17 @@ export const CollapsibleButton = ({ title, className, ...props }: ICollapsibleBu
className={classNames("mx_CallContextMenu_item", className)}
>
{ title }
{ children }
</MenuItem>;
}
return <AccessibleTooltipButton {...props} title={title} className={className} />;
return <AccessibleTooltipButton
{...props}
title={title}
className={className}
>
{ children }
</AccessibleTooltipButton>;
};
export default CollapsibleButton;