sms verification: polish UI, fix linting issues 👕
This commit is contained in:
parent
e7113e7eb4
commit
7996ac47ec
@ -15,12 +15,9 @@
|
||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
import React, { Component, PropTypes } from 'react';
|
||||
import { Checkbox } from 'material-ui';
|
||||
import SuccessIcon from 'material-ui/svg-icons/navigation/check';
|
||||
import ErrorIcon from 'material-ui/svg-icons/alert/error-outline';
|
||||
|
||||
import { Form, Input } from '../../../ui';
|
||||
|
||||
import styles from './checkIfCertified.css';
|
||||
|
||||
export default class CheckIfCertified extends Component {
|
||||
|
@ -30,8 +30,7 @@ import SendRequest from './SendRequest';
|
||||
|
||||
export default class SMSVerification extends Component {
|
||||
static contextTypes = {
|
||||
api: PropTypes.object.isRequired,
|
||||
// store: PropTypes.object.isRequired
|
||||
api: PropTypes.object.isRequired
|
||||
}
|
||||
|
||||
static propTypes = {
|
||||
@ -63,7 +62,7 @@ export default class SMSVerification extends Component {
|
||||
title='verify your account via SMS'
|
||||
visible scroll
|
||||
current={ step }
|
||||
steps={ ['first step', 'second step', 'third step'] }
|
||||
steps={ ['Preparations', 'Enter Data', 'Send Request'] }
|
||||
>
|
||||
{ this.renderStep() }
|
||||
</Modal>
|
||||
@ -88,6 +87,7 @@ export default class SMSVerification extends Component {
|
||||
{ cancel }
|
||||
<Button
|
||||
key='done' label='Done'
|
||||
disabled={ !stepIsValid }
|
||||
icon={ <ActionDoneAll /> }
|
||||
onClick={ onClose }
|
||||
/>
|
||||
|
@ -103,6 +103,7 @@ export default class SendRequest extends Component {
|
||||
return (
|
||||
<div className={ styles.centered }>
|
||||
<TxHash hash={ this.props.data.txHash } maxConfirmations={ 3 } />
|
||||
<p>Please keep this window open.</p>
|
||||
</div>);
|
||||
}
|
||||
|
||||
@ -111,7 +112,7 @@ export default class SendRequest extends Component {
|
||||
}
|
||||
|
||||
if (step === 'sms-sent') {
|
||||
return (<p>The SMS has been sent to { this.props.data.number }</p>);
|
||||
return (<p>The verification code has been sent to { this.props.data.number }.</p>);
|
||||
}
|
||||
|
||||
return null;
|
||||
@ -153,7 +154,10 @@ export default class SendRequest extends Component {
|
||||
.catch((err) => {
|
||||
console.error('failed to request sms verification', err);
|
||||
onError(err);
|
||||
this.setState({ step: 'error', error: err.message });
|
||||
this.setState({
|
||||
step: 'error',
|
||||
error: 'Failed to request a confirmation SMS: ' + err.message
|
||||
});
|
||||
// TODO: show message in SnackBar
|
||||
});
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user