-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAppRouter.js
More file actions
26 lines (24 loc) · 933 Bytes
/
AppRouter.js
File metadata and controls
26 lines (24 loc) · 933 Bytes
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
import React from "react";
import { AuthCallback } from "../pages/AuthCallback";
import { createBrowserHistory } from "history";
import { Loading } from "../pages/Loading";
import { PrivateRoute } from "./PrivateRoute";
import { PublicRoute } from "./PublicRoute";
import { Router, Route, Switch } from "react-router-dom";
import { SignIn } from "../pages/SignIn";
import Home from "../pages/Home";
import NotFound from "../pages/NotFound";
export const customHistory = createBrowserHistory();
export const AppRouter = () => {
return (
<Router history={customHistory}>
<Switch>
<PublicRoute exact path="/"><SignIn/></PublicRoute>
<Route path="/loading" component={Loading} />
<Route path="/auth-callback" component={AuthCallback} />
<PrivateRoute path="/home" ><Home/></PrivateRoute>
<Route component={NotFound} />
</Switch>
</Router>
);
};