RegistrationPage.js 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. import React from 'react';
  2. import { connect } from "react-redux";
  3. import { Link } from "react-router-dom";
  4. import { postCheckInSubmit } from "../../actions/registration";
  5. import './registration-page.scss';
  6. import RegistrationForm from '../../components/registration-form/RegistrationForm';
  7. export class Login extends React.Component {
  8. render() {
  9. const { message, history } = this.props;
  10. return (
  11. <div className="reg-page">
  12. <div className="form-reg">
  13. {
  14. message === "User already exist" && <h3>{message}!</h3>
  15. }
  16. <RegistrationForm history={history} postCheckInSubmit={this.props.postCheckInSubmit}/>
  17. <p className="form-quest">You have an account? <Link to="/login">Login now</Link></p>
  18. </div>
  19. </div>
  20. )
  21. }
  22. }
  23. const mapStateToProps = state => {
  24. return {
  25. message: state.registration.message
  26. };
  27. };
  28. export default connect(
  29. mapStateToProps,
  30. { postCheckInSubmit }
  31. )(Login);