@@ -49,34 +49,43 @@ import {
4949 CommandsSubmenuHeader ,
5050} from './CommandsMenu' ;
5151
52- const AttachmentSelectorMenuInitButtonIcon = ( ) => {
52+ const AttachmentSelectorMenuInitButtonIcon = ( { className } : { className ?: string } ) => {
5353 const { AttachmentSelectorInitiationButtonContents } = useComponentContext ( ) ;
5454
5555 if ( AttachmentSelectorInitiationButtonContents ) {
56- return < AttachmentSelectorInitiationButtonContents /> ;
56+ return (
57+ < span className = { className } >
58+ < AttachmentSelectorInitiationButtonContents />
59+ </ span >
60+ ) ;
5761 }
5862
59- return < IconPlusLarge className = 'str-chat__attachment-selector__menu-button__icon' /> ;
63+ return (
64+ < IconPlusLarge
65+ className = { clsx ( 'str-chat__attachment-selector__menu-button__icon' , className ) }
66+ />
67+ ) ;
6068} ;
6169
62- export const AttachmentSelectorButton = forwardRef < HTMLButtonElement , ButtonProps > (
63- function AttachmentSelectorButton ( { className, ...props } , ref ) {
64- return (
65- < Button
66- appearance = 'outline'
67- circular
68- className = { clsx ( 'str-chat__attachment-selector__menu-button' , className ) }
69- data-testid = 'invoke-attachment-selector-button'
70- size = 'lg'
71- variant = 'secondary'
72- { ...props }
73- ref = { ref }
74- >
75- < AttachmentSelectorMenuInitButtonIcon />
76- </ Button >
77- ) ;
78- } ,
79- ) ;
70+ export const AttachmentSelectorButton = forwardRef <
71+ HTMLButtonElement ,
72+ ButtonProps & { iconClassName ?: string }
73+ > ( function AttachmentSelectorButton ( { className, iconClassName, ...props } , ref ) {
74+ return (
75+ < Button
76+ appearance = 'outline'
77+ circular
78+ className = { clsx ( 'str-chat__attachment-selector__menu-button' , className ) }
79+ data-testid = 'invoke-attachment-selector-button'
80+ size = 'lg'
81+ variant = 'secondary'
82+ { ...props }
83+ ref = { ref }
84+ >
85+ < AttachmentSelectorMenuInitButtonIcon className = { iconClassName } />
86+ </ Button >
87+ ) ;
88+ } ) ;
8089
8190export const SimpleAttachmentSelector = ( ) => {
8291 const { channelCapabilities } = useChannelStateContext ( ) ;
@@ -360,10 +369,10 @@ export const AttachmentSelector = ({
360369 aria-expanded = { menuDialogIsOpen }
361370 aria-haspopup = 'true'
362371 aria-label = { t ( 'aria/Open Attachment Selector' ) }
363- className = { clsx ( 'str-chat__prepare-rotate45' , {
372+ disabled = { isCooldownActive }
373+ iconClassName = { clsx ( 'str-chat__prepare-rotate45' , {
364374 'str-chat__rotate45' : menuDialogIsOpen ,
365375 } ) }
366- disabled = { isCooldownActive }
367376 onClick = { ( ) => menuDialog ?. toggle ( ) }
368377 ref = { menuButtonRef }
369378 />
0 commit comments