import React, { Component } from 'react'; import Mobile from './Mobile/Mobile'; import Code from './Code/Code'; import { otp } from '../../../Redux/actions/public'; import { login } from '../../../Redux/actions/user'; import { connect } from 'react-redux'; import './Login.scss'; class Login extends Component { constructor(props) { super(props); this.state = { section: 0, }; } async componentDidUpdate() { const { cellphone, otp, section } = this.state; // if(cellphone.length === 9 && !otp){ // this.setState({section: 1}); // this.props.otp({cellphone}); // } if (cellphone && !otp) this.props.otp({ cellphone }); if (section && cellphone && otp) this.props.login({ cellphone, otp }); } resend = () => { const {cellphone} = this.state; this.props.otp({cellphone}); } render() { const { section } = this.state; return (
{section ? : }

Eema

Entertainments

); } } export default connect((state) => ({ isLogin: state.user.isLogin }), { otp, login })(Login);