Merge branch 'master' into flags-locales

This commit is contained in:
Kim Gardner
2017-10-10 13:08:19 +01:00
committed by GitHub
7 changed files with 61 additions and 17 deletions
@@ -1,14 +1,23 @@
import React from 'react';
import PropTypes from 'prop-types';
import styles from './styles.css';
import {Button} from 'plugin-api/beta/client/components/ui';
import {Button, TextField} from 'plugin-api/beta/client/components/ui';
import t from 'coral-framework/services/i18n';
class ForgotContent extends React.Component {
state = {value: ''};
handleSubmit = (e) => {
e.preventDefault();
this.props.fetchForgotPassword(this.emailInput.value);
this.props.fetchForgotPassword(this.state.value);
};
handleChangeEmail = (e) => {
const {value} = e.target;
this.setState({value});
}
render() {
const {changeView, auth} = this.props;
const {passwordRequestSuccess, passwordRequestFailure} = auth;
@@ -20,13 +29,14 @@ class ForgotContent extends React.Component {
</div>
<form onSubmit={this.handleSubmit}>
<div className={styles.textField}>
<label htmlFor="email">{t('sign_in.email')}</label>
<input
ref={(input) => (this.emailInput = input)}
type="text"
<TextField
type="email"
style={{fontSize: 16}}
id="email"
name="email"
label={t('sign_in.email')}
onChange={this.handleChangeEmail}
value={this.state.value}
/>
</div>
<Button
@@ -69,4 +79,10 @@ class ForgotContent extends React.Component {
}
}
ForgotContent.propTypes = {
auth: PropTypes.object,
changeView: PropTypes.func,
fetchForgotPassword: PropTypes.func,
};
export default ForgotContent;