Chats: use plus icon to upload attachment

This commit is contained in:
Alex Gleason 2023-01-20 11:29:40 -06:00
parent f222491b3e
commit af1ad92432
No known key found for this signature in database
GPG Key ID: 7211D1F99744FBB7
2 changed files with 8 additions and 3 deletions

View File

@ -162,6 +162,7 @@ const ChatComposer = React.forwardRef<HTMLTextAreaElement | null, IChatComposer>
resetFileKey={resetFileKey} resetFileKey={resetFileKey}
iconClassName='w-5 h-5' iconClassName='w-5 h-5'
className='text-primary-500' className='text-primary-500'
icon={require('@tabler/icons/plus.svg')}
/> />
</Stack> </Stack>
)} )}

View File

@ -22,6 +22,7 @@ export interface IUploadButton {
resetFileKey: number | null, resetFileKey: number | null,
className?: string, className?: string,
iconClassName?: string, iconClassName?: string,
icon?: string,
} }
const UploadButton: React.FC<IUploadButton> = ({ const UploadButton: React.FC<IUploadButton> = ({
@ -31,6 +32,7 @@ const UploadButton: React.FC<IUploadButton> = ({
resetFileKey, resetFileKey,
className = 'text-gray-600 hover:text-gray-700 dark:hover:text-gray-500', className = 'text-gray-600 hover:text-gray-700 dark:hover:text-gray-500',
iconClassName, iconClassName,
icon,
}) => { }) => {
const intl = useIntl(); const intl = useIntl();
const { configuration } = useInstance(); const { configuration } = useInstance();
@ -52,9 +54,11 @@ const UploadButton: React.FC<IUploadButton> = ({
return null; return null;
} }
const src = onlyImages(attachmentTypes) const src = icon || (
? require('@tabler/icons/photo.svg') onlyImages(attachmentTypes)
: require('@tabler/icons/paperclip.svg'); ? require('@tabler/icons/photo.svg')
: require('@tabler/icons/paperclip.svg')
);
return ( return (
<div> <div>