-
Notifications
You must be signed in to change notification settings - Fork 323
/
UserDashboard.tsx
39 lines (34 loc) · 1.07 KB
/
UserDashboard.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import React, {lazy} from 'react'
import {Route} from 'react-router'
import {Switch} from 'react-router-dom'
const Organizations = lazy(
() =>
import(
/* webpackChunkName: 'OrganizationsRoot' */ '../../containers/Organizations/OrganizationsRoot'
)
)
const Organization = lazy(
() =>
import(
/* webpackChunkName: 'OrganizationRoot' */ '../../containers/Organization/OrganizationRoot'
)
)
const UserDashMain = lazy(() => import(/* webpackChunkName: 'UserDashMain' */ '../UserDashMain'))
const UserProfile = lazy(
() => import(/* webpackChunkName: 'UserProfileRoot' */ '../UserProfileRoot')
)
interface Props {
match: any
}
const UserDashboard = (props: Props) => {
const {match} = props
return (
<Switch>
<Route path={`${match.url}/profile`} component={UserProfile} />
<Route exact path={`${match.url}/organizations`} component={Organizations} />
<Route path={`${match.url}/organizations/:orgId`} component={Organization} />
<Route path={match.url} component={UserDashMain} />
</Switch>
)
}
export default UserDashboard