-
Notifications
You must be signed in to change notification settings - Fork 278
/
index.js
103 lines (93 loc) · 2.51 KB
/
index.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
/**
* React Starter Kit (https://www.reactstarterkit.com/)
*
* Copyright © 2014-2016 Kriasoft, LLC. All rights reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE.txt file in the root directory of this source tree.
*/
import React from 'react';
import App from '../components/App';
// Child routes
import home from './home';
import login from './login';
import table from './dashboardPages/tables';
import button from './dashboardPages/buttons';
import flotcharts from './dashboardPages/flotCharts';
import forms from './dashboardPages/forms';
import grid from './dashboardPages/grid';
import icons from './dashboardPages/icons';
import morrisjscharts from './dashboardPages/morrisjsCharts';
import notification from './dashboardPages/notification';
import panelwells from './dashboardPages/panelWells';
import typography from './dashboardPages/typography';
import blank from './dashboardPages/blank';
import error from './error';
import Header from '../components/Header';
export default [
{
path: '/login',
children: [
login,
],
async action({ next, render, context }) {
const component = await next();
if (component === undefined) return component;
return render(
<App context={context}>{component}</App>
);
},
},
{
path: '/',
// keep in mind, routes are evaluated in order
children: [
home,
// contact,
table,
button,
flotcharts,
forms,
grid,
icons,
morrisjscharts,
notification,
panelwells,
typography,
// register,
blank,
// place new routes before...
// content,
error,
],
async action({ next, render, context }) {
// console.log('inside dashboard');
const component = await next();
// console.log('inside dasdboard component', component);
if (component === undefined) return component;
return render(
<div>
<Header />
<div id="page-wrapper" className="page-wrapper">
<App context={context}>{component}</App>
</div>
</div>
);
},
},
{
path: '/error',
children: [
error,
],
async action({ next, render, context }) {
// console.log('inside error');
const component = await next();
// console.log('inside error with component', component);
if (component === undefined) return component;
return render(
<App context={context}>{component}</App>
);
},
},
];