File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed
invokeai/frontend/web/src/features/gallery/components Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change 11import { IconButton } from '@invoke-ai/ui-library' ;
2+ import { useAppSelector } from 'app/store/storeHooks' ;
23import { useImageUploadButton } from 'common/hooks/useImageUploadButton' ;
4+ import { selectMaxImageUploadCount } from 'features/system/store/configSlice' ;
35import { t } from 'i18next' ;
46import { PiUploadBold } from 'react-icons/pi' ;
57
68const options = { postUploadAction : { type : 'TOAST' } , allowMultiple : true } as const ;
79
810export const GalleryUploadButton = ( ) => {
911 const uploadApi = useImageUploadButton ( options ) ;
12+ const maxImageUploadCount = useAppSelector ( selectMaxImageUploadCount ) ;
1013 return (
1114 < >
1215 < IconButton
1316 size = "sm"
1417 alignSelf = "stretch"
1518 variant = "link"
16- aria-label = { t ( 'accessibility.uploadImages' ) }
17- tooltip = { t ( 'accessibility.uploadImages' ) }
19+ aria-label = {
20+ maxImageUploadCount === undefined || maxImageUploadCount > 1
21+ ? t ( 'accessibility.uploadImages' )
22+ : t ( 'accessibility.uploadImage' )
23+ }
24+ tooltip = {
25+ maxImageUploadCount === undefined || maxImageUploadCount > 1
26+ ? t ( 'accessibility.uploadImages' )
27+ : t ( 'accessibility.uploadImage' )
28+ }
1829 icon = { < PiUploadBold /> }
1930 { ...uploadApi . getUploadButtonProps ( ) }
2031 />
You can’t perform that action at this time.
0 commit comments