101 lines
2.6 KiB
JavaScript
Raw Normal View History

/*
*
* Home
*
*/
import React from 'react';
import { connect } from 'react-redux';
import Helmet from 'react-helmet';
import PluginLeftMenu from 'components/PluginLeftMenu';
2017-07-10 17:55:46 +02:00
import InputNumber from 'components/InputNumber';
import selectHome from './selectors';
import styles from './styles.scss';
export class Home extends React.Component { // eslint-disable-line react/prefer-stateless-function
2017-07-10 16:34:12 +02:00
constructor(props) {
super(props);
this.state = {
value: '',
}
}
2017-07-06 16:18:43 +02:00
2017-07-10 16:34:12 +02:00
handleChange = ({ target }) => {
console.log(target.value);
this.setState({ value: target.value });
}
2017-07-06 16:18:43 +02:00
render() {
2017-07-10 16:34:12 +02:00
const test = {
"name": "bame",
"slug": "name",
"target": "general.name",
"type": "text",
"value": "ExperienceApp",
"validations" : {
2017-07-10 17:55:46 +02:00
"maxLength": 255,
2017-07-10 16:34:12 +02:00
"required": true,
"regex": /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/
}
};
return (
<div className={styles.home}>
2017-07-06 16:18:43 +02:00
<div className={styles.baseline}></div>
<Helmet
title="Home"
meta={[
{ name: 'description', content: 'Description of Home' },
]}
/>
<div className="container-fluid">
<div className="row">
2017-07-06 16:18:43 +02:00
<PluginLeftMenu />
<div className="col-md-9">
2017-07-10 16:34:12 +02:00
<div className="form-group">
2017-07-10 17:55:46 +02:00
<InputNumber
2017-07-10 16:34:12 +02:00
validations={test.validations}
name={test.name}
value={this.state.value}
handleChange={this.handleChange}
2017-07-10 17:55:46 +02:00
inputDescription="Change..."
handleBlur={this.handleBlur}
errors={[]}
2017-07-10 16:34:12 +02:00
/>
2017-07-10 17:55:46 +02:00
<InputNumber
2017-07-10 16:34:12 +02:00
validations={test.validations}
name={test.name}
value={this.state.value}
handleChange={this.handleChange}
overrideBootstrapCol="4"
errors={false}
/>
2017-07-10 17:55:46 +02:00
<InputNumber
2017-07-10 16:34:12 +02:00
validations={test.validations}
name={test.name}
value={this.state.value}
handleChange={this.handleChange}
overrideBootstrapCol="2"
/>
</div>
</div>
</div>
</div>
</div>
);
}
}
const mapStateToProps = selectHome();
function mapDispatchToProps(dispatch) {
return {
dispatch,
};
}
export default connect(mapStateToProps, mapDispatchToProps)(Home);