From da6d38cd2865d5e9de32f2b922754979af366317 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Sun, 26 Jan 2020 00:19:29 +0100 Subject: adding thumbnails to datasets --- app/client/common/fileList.component.js | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'app/client/common/fileList.component.js') diff --git a/app/client/common/fileList.component.js b/app/client/common/fileList.component.js index c4da4d7..1d4a3ca 100644 --- a/app/client/common/fileList.component.js +++ b/app/client/common/fileList.component.js @@ -29,10 +29,23 @@ export const FileList = props => { const groupedFiles = sortedFiles.reduce((a,b) => { a[b[1].dir].push(b); return a }, { true: [], false: [] }) sortedFiles = groupedFiles.true.concat(groupedFiles.false) } + const fileFields = fieldSet(fields) + let thumbnails = null + if (fileFields.has('thumbnail')) { + thumbnails = ( +
+ {sortedFiles.map(pair => ( +
+ +
+ ))} +
+ ) + } const fileList = sortedFiles.map(pair => { return { } + {thumbnails} {fileList} @@ -148,6 +162,9 @@ export const FileRow = props => { {fields.has('delete') && onDelete && file.id &&
onDelete(file)}>x
} + {fields.has('deleteLink') && onDelete && file.id && +
onDelete(file)}>Delete
+ } {options && props.options(file)} ) -- cgit v1.2.3-70-g09d2