{"size": 3294, "ext": "js", "max_stars_repo_path": "src/components/smaller/ModalVerify.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/smaller/ModalVerify.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/smaller/ModalVerify.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": 49.9090909091, "max_line_length": 162, "alphanum_fraction": 0.529143898}
import React from "react";
import { connect } from "react-redux";
import { reduxForm, Field } from "redux-form";
import { InputText } from "./InputField";
import { Error, Success } from "./warnings";
import { submitSendCoins, submitVerifyTransaction } from "../../actions";

class ModalVerify extends React.Component {

    render() {
        const myState = this.props.account
        console.log(myState)
        return (
            <div className="modal fade" id="verifyModal" tabIndex="-1" role="dialog" aria-labelledby="verifyModalLabel" aria-hidden="true" >
                <div className="modal-dialog" role="document">
                    <div className="modal-content">
                        <div className="modal-header">
                            <h5 className="modal-title" id="exampleModalLabel">Verify transaction</h5>
                            <button type="button" className="close" data-dismiss="modal" aria-label="Close">
                                <span aria-hidden="true">&times;</span>
                            </button>
                        </div>
                        <div className="modal-body">
                            <form id='formVerifyTrans' onSubmit={this.props.handleSubmit}>
                                <Error errMsg={myState.errorMsg_VerifyTrans} />
                                <Success errMsg={myState.successMsg_VerifyTrans} />
                                <label className="col-form-label">Please enter the code of the transaction that we have sent to your email to verify it.</label>
                                <div className="form-group">
                                    <label htmlFor="code" className="col-form-label font-weight-bold">Verify code:</label>
                                    <Field type="text" name="code" id="code" minLength={8} required component={InputText} />
                                </div>
                                <div className="form-group">
                                    <label htmlFor="pwAgain" className="col-form-label font-weight-bold">Your Account Password:</label>
                                    <Field type="password" id="pwAgain" name="pwAgain" minLength={6} required component={InputText} />
                                </div>
                                <input type="submit" id="input-form-submit-verify-trans" style={{ display: 'none' }} />
                            </form>
                        </div>
                        <div className="modal-footer">
                            <label htmlFor="input-form-submit-verify-trans" role="button" className="btn btn-primary mt-2"> Submit</label>
                            <button type="button" className="btn btn-secondary" data-dismiss="modal" ref={(input) => { this.closeModal = input; }}>Cancel</button>
                        </div>
                    </div>
                </div>
            </div>
        )
    }
}


ModalVerify = reduxForm({
    form: 'formVerifyTrans'
})(ModalVerify)

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

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

ModalVerify =
    connect(mapStateToProps, mapDispatchToProps)(ModalVerify)

export default ModalVerify