import React from 'react';
import { connect } from "react-redux";
import { Link } from "react-router-dom";

import { postCheckInSubmit } from "../../actions/registration";

import RegistrationForm from '../../components/registration-form/RegistrationForm';

export class Login extends React.Component {
    render() {
        return (
            <div>
                <RegistrationForm postCheckInSubmit={this.props.postCheckInSubmit}/>
                <p>You have an account? <Link to="/login">Login now</Link></p>
            </div>
        )
    }
}

const mapStateToProps = state => {
    return {
        user: state.registration.user
    };
};

export default connect(
    mapStateToProps,
    { postCheckInSubmit }
)(Login);