diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2018-06-26 14:53:38 +0200 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2018-06-26 14:53:38 +0200 |
| commit | b9e1806c97dba043af5b20c78ba2be9bbf47b4d8 (patch) | |
| tree | 0a3f342c41ef07a09ca26909bf376ff63943e8de /app/client/dashboard/dashboard.component.js | |
| parent | 79fa74e5fe24e4f22487213c917fab0a38c7ba2a (diff) | |
list morphs
Diffstat (limited to 'app/client/dashboard/dashboard.component.js')
| -rw-r--r-- | app/client/dashboard/dashboard.component.js | 33 |
1 files changed, 20 insertions, 13 deletions
diff --git a/app/client/dashboard/dashboard.component.js b/app/client/dashboard/dashboard.component.js index 58795ee..ac060de 100644 --- a/app/client/dashboard/dashboard.component.js +++ b/app/client/dashboard/dashboard.component.js @@ -33,15 +33,18 @@ class Dashboard extends Component { const { site, foldersByModule, renders, queue, images } = this.props const { tasks } = queue const folders = foldersByModule && Object.keys(modules).sort().map(key => { - if (! foldersByModule[key]) return null - const path = key === 'samplernn' ? '/samplernn/datasets/' : '/' + key + '/sequences/' - const folders = foldersByModule[key].map(folder => { - return ( - <div key={folder.id}> - <Link to={path + folder.id + '/'}>{folder.name}</Link> - </div> - ) - }) + let path, folder_list + if (foldersByModule[key]) { + path = key === 'samplernn' ? '/samplernn/datasets/' : '/' + key + '/sequences/' + folder_list = foldersByModule[key].map(folder => { + return ( + <div key={folder.id}> + <Link to={path + folder.id + '/'}>{folder.name}</Link> + </div> + ) + }) + } + let files = renders[key] && ( <FileList linkFiles @@ -61,10 +64,14 @@ class Dashboard extends Component { <div className='dashboardModule' key={key}> <div className='row moduleHeading'> <h3>{key}</h3> - <div> - <Link to={'/' + key + '/new/'}>new</Link> - </div> - {folders} + {folder_list && + <span> + <div> + <Link to={'/' + key + '/new/'}>new</Link> + </div> + {folders} + </span> + } </div> {files} </div> |
