From 964ac7009e6db5a06233bdc07fa63778eebf2db7 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Fri, 1 Jun 2018 03:30:39 +0200 Subject: async commands!! --- app/client/common/fileList.component.js | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'app/client/common') diff --git a/app/client/common/fileList.component.js b/app/client/common/fileList.component.js index 7d90045..09e4268 100644 --- a/app/client/common/fileList.component.js +++ b/app/client/common/fileList.component.js @@ -12,9 +12,12 @@ class FileList extends Component { } render(){ const { files, linkFiles, onClick } = this.props + if (!files.length) return null let fields = this.props.fields || defaultFields const fileList = files.map(file => { const size = util.hush_size(file.size) + const date = file.created_at + const username = file.username || "" return (
@@ -23,11 +26,17 @@ class FileList extends Component { : onClick(file)}>{file.name || file.url} }
+ {fields.has('age') && +
{util.get_age(date)}
+ } + {fields.has('username') && +
{username}
+ } {fields.has('date') && -
{moment(file.created_at).format("YYYY-MM-DD")}
+
{moment(date).format("YYYY-MM-DD")}
} {fields.has('datetime') && -
{moment(file.created_at).format("YYYY-MM-DD h:mm a")}
+
{moment(date).format("YYYY-MM-DD h:mm a")}
} {fields.has('size') &&
{size[1]}
-- cgit v1.2.3-70-g09d2