From 3fbc033e37476ff03fc4ad93145976faeea47934 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Sun, 3 Jun 2018 16:34:09 +0200 Subject: reload the whole page. easier --- app/client/dataset/dataset.new.js | 43 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 app/client/dataset/dataset.new.js (limited to 'app/client/dataset/dataset.new.js') diff --git a/app/client/dataset/dataset.new.js b/app/client/dataset/dataset.new.js new file mode 100644 index 0000000..16ee8c1 --- /dev/null +++ b/app/client/dataset/dataset.new.js @@ -0,0 +1,43 @@ +import { h, Component } from 'preact' +import { bindActionCreators } from 'redux' +import { connect } from 'react-redux' + +import * as datasetActions from './dataset.actions' + +import TextInput from '../common/textInput.component' + +function NewDatasetForm (props) { + const { loading, status, error, history, actions, module } = props + if (loading) return Loading... + console.log(props) + return ( +
+
+

Create a new dataset

+
+
+ { + actions.createFolder(module, name) + .then(folder => { + window.location.href = '/samplernn/datasets/' + folder.id + '/' + }) + }} + /> +
+
+ ) +} + +const mapStateToProps = state => { + console.log(state); + return state.dataset +} + +const mapDispatchToProps = (dispatch, ownProps) => ({ + actions: bindActionCreators(datasetActions, dispatch), +}) + +export default connect(mapStateToProps, mapDispatchToProps)(NewDatasetForm) -- cgit v1.2.3-70-g09d2