Add support for onAuxClick on ChatBarButton (#3043)

This commit is contained in:
Etorix 2024-11-24 16:25:30 -08:00 committed by GitHub
parent 2bfeef88ca
commit 5fb63246ca
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -99,7 +99,8 @@ export interface ChatBarButtonProps {
tooltip: string; tooltip: string;
onClick: MouseEventHandler<HTMLButtonElement>; onClick: MouseEventHandler<HTMLButtonElement>;
onContextMenu?: MouseEventHandler<HTMLButtonElement>; onContextMenu?: MouseEventHandler<HTMLButtonElement>;
buttonProps?: Omit<HTMLProps<HTMLButtonElement>, "size" | "onClick" | "onContextMenu">; onAuxClick?: MouseEventHandler<HTMLButtonElement>;
buttonProps?: Omit<HTMLProps<HTMLButtonElement>, "size" | "onClick" | "onContextMenu" | "onAuxClick">;
} }
export const ChatBarButton = ErrorBoundary.wrap((props: ChatBarButtonProps) => { export const ChatBarButton = ErrorBoundary.wrap((props: ChatBarButtonProps) => {
return ( return (
@ -115,6 +116,7 @@ export const ChatBarButton = ErrorBoundary.wrap((props: ChatBarButtonProps) => {
innerClassName={`${ButtonWrapperClasses.button} ${ChannelTextAreaClasses?.button}`} innerClassName={`${ButtonWrapperClasses.button} ${ChannelTextAreaClasses?.button}`}
onClick={props.onClick} onClick={props.onClick}
onContextMenu={props.onContextMenu} onContextMenu={props.onContextMenu}
onAuxClick={props.onAuxClick}
{...props.buttonProps} {...props.buttonProps}
> >
<div className={ButtonWrapperClasses.buttonWrapper}> <div className={ButtonWrapperClasses.buttonWrapper}>