diff --git a/app/soapbox/features/chats/components/chat-upload.tsx b/app/soapbox/features/chats/components/chat-upload.tsx index 4b0272fc9..f3736b210 100644 --- a/app/soapbox/features/chats/components/chat-upload.tsx +++ b/app/soapbox/features/chats/components/chat-upload.tsx @@ -1,7 +1,11 @@ +import clsx from 'clsx'; +import { List as ImmutableList } from 'immutable'; import React from 'react'; +import { openModal } from 'soapbox/actions/modals'; import Blurhash from 'soapbox/components/blurhash'; import { Icon } from 'soapbox/components/ui'; +import { useAppDispatch } from 'soapbox/hooks'; import type { Attachment } from 'soapbox/types/entities'; @@ -12,20 +16,32 @@ interface IChatUpload { /** An attachment uploaded to the chat composer, before sending. */ const ChatUpload: React.FC = ({ attachment, onDelete }) => { + const dispatch = useAppDispatch(); + const clickable = attachment.type !== 'unknown'; + + const handleOpenModal = () => { + dispatch(openModal('MEDIA', { media: ImmutableList.of(attachment), index: 0 })); + }; + return ( -
+
- +
); };