blob: f9f5db7c6f94da266ddca9e76cd97d4853bc7c70 (
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
37
38
39
40
41
|
import { h, Component } from 'preact'
import { bindActionCreators } from 'redux'
import { connect } from 'react-redux'
import NewDatasetForm from '../../../dataset/dataset.new'
import * as pix2pixActions from '../pix2pix.actions'
import pix2pixModule from '../pix2pix.module'
class Pix2PixNew extends Component {
constructor(props){
super(props)
props.actions.load_directories()
}
render(){
const { pix2pix, history } = this.props
console.log(pix2pix)
let folders
if (pix2pix.data) {
pix2pix.data.folders.forEach(folder => {
console.log(folder)
})
}
return (
<div class='app pix2pix'>
<NewDatasetForm module={pix2pixModule} history={history} />
{folders}
</div>
)
}
}
const mapStateToProps = state => ({
pix2pix: state.module.pix2pix,
})
const mapDispatchToProps = (dispatch, ownProps) => ({
actions: bindActionCreators(pix2pixActions, dispatch),
})
export default connect(mapStateToProps, mapDispatchToProps)(Pix2PixNew)
|