2017-07-06 14:03:20 +02:00
|
|
|
/*
|
|
|
|
|
*
|
|
|
|
|
* Home
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
import React from 'react';
|
|
|
|
|
import { connect } from 'react-redux';
|
|
|
|
|
import Helmet from 'react-helmet';
|
2017-07-06 15:34:21 +02:00
|
|
|
import PluginLeftMenu from 'components/PluginLeftMenu';
|
2017-07-11 15:39:00 +02:00
|
|
|
import InputToggle from 'components/InputToggle';
|
2017-07-10 17:55:46 +02:00
|
|
|
import InputNumber from 'components/InputNumber';
|
2017-07-06 14:03:20 +02:00
|
|
|
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 = {
|
2017-07-11 15:39:00 +02:00
|
|
|
value: true,
|
|
|
|
|
value1: null,
|
2017-07-10 16:34:12 +02:00
|
|
|
}
|
|
|
|
|
}
|
2017-07-06 16:18:43 +02:00
|
|
|
|
2017-07-10 16:34:12 +02:00
|
|
|
handleChange = ({ target }) => {
|
2017-07-11 15:39:00 +02:00
|
|
|
|
|
|
|
|
this.setState({ value1: target.value });
|
2017-07-10 16:34:12 +02:00
|
|
|
}
|
2017-07-06 16:18:43 +02:00
|
|
|
|
2017-07-06 14:03:20 +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-11 15:39:00 +02:00
|
|
|
"maxLength": 12,
|
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,}))$/
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2017-07-06 14:03:20 +02:00
|
|
|
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' },
|
|
|
|
|
]}
|
|
|
|
|
/>
|
2017-07-06 15:34:21 +02:00
|
|
|
<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
|
|
|
|
2017-07-11 15:39:00 +02:00
|
|
|
|
|
|
|
|
<InputNumber
|
|
|
|
|
handleChange={this.handleChange}
|
|
|
|
|
value={this.state.value1}
|
|
|
|
|
name={test.name}
|
|
|
|
|
validations={test.validations}
|
|
|
|
|
customBootstrapClass={'col-lg-4 offset-lg-4'}
|
|
|
|
|
errors={false}
|
|
|
|
|
/>
|
2017-07-10 16:34:12 +02:00
|
|
|
</div>
|
2017-07-06 15:34:21 +02:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2017-07-06 14:03:20 +02:00
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const mapStateToProps = selectHome();
|
|
|
|
|
|
|
|
|
|
function mapDispatchToProps(dispatch) {
|
|
|
|
|
return {
|
|
|
|
|
dispatch,
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export default connect(mapStateToProps, mapDispatchToProps)(Home);
|