/** * * AuthPage * */ import React from 'react'; import PropTypes from 'prop-types'; import { connect } from 'react-redux'; import { bindActionCreators, compose } from 'redux'; import { get, map } from 'lodash'; import cn from 'classnames'; // Design import Button from 'components/Button'; import Input from 'components/Input'; // Utils import injectSaga from 'utils/injectSaga'; import injectReducer from 'utils/injectReducer'; import { onChangeInput, setErrors, setForm, } from './actions'; import form from './form.json'; import reducer from './reducer'; import saga from './saga'; import makeSelectAuthPage from './selectors'; import styles from './styles.scss'; export class AuthPage extends React.Component { // eslint-disable-line react/prefer-stateless-function componentDidMount() { this.props.setForm(this.props.match.params.authType, this.props.match.params.id); } componentWillReceiveProps(nextProps) { if (this.props.match.params.authType !== nextProps.match.params.authType) { this.props.setForm(nextProps.match.params.authType, nextProps.match.params.authType); } } handleSubmit = (e) => { e.preventDefault(); // TODO formErrors this.props.setErrors(); console.log('ok'); } renderButton = () => { if (this.props.match.params.authType === 'login') { return (