import React, { Component } from 'react' import { connect } from 'react-redux'; import { bindActionCreators } from 'redux'; import { signInRequest } from './../../actions/auth/signIn' import { signUpRequest } from './../../actions/auth/signUp' import { auth } from '../../firebase_config' class AuthPage extends Component { constructor(props) { super(props); } render() { const { isFetching, error, user } = this.props.auth; const { signInRequest } = this.props; console.log(" - props", this.props); return (

{isFetching ? 'wait a moment...' : error ? 'Looks like we\'ve in trouble...' : user && user.displayName}

) } } const mapStateToProps = state => ({ auth: { ...state.signIn } }), mapDispatchToProps = dispatch => bindActionCreators({ signInRequest, signUpRequest }, dispatch); export default connect(mapStateToProps, mapDispatchToProps)(AuthPage)