summaryrefslogtreecommitdiff
path: root/app/client/common/views/new.view.js
blob: 3b2ffa8c2f10dd4118afaa21a51000eeb6addf2f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import { h, Component } from 'preact'
import { bindActionCreators } from 'redux'
import { connect } from 'react-redux'
import { Link } from 'react-router-dom'
import util from '../../util'

import Group from '../group.component'
import Param from '../param.component'
import Loading from '../loading.component'
import FolderList from '../folderList.component'

import NewDatasetForm from '../../dataset/dataset.new'

export default class NewView extends Component {
  constructor(props){
    super(props)
    console.log(props)
    if (! props.db.data) {
      props.actions.load_directories()
    }
  }
  render(){
    const { module, history, db, path } = this.props
    return (
      <div class={'app new-view ' + module.name}>
        <div class='heading'>
          <h1>{module.displayName || module.name}</h1>
        </div>
        <div class='col narrow'>
          <NewDatasetForm module={module} history={history} />
          <FolderList db={db} path={path} emptyText={<i>No projects yet. Please create one~</i>} />
        </div>
      </div>
    )
  }
}