diff --git a/web/chat/chat-input-bar.react.js b/web/chat/chat-input-bar.react.js --- a/web/chat/chat-input-bar.react.js +++ b/web/chat/chat-input-bar.react.js @@ -227,6 +227,7 @@ const multimediaPreviews = pendingUploads.map(pendingUpload => ( .multimediaImage > img { +span.multimedia > .multimediaImage > img, +span.multimedia > .multimediaImage > video { max-height: 200px; max-width: 100%; } @@ -81,7 +82,8 @@ display: flex; justify-content: center; } -div.multimediaModalOverlay > img { +div.multimediaModalOverlay > img, +div.multimediaModalOverlay > video { object-fit: scale-down; width: auto; height: auto; diff --git a/web/media/multimedia.react.js b/web/media/multimedia.react.js --- a/web/media/multimedia.react.js +++ b/web/media/multimedia.react.js @@ -11,6 +11,7 @@ } from 'react-feather'; import { useModalContext } from 'lib/components/modal-provider.react'; +import type { MediaType } from 'lib/types/media-types'; import Button from '../components/button.react'; import { type PendingMultimediaUpload } from '../input/input-state'; @@ -19,6 +20,7 @@ type BaseProps = { +uri: string, + +type: MediaType, +pendingUpload?: ?PendingMultimediaUpload, +remove?: (uploadID: string) => void, +multimediaCSSClass: string, @@ -46,7 +48,14 @@ render(): React.Node { let progressIndicator, errorIndicator, removeButton; - const { pendingUpload, remove } = this.props; + const { + pendingUpload, + remove, + type, + uri, + multimediaImageCSSClass, + multimediaCSSClass, + } = this.props; if (pendingUpload) { const { progressPercent, failed } = pendingUpload; @@ -81,20 +90,35 @@ const imageContainerClasses = [ css.multimediaImage, - this.props.multimediaImageCSSClass, + multimediaImageCSSClass, ]; imageContainerClasses.push(css.clickable); - const containerClasses = [css.multimedia, this.props.multimediaCSSClass]; - return ( - + let mediaNode; + if (type === 'photo') { + mediaNode = ( + ); + } else { + mediaNode = ( +
+ +
+ ); + } + + const containerClasses = [css.multimedia, multimediaCSSClass]; + return ( + + {mediaNode} {progressIndicator} {errorIndicator}