sms verification: polish UI, fix linting issues 👕

This commit is contained in:
Jannis R 2016-11-09 16:18:09 +01:00
parent e7113e7eb4
commit 7996ac47ec
No known key found for this signature in database
GPG Key ID: 0FE83946296A88A5
3 changed files with 9 additions and 8 deletions

View File

@ -15,12 +15,9 @@
// along with Parity. If not, see <http://www.gnu.org/licenses/>. // along with Parity. If not, see <http://www.gnu.org/licenses/>.
import React, { Component, PropTypes } from 'react'; import React, { Component, PropTypes } from 'react';
import { Checkbox } from 'material-ui';
import SuccessIcon from 'material-ui/svg-icons/navigation/check'; import SuccessIcon from 'material-ui/svg-icons/navigation/check';
import ErrorIcon from 'material-ui/svg-icons/alert/error-outline'; import ErrorIcon from 'material-ui/svg-icons/alert/error-outline';
import { Form, Input } from '../../../ui';
import styles from './checkIfCertified.css'; import styles from './checkIfCertified.css';
export default class CheckIfCertified extends Component { export default class CheckIfCertified extends Component {

View File

@ -30,8 +30,7 @@ import SendRequest from './SendRequest';
export default class SMSVerification extends Component { export default class SMSVerification extends Component {
static contextTypes = { static contextTypes = {
api: PropTypes.object.isRequired, api: PropTypes.object.isRequired
// store: PropTypes.object.isRequired
} }
static propTypes = { static propTypes = {
@ -63,7 +62,7 @@ export default class SMSVerification extends Component {
title='verify your account via SMS' title='verify your account via SMS'
visible scroll visible scroll
current={ step } current={ step }
steps={ ['first step', 'second step', 'third step'] } steps={ ['Preparations', 'Enter Data', 'Send Request'] }
> >
{ this.renderStep() } { this.renderStep() }
</Modal> </Modal>
@ -88,6 +87,7 @@ export default class SMSVerification extends Component {
{ cancel } { cancel }
<Button <Button
key='done' label='Done' key='done' label='Done'
disabled={ !stepIsValid }
icon={ <ActionDoneAll /> } icon={ <ActionDoneAll /> }
onClick={ onClose } onClick={ onClose }
/> />

View File

@ -103,6 +103,7 @@ export default class SendRequest extends Component {
return ( return (
<div className={ styles.centered }> <div className={ styles.centered }>
<TxHash hash={ this.props.data.txHash } maxConfirmations={ 3 } /> <TxHash hash={ this.props.data.txHash } maxConfirmations={ 3 } />
<p>Please keep this window open.</p>
</div>); </div>);
} }
@ -111,7 +112,7 @@ export default class SendRequest extends Component {
} }
if (step === 'sms-sent') { 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; return null;
@ -153,7 +154,10 @@ export default class SendRequest extends Component {
.catch((err) => { .catch((err) => {
console.error('failed to request sms verification', err); console.error('failed to request sms verification', err);
onError(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 // TODO: show message in SnackBar
}); });
} }