forked from leebenson/reactql
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathroot.tsx
42 lines (33 loc) · 939 Bytes
/
root.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
40
41
42
// Root entry point
// ----------------------------------------------------------------------------
// IMPORTS
/* NPM */
import * as React from "react";
import Helmet from "react-helmet";
import { hot } from "react-hot-loader/root";
import { Route, Switch } from "react-router-dom";
import { Global } from "@emotion/core";
/* Local */
// Components
import ScrollTop from "@/components/helpers/scrollTop";
// Global styles
import globalStyles from "@/global/styles";
// Routes
import routes from "@/data/routes";
// ----------------------------------------------------------------------------
const Root = () => (
<div>
<Global styles={globalStyles} />
<Helmet>
<title>ReactQL starter kit - edit me!</title>
</Helmet>
<ScrollTop>
<Switch>
{routes.map(route => (
<Route key={route.path} {...route} />
))}
</Switch>
</ScrollTop>
</div>
);
export default hot(Root);