-
Notifications
You must be signed in to change notification settings - Fork 1.3k
/
App.js
49 lines (41 loc) · 1.21 KB
/
App.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
import React from "react";
import { Router, Route, Switch } from "react-router-dom";
import { Container } from "reactstrap";
import Loading from "./components/Loading";
import NavBar from "./components/NavBar";
import Footer from "./components/Footer";
import Home from "./views/Home";
import Profile from "./views/Profile";
import ExternalApi from "./views/ExternalApi";
import { useAuth0 } from "@auth0/auth0-react";
import history from "./utils/history";
// styles
import "./App.css";
// fontawesome
import initFontAwesome from "./utils/initFontAwesome";
initFontAwesome();
const App = () => {
const { isLoading, error } = useAuth0();
if (error) {
return <div>Oops... {error.message}</div>;
}
if (isLoading) {
return <Loading />;
}
return (
<Router history={history}>
<div id="app" className="d-flex flex-column h-100">
<NavBar />
<Container className="flex-grow-1 mt-5">
<Switch>
<Route path="/" exact component={Home} />
<Route path="/profile" component={Profile} />
<Route path="/external-api" component={ExternalApi} />
</Switch>
</Container>
<Footer />
</div>
</Router>
);
};
export default App;