-
Notifications
You must be signed in to change notification settings - Fork 0
/
routes.js
54 lines (47 loc) · 1.09 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
import { dAppName } from './config';
import Home from './pages/dapp';
import Dashboard from './pages/dashboard';
import withPageTitle from './pages/PageTitle';
export const routeNames = {
home: '/dapp',
dashboard: '/dashboard',
ledger: '/ledger',
walletconnect: '/walletconnect'
};
export const navPages = {
index: '/',
plan: '/plan',
traits: '/traits',
faq: '/faq',
home: '/',
dashboard: '/',
trustmarket: '/',
deadrare: '/',
isengard: '/',
}
const routes = [
{
path: routeNames.home,
title: 'Home',
component: Home
},
{
path: routeNames.dashboard,
title: 'Dashboard',
component: Dashboard,
authenticatedRoute: true
}
];
const mappedRoutes = routes.map((route) => {
const title = route.title
? `${route.title} • Elrond ${dAppName}`
: `Elrond ${dAppName}`;
const requiresAuth = Boolean(route.authenticatedRoute);
const wrappedComponent = withPageTitle(title, route.component);
return {
path: route.path,
component: wrappedComponent,
authenticatedRoute: requiresAuth
};
});
export default mappedRoutes;