forked from creativetimofficial/notus-react
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
34 lines (28 loc) · 995 Bytes
/
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
import React from "react";
import ReactDOM from "react-dom";
import { BrowserRouter, Route, Switch, Redirect } from "react-router-dom";
import "@fortawesome/fontawesome-free/css/all.min.css";
import "assets/styles/tailwind.css";
// layouts
import Admin from "layouts/Admin.js";
import Auth from "layouts/Auth.js";
// views without layouts
import Landing from "views/Landing.js";
import Profile from "views/Profile.js";
import Index from "views/Index.js";
ReactDOM.render(
<BrowserRouter>
<Switch>
{/* add routes with layouts */}
<Route path="/admin" component={Admin} />
<Route path="/auth" component={Auth} />
{/* add routes without layouts */}
<Route path="/landing" exact component={Landing} />
<Route path="/profile" exact component={Profile} />
<Route path="/" exact component={Index} />
{/* add redirect for first page */}
<Redirect from="*" to="/" />
</Switch>
</BrowserRouter>,
document.getElementById("root")
);