mirror of https://gitlab.com/ecentrics/concordia
Apostolos Fanakis
7 years ago
20 changed files with 108 additions and 109 deletions
@ -1,7 +0,0 @@ |
|||||
/* NAVBAR */ |
|
||||
|
|
||||
.nav-link:hover { |
|
||||
background: rgba(255,255,255,.08) !important; |
|
||||
color: #fff !important; |
|
||||
cursor: pointer !important; |
|
||||
} |
|
@ -1,25 +0,0 @@ |
|||||
import React from 'react'; |
|
||||
import { drizzleConnect } from 'drizzle-react'; |
|
||||
import { Route } from "react-router"; |
|
||||
import { Redirect } from "react-router-dom"; |
|
||||
|
|
||||
const PrivateRoute = (props) => { |
|
||||
return ( |
|
||||
props.user.hasSignedUp |
|
||||
? <Route path={props.path} component={props.component} /> |
|
||||
: <Redirect |
|
||||
from={props.path} |
|
||||
to="/login" |
|
||||
/> |
|
||||
); |
|
||||
}; |
|
||||
|
|
||||
const mapStateToProps = state => { |
|
||||
return { |
|
||||
user: state.user |
|
||||
} |
|
||||
}; |
|
||||
|
|
||||
const PrivateRouteContainer = drizzleConnect(PrivateRoute, mapStateToProps); |
|
||||
|
|
||||
export default PrivateRouteContainer; |
|
Loading…
Reference in new issue