{"size": 2780, "ext": "js", "max_stars_repo_path": "src/components/VerifyAccount.js", "max_stars_repo_name": "1412010/Blockchain-kcoin-client", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/components/VerifyAccount.js", "max_issues_repo_name": "1412010/Blockchain-kcoin-client", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/components/VerifyAccount.js", "max_forks_repo_name": "1412010/Blockchain-kcoin-client", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 42.7692307692, "max_line_length": 145, "alphanum_fraction": 0.4820143885}
import React from "react";
import { Link, Redirect, Route } from "react-router-dom";
import { Field, reduxForm } from 'redux-form';
import { connect } from "react-redux";

import { Error, Success } from "./smaller/warnings";
import { InputText } from "./smaller/InputField";
import { submitLogin, checkLogin, submitVerifyAccount } from '../actions';

class VerifyAccount extends React.Component {

    render() {
        const myState = this.props.account
        return (
            <div className="wrapperLogin">
                <div className="card border-success mb-3" style={{ width: "30%" }}>
                    <div className="card-header text-success">
                        <h3 className="card-title">Verify Account</h3>
                    </div>
                    <div style={{ paddingtop: 30 }} className="card-body" >
                        <Error errMsg= {myState.errorMsg_Verify}/>
                        <Success errMsg= {myState.successMsg_Verify}/>                        
                        <form id="verifyAccForm" className="form-horizontal" onSubmit={this.props.handleSubmit}>
                            <label htmlFor="email" className="font-weight-bold">Please enter the code we have sent  to your email</label>
                            <div style={{ marginBottom: 25 }} className="input-group">
                                <Field name='code' type='text' component={InputText} placeholder='Enter the code...' id='code' required={true} />
                                <div className="input-group-append">
                                    <button className="btn btn-outline-success" type="submit">Verify</button>
                                </div>
                            </div>

                            {/* Button log in */}
                            <div className="form-group">
                                <div className="col-md-12 control">
                                    <div >
                                        Verified successfully?
                                        <Link to="/login">
                                            &nbsp;Log in here
                                        </Link>
                                    </div>
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
            </div >
        );
    }
}

VerifyAccount = reduxForm({
    form: 'verifyAccForm'
})(VerifyAccount);

const mapStateToProps = state => ({
    account: state.account
})

const mapDispatchToProps = dispatch => ({
    onSubmit: values => dispatch(submitVerifyAccount(values))
})

VerifyAccount = connect(mapStateToProps, mapDispatchToProps)(VerifyAccount)

export default VerifyAccount