diff --git a/webapp/channels/src/components/file_attachment/__snapshots__/file_attachment.test.tsx.snap b/webapp/channels/src/components/file_attachment/__snapshots__/file_attachment.test.tsx.snap index abe7d82192..39301daad6 100644 --- a/webapp/channels/src/components/file_attachment/__snapshots__/file_attachment.test.tsx.snap +++ b/webapp/channels/src/components/file_attachment/__snapshots__/file_attachment.test.tsx.snap @@ -10,7 +10,7 @@ exports[`FileAttachment should match snapshot, after change from file to image 1 href="#" onClick={[Function]} > - - - - { - render() { - const {fileInfo} = this.props; - const type = getFileType(fileInfo.extension); +const FileThumbnail = ({ + fileInfo, + enableSVGs, +}: Props) => { + const type = getFileType(fileInfo.extension); - let thumbnail; - if (type === FileTypes.IMAGE) { - let className = 'post-image'; + if (type === FileTypes.IMAGE) { + let className = 'post-image'; - if (fileInfo.width < Constants.THUMBNAIL_WIDTH && fileInfo.height < Constants.THUMBNAIL_HEIGHT) { - className += ' small'; - } else { - className += ' normal'; - } - - let thumbnailUrl = getFileThumbnailUrl(fileInfo.id); - if (isGIFImage(fileInfo.extension) && !fileInfo.has_preview_image) { - thumbnailUrl = getFileUrl(fileInfo.id); - } - - return ( -
- ); - } else if (fileInfo.extension === FileTypes.SVG && this.props.enableSVGs) { - thumbnail = ( - {'file - ); + if (fileInfo.width < Constants.THUMBNAIL_WIDTH && fileInfo.height < Constants.THUMBNAIL_HEIGHT) { + className += ' small'; } else { - thumbnail =
; + className += ' normal'; } - return thumbnail; + let thumbnailUrl = getFileThumbnailUrl(fileInfo.id); + if (isGIFImage(fileInfo.extension) && !fileInfo.has_preview_image) { + thumbnailUrl = getFileUrl(fileInfo.id); + } + + return ( +
+ ); + } else if (fileInfo.extension === FileTypes.SVG && enableSVGs) { + return ( + {'file + ); } -} + + return
; +}; + +export default memo(FileThumbnail); diff --git a/webapp/channels/src/components/file_search_results/__snapshots__/file_search_result_item.test.tsx.snap b/webapp/channels/src/components/file_search_results/__snapshots__/file_search_result_item.test.tsx.snap index 9691b688d4..de5ba91462 100644 --- a/webapp/channels/src/components/file_search_results/__snapshots__/file_search_result_item.test.tsx.snap +++ b/webapp/channels/src/components/file_search_results/__snapshots__/file_search_result_item.test.tsx.snap @@ -9,7 +9,7 @@ exports[`components/file_search_result/FileSearchResultItem should match snapsho className="FileSearchResultItem" onClick={[Function]} > - - - -