Skip to content
Snippets Groups Projects
Commit 7b4d9526 authored by Ismail's avatar Ismail
Browse files

Nav link modified. session thing updated for loggedIn users!

parent 175e955e
No related branches found
No related tags found
No related merge requests found
import React from 'react';
import SignIn from './components/auth/SignIn'
import Dashboard from './components/dashboard/Dashboard'
import { BrowserRouter } from 'react-router-dom';
import { BrowserRouter, Switch, Route } from 'react-router-dom';
function App() {
return (
<BrowserRouter>
<div className="App">
<SignIn />
<Switch>
<Route exact path='/' component={Dashboard} />
<Route path='/signin' component={SignIn} />
</Switch>
</div>
</BrowserRouter>
);
......
......@@ -21,7 +21,8 @@ class Signin extends Component {
this.props.signIn(this.state);
}
render(){
const { authError } = this.props;
const { authError, auth } = this.props;
if( auth.uid ) return <Redirect to='/' />
return(
<div className="Login">
<div className="login-wrap">
......@@ -49,9 +50,9 @@ class Signin extends Component {
}
const mapStateToProps = (state) => {
//console.log(state.authError);
return {
authError: state.authError,
auth: state.firebase.auth
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment