-
Notifications
You must be signed in to change notification settings - Fork 4
/
routes.js
138 lines (135 loc) · 2.97 KB
/
routes.js
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
import { Route } from 'react-router-dom'
// Top Level Containers
import Home from './app/containers/Home'
import Invited from './agents/containers/Invited'
import MyProfilePage from './agents/containers/MyProfile'
import MyGroupsPage from './agents/containers/MyGroups'
import ProfilePage from './agents/containers/Profile'
import TasksPage from './tasks/containers/TasksPage'
import TaskWorker from './tasks/containers/TaskWorker'
import OrdersPage from './ordering/containers/OrdersPage'
import OrderPage from './ordering/containers/OrderPage'
import OrderSummary from './ordering/containers/OrderSummary'
import {
Register,
SignIn,
LogOut
} from 'dogstack-agents/components'
import {
UserIsAuthenticated,
UserIsNotAuthenticated
} from 'dogstack-agents/hoc'
import {
getIsAuthenticated,
getIsNotAuthenticated
} from 'dogstack-agents/getters'
export default [
{
name: 'home',
path: '/',
exact: true,
Component: Home,
selector: getIsNotAuthenticated,
navigation: {
title: 'app.home',
icon: 'fa fa-home'
}
},
{
name: 'order',
path: '/o/:orderId',
Component: OrderPage,
selector: getIsAuthenticated
},
{
name: 'signIn',
path: '/sign-in',
Component: UserIsNotAuthenticated(SignIn),
navigation: {
title: 'agents.signIn',
selector: getIsNotAuthenticated,
icon: 'fa fa-sign-in'
}
},
{
name: 'logOut',
navigation: {
Component: LogOut,
selector: getIsAuthenticated,
icon: 'fa fa-sign-out'
}
},
{
name: 'register',
path: '/register',
Component: UserIsNotAuthenticated(Register),
navigation: {
title: 'agents.register',
selector: getIsNotAuthenticated,
icon: 'fa fa-heart'
}
},
{
name: 'invited',
path: '/invited/:jwt/:orderId',
Component: UserIsNotAuthenticated(Invited)
},
{
name: 'orders',
path: '/',
exact: true,
Component: OrdersPage,
selector: getIsAuthenticated,
navigation: {
title: 'app.orders',
icon: 'fa fa-shopping-basket'
}
},
{
name: 'tasks',
path: '/tasks',
exact: true,
Component: UserIsAuthenticated(TasksPage),
navigation: {
title: 'tasks.tasks',
selector: getIsAuthenticated,
icon: 'fa fa-check-circle'
}
},
{
name: 'task',
path: '/tasks/:taskPlanId',
Component: UserIsAuthenticated(TaskWorker)
},
{
name: 'orderSummary',
path: '/ordersummary',
Component: OrderSummary
},
{
name: 'my-profile',
path: '/my-profile',
Component: MyProfilePage,
selector: getIsAuthenticated,
navigation: {
title: 'app.myProfile',
icon: 'fa fa-user'
}
},
{
name: 'my-groups',
path: '/my-groups',
Component: MyGroupsPage,
selector: getIsAuthenticated,
navigation: {
title: 'agents.myGroups',
icon: 'fa fa-users'
}
},
{
name: 'profile',
path: '/p/:profileId',
Component: ProfilePage,
selector: getIsAuthenticated
},
]