import React, { Component } from 'react'; import { Header } from 'semantic-ui-react'; import {connect} from "react-redux"; import UsernameFormContainer from './UsernameFormContainer'; class SignUp extends Component { componentDidUpdate(prevProps) { if (this.props.user.hasSignedUp && !prevProps.user.hasSignedUp){ this.props.history.push("/"); } } render() { return ( this.props.user.hasSignedUp ?(
There is already an account for this addresss.
If you want to create another account please change your address.
) :(

Sign Up

Account address: {this.props.user.address}

) ); } } const mapStateToProps = state => { return { user: state.user } }; const SignUpContainer = connect(mapStateToProps)(SignUp); export default SignUpContainer;