put SMS verification into action bar

This commit is contained in:
Jannis R 2016-11-03 17:47:27 +01:00
parent 599f214ad9
commit 7cb724bfbe
No known key found for this signature in database
GPG Key ID: 0FE83946296A88A5
2 changed files with 32 additions and 1 deletions

View File

@ -22,6 +22,7 @@ import EditMeta from './EditMeta';
import ExecuteContract from './ExecuteContract'; import ExecuteContract from './ExecuteContract';
import FirstRun from './FirstRun'; import FirstRun from './FirstRun';
import Shapeshift from './Shapeshift'; import Shapeshift from './Shapeshift';
import SMSVerification from './SMSVerification';
import Transfer from './Transfer'; import Transfer from './Transfer';
import PasswordManager from './PasswordManager'; import PasswordManager from './PasswordManager';
@ -34,6 +35,7 @@ export {
ExecuteContract, ExecuteContract,
FirstRun, FirstRun,
Shapeshift, Shapeshift,
SMSVerification,
Transfer, Transfer,
PasswordManager PasswordManager
}; };

View File

@ -20,8 +20,9 @@ import { bindActionCreators } from 'redux';
import ContentCreate from 'material-ui/svg-icons/content/create'; import ContentCreate from 'material-ui/svg-icons/content/create';
import ContentSend from 'material-ui/svg-icons/content/send'; import ContentSend from 'material-ui/svg-icons/content/send';
import LockIcon from 'material-ui/svg-icons/action/lock'; import LockIcon from 'material-ui/svg-icons/action/lock';
import VerifyIcon from 'material-ui/svg-icons/action/verified-user';
import { EditMeta, Shapeshift, Transfer, PasswordManager } from '../../modals'; import { EditMeta, Shapeshift, SMSVerification, Transfer, PasswordManager } from '../../modals';
import { Actionbar, Button, Page } from '../../ui'; import { Actionbar, Button, Page } from '../../ui';
import shapeshiftBtn from '../../../assets/images/shapeshift-btn.png'; import shapeshiftBtn from '../../../assets/images/shapeshift-btn.png';
@ -45,6 +46,7 @@ class Account extends Component {
state = { state = {
showEditDialog: false, showEditDialog: false,
showFundDialog: false, showFundDialog: false,
showVerificationDialog: false,
showTransferDialog: false, showTransferDialog: false,
showPasswordDialog: false showPasswordDialog: false
} }
@ -64,6 +66,7 @@ class Account extends Component {
<div className={ styles.account }> <div className={ styles.account }>
{ this.renderEditDialog(account) } { this.renderEditDialog(account) }
{ this.renderFundDialog() } { this.renderFundDialog() }
{ this.renderVerificationDialog() }
{ this.renderTransferDialog() } { this.renderTransferDialog() }
{ this.renderPasswordDialog() } { this.renderPasswordDialog() }
{ this.renderActionbar() } { this.renderActionbar() }
@ -99,6 +102,11 @@ class Account extends Component {
icon={ <img src={ shapeshiftBtn } className={ styles.btnicon } /> } icon={ <img src={ shapeshiftBtn } className={ styles.btnicon } /> }
label='shapeshift' label='shapeshift'
onClick={ this.onShapeshiftAccountClick } />, onClick={ this.onShapeshiftAccountClick } />,
<Button
key='sms-verification'
icon={ <VerifyIcon /> }
label='Verify via SMS'
onClick={ this.openVerification } />,
<Button <Button
key='editmeta' key='editmeta'
icon={ <ContentCreate /> } icon={ <ContentCreate /> }
@ -149,6 +157,19 @@ class Account extends Component {
); );
} }
renderVerificationDialog () {
if (!this.state.showVerificationDialog) {
return null;
}
const { address } = this.props.params;
// TODO: pass props
return (
<SMSVerification onClose={ this.onVerificationClose } />
);
}
renderTransferDialog () { renderTransferDialog () {
const { showTransferDialog } = this.state; const { showTransferDialog } = this.state;
@ -205,6 +226,14 @@ class Account extends Component {
this.onShapeshiftAccountClick(); this.onShapeshiftAccountClick();
} }
openVerification = () => {
this.setState({ showVerificationDialog: true });
}
onVerificationClose = () => {
this.setState({ showVerificationDialog: false });
}
onTransferClick = () => { onTransferClick = () => {
this.setState({ this.setState({
showTransferDialog: !this.state.showTransferDialog showTransferDialog: !this.state.showTransferDialog