2018-02-08 12:01:06 +01:00
|
|
|
/*
|
|
|
|
*
|
|
|
|
* HomePage
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
import React from 'react';
|
|
|
|
import PropTypes from 'prop-types';
|
|
|
|
import { connect } from 'react-redux';
|
|
|
|
import { createStructuredSelector } from 'reselect';
|
|
|
|
import { injectIntl } from 'react-intl';
|
|
|
|
import { bindActionCreators, compose } from 'redux';
|
|
|
|
|
2018-02-13 18:56:53 +01:00
|
|
|
import Input from 'components/InputsIndex';
|
2018-02-08 12:01:06 +01:00
|
|
|
import injectReducer from 'utils/injectReducer';
|
|
|
|
import injectSaga from 'utils/injectSaga';
|
|
|
|
|
|
|
|
// Selectors
|
|
|
|
import selectHomePage from './selectors';
|
|
|
|
|
|
|
|
// Styles
|
|
|
|
import styles from './styles.scss';
|
|
|
|
|
|
|
|
import reducer from './reducer';
|
|
|
|
import saga from './saga';
|
|
|
|
|
|
|
|
export class HomePage extends React.Component {
|
2018-02-12 18:46:45 +01:00
|
|
|
state = { value: [{ url: 'https://sofiaglobe.com/wp-content/uploads/2017/08/Toto-1979.jpg', name: 'https://sofiaglobe.com/wp-content/uploads/2017/08/Toto-1979.jpg' }] };
|
2018-02-12 11:23:02 +01:00
|
|
|
|
|
|
|
onChange = ({ target }) => {
|
|
|
|
this.setState({ value: target.value });
|
|
|
|
}
|
|
|
|
|
2018-02-08 12:01:06 +01:00
|
|
|
render() {
|
|
|
|
return (
|
2018-02-13 19:49:10 +01:00
|
|
|
<div className={styles.homePage} style={{ paddingTop: '87px', marginLeft: '100px'}}>
|
2018-02-12 15:12:58 +01:00
|
|
|
<form>
|
2018-02-13 19:49:10 +01:00
|
|
|
<div className="container-fluid">
|
|
|
|
<div className="row">
|
|
|
|
<Input
|
|
|
|
name="test"
|
|
|
|
label="Avatar"
|
|
|
|
value={this.state.value}
|
|
|
|
onChange={this.onChange}
|
|
|
|
type="file"
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
</div>
|
2018-02-12 15:12:58 +01:00
|
|
|
</form>
|
2018-02-08 12:01:06 +01:00
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
HomePage.contextTypes = {
|
|
|
|
router: PropTypes.object,
|
|
|
|
};
|
|
|
|
|
|
|
|
HomePage.propTypes = {
|
|
|
|
// homePage: PropTypes.object,
|
|
|
|
};
|
|
|
|
|
|
|
|
function mapDispatchToProps(dispatch) {
|
|
|
|
return bindActionCreators(
|
|
|
|
{
|
|
|
|
// Your actions here
|
|
|
|
},
|
|
|
|
dispatch,
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
const mapStateToProps = createStructuredSelector({
|
|
|
|
homePage: selectHomePage(),
|
|
|
|
});
|
|
|
|
|
|
|
|
const withConnect = connect(mapStateToProps, mapDispatchToProps);
|
|
|
|
|
|
|
|
const withReducer = injectReducer({ key: 'homePage', reducer });
|
|
|
|
const withSaga = injectSaga({ key: 'homePage', saga });
|
|
|
|
|
|
|
|
export default compose(
|
|
|
|
withReducer,
|
|
|
|
withSaga,
|
|
|
|
withConnect,
|
|
|
|
)(injectIntl(HomePage));
|