summaryrefslogtreecommitdiffstats
path: root/web/react/components/file_attachment.jsx
diff options
context:
space:
mode:
authorChristopher Speller <crspeller@gmail.com>2015-09-10 08:23:31 -0400
committerChristopher Speller <crspeller@gmail.com>2015-09-10 08:23:31 -0400
commit74155b3dfaaa65e6468f912c2ce5f62b81f4b8e6 (patch)
tree21c96ea7f07d1868e6a388ae99d8066b8f29dc67 /web/react/components/file_attachment.jsx
parentd0c8b3d656618f6efeea11d680c532381fcb81f0 (diff)
parent1f5e43b38817b8c6a3b121d6bd4447411e135f5d (diff)
downloadchat-74155b3dfaaa65e6468f912c2ce5f62b81f4b8e6.tar.gz
chat-74155b3dfaaa65e6468f912c2ce5f62b81f4b8e6.tar.bz2
chat-74155b3dfaaa65e6468f912c2ce5f62b81f4b8e6.zip
Merge pull request #631 from asaadmahmoodspin/mm-1866
MM-1866 - Adding download icon and adding download links
Diffstat (limited to 'web/react/components/file_attachment.jsx')
-rw-r--r--web/react/components/file_attachment.jsx16
1 files changed, 14 insertions, 2 deletions
diff --git a/web/react/components/file_attachment.jsx b/web/react/components/file_attachment.jsx
index 78693df98..c9aa06a97 100644
--- a/web/react/components/file_attachment.jsx
+++ b/web/react/components/file_attachment.jsx
@@ -97,6 +97,7 @@ export default class FileAttachment extends React.Component {
var filename = this.props.filename;
var fileInfo = utils.splitFileLocation(filename);
+ var fileUrl = utils.getFileUrl(filename);
var type = utils.getFileType(fileInfo.ext);
var thumbnail;
@@ -150,14 +151,25 @@ export default class FileAttachment extends React.Component {
{thumbnail}
</a>
<div className='post-image__details'>
- <div
+ <a
+ href={fileUrl}
+ download={filenameString}
data-toggle='tooltip'
title={filenameString}
className='post-image__name'
>
{trimmedFilename}
- </div>
+ </a>
<div>
+ <a
+ href={fileUrl}
+ download={filenameString}
+ className='post-image__download'
+ >
+ <span
+ className='fa fa-download'
+ />
+ </a>
<span className='post-image__type'>{fileInfo.ext.toUpperCase()}</span>
<span className='post-image__size'>{fileSizeString}</span>
</div>