update : otp interface
This commit is contained in:
parent
8b2f3ac089
commit
1156034b0e
|
@ -60,7 +60,10 @@ class OtpPage extends React.Component{
|
||||||
};
|
};
|
||||||
|
|
||||||
resendCode = () => {
|
resendCode = () => {
|
||||||
|
this.setState({isResending:true});
|
||||||
|
setTimeout(()=>{
|
||||||
|
this.setState({isResending:false});
|
||||||
|
},3000);
|
||||||
}
|
}
|
||||||
|
|
||||||
login = () => {
|
login = () => {
|
||||||
|
@ -89,6 +92,15 @@ class OtpPage extends React.Component{
|
||||||
const { classes } = this.props;
|
const { classes } = this.props;
|
||||||
return (
|
return (
|
||||||
<div className={classes.container}>
|
<div className={classes.container}>
|
||||||
|
<Snackbar
|
||||||
|
anchorOrigin={{ vertical : 'top', horizontal: 'center' }}
|
||||||
|
open={this.state.isResending}
|
||||||
|
onClose={()=>this.setState({isResending:false})}
|
||||||
|
ContentProps={{
|
||||||
|
'aria-describedby': 'message-id',
|
||||||
|
}}
|
||||||
|
message={<span id="message-id">OTP Code Re-sended</span>}
|
||||||
|
/>
|
||||||
<Grid container spacing={0} className={classes.gridContainer}>
|
<Grid container spacing={0} className={classes.gridContainer}>
|
||||||
<Grid item xs={12} className={classes.logoContainer}>
|
<Grid item xs={12} className={classes.logoContainer}>
|
||||||
<img src={require('../../../../assets/images/login/logo_new.png')} className={classes.logo} />
|
<img src={require('../../../../assets/images/login/logo_new.png')} className={classes.logo} />
|
||||||
|
@ -112,7 +124,7 @@ class OtpPage extends React.Component{
|
||||||
Input Your OTP Code
|
Input Your OTP Code
|
||||||
</Typography>
|
</Typography>
|
||||||
<Typography variant="subtitle2" gutterBottom>
|
<Typography variant="subtitle2" gutterBottom>
|
||||||
Still not received OTP Code? <Link to={"/register"}>Resend Code</Link>
|
Still not received OTP Code? <a onClick={()=>this.resendCode()}>Resend Code</a>
|
||||||
</Typography>
|
</Typography>
|
||||||
<Grid container justify="center" spacing={8}>
|
<Grid container justify="center" spacing={8}>
|
||||||
{[0, 1, 2, 3, 4, 5].map(x => (
|
{[0, 1, 2, 3, 4, 5].map(x => (
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
import { observable, action, computed} from 'mobx';
|
import { observable, action, computed} from 'mobx';
|
||||||
import * as fetch from 'isomorphic-fetch';
|
import * as fetch from 'isomorphic-fetch';
|
||||||
|
import { resolve } from 'url';
|
||||||
|
|
||||||
export class Authentication {
|
export class Authentication {
|
||||||
|
|
||||||
|
@ -8,7 +9,7 @@ export class Authentication {
|
||||||
@observable isLoggingIn = false;
|
@observable isLoggingIn = false;
|
||||||
@observable isInviting = false;
|
@observable isInviting = false;
|
||||||
@observable removingUser = false;
|
@observable removingUser = false;
|
||||||
|
@observable isNeedEmailVerification = false;
|
||||||
@observable userWallet = {};
|
@observable userWallet = {};
|
||||||
@observable userProfile = {
|
@observable userProfile = {
|
||||||
email : '',
|
email : '',
|
||||||
|
@ -50,8 +51,10 @@ export class Authentication {
|
||||||
return this.http.post("authentication/login", data)
|
return this.http.post("authentication/login", data)
|
||||||
.then(res => {
|
.then(res => {
|
||||||
this.isLoggingIn = false;
|
this.isLoggingIn = false;
|
||||||
|
this.isNeedEmailVerification = res.need_email_verification;
|
||||||
this.context.setToken(res.token);
|
this.context.setToken(res.token);
|
||||||
this.context.loadDataAfterLogin();
|
this.context.loadDataAfterLogin();
|
||||||
|
return res;
|
||||||
})
|
})
|
||||||
.catch(err => {
|
.catch(err => {
|
||||||
this.isLoggingIn = false;
|
this.isLoggingIn = false;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user