|
@@ -12,6 +12,7 @@ import {
|
12
|
12
|
withRouter
|
13
|
13
|
} from 'react-router-dom'
|
14
|
14
|
import PrivateRoute from './PrivateRoute.jsx'
|
|
15
|
+import { PAGE_NAME } from '../helper.js'
|
15
|
16
|
import { getIsUserConnected } from '../action-creator.async.js'
|
16
|
17
|
|
17
|
18
|
class Tracim extends React.Component {
|
|
@@ -22,16 +23,14 @@ class Tracim extends React.Component {
|
22
|
23
|
render () {
|
23
|
24
|
const { user, location } = this.props
|
24
|
25
|
|
25
|
|
- const SidebarWrapper = props => {
|
26
|
|
- if (props.locationPath !== '/login') {
|
27
|
|
- return (
|
28
|
|
- <div className='sidebarpagecontainer'>
|
29
|
|
- <Sidebar />
|
30
|
|
- {props.children}
|
31
|
|
- </div>
|
32
|
|
- )
|
33
|
|
- } else return props.children
|
34
|
|
- }
|
|
26
|
+ const SidebarWrapper = props => props.locationPath !== '/login'
|
|
27
|
+ ? (
|
|
28
|
+ <div className='sidebarpagecontainer'>
|
|
29
|
+ <Sidebar />
|
|
30
|
+ {props.children}
|
|
31
|
+ </div>
|
|
32
|
+ )
|
|
33
|
+ : props.children
|
35
|
34
|
|
36
|
35
|
return (
|
37
|
36
|
<div>
|
|
@@ -41,13 +40,13 @@ class Tracim extends React.Component {
|
41
|
40
|
? (<div />) // while we dont know if user is connected, display nothing but the header @TODO show loader
|
42
|
41
|
: (
|
43
|
42
|
<div>
|
44
|
|
- <Route path='/login' component={Login} />
|
|
43
|
+ <Route path={PAGE_NAME.LOGIN} component={Login} />
|
45
|
44
|
|
46
|
45
|
<SidebarWrapper locationPath={location.pathname}>
|
47
|
46
|
|
48
|
|
- <PrivateRoute exact path='/' component={WorkspaceContent} />
|
49
|
|
- <PrivateRoute exact path='/account' component={AccountPage} />
|
50
|
|
- <PrivateRoute exact path='/dashboard' component={Dashboard} />
|
|
47
|
+ <PrivateRoute exact path={PAGE_NAME.HOME} component={WorkspaceContent} />
|
|
48
|
+ <PrivateRoute exact path={PAGE_NAME.ACCOUNT} component={AccountPage} />
|
|
49
|
+ <PrivateRoute exact path={PAGE_NAME.DASHBOARD} component={Dashboard} />
|
51
|
50
|
|
52
|
51
|
</SidebarWrapper>
|
53
|
52
|
|