forked from Adedoyin-Emmanuel/react-weather-app
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.js
34 lines (31 loc) · 1.1 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
import Home from "./pages/Home";
import Support from "./pages/Support";
import { Routes, Route, BrowserRouter } from "react-router-dom";
import WeatherApp from "./pages/Weather";
import WeatherMain from "./pages/WeatherMain";
import NotFound from "./pages/404";
import ForecastWeather from "./pages/ForecastWeather";
import Settings from "./pages/Settings";
import { db } from "./backend/app_backend";
import "./autoload";
function App() {
let homePageSeen = db.get("HOME_PAGE_SEEN");
let DEFAULT_ROUTE_PAGE;
homePageSeen
? (DEFAULT_ROUTE_PAGE = <WeatherApp />)
: (DEFAULT_ROUTE_PAGE = <Home />);
return (
<BrowserRouter>
<Routes>
<Route index element={DEFAULT_ROUTE_PAGE} />
<Route path="support" element={<Support />} />
<Route path="weather" element={<WeatherApp />} />
<Route path="weathermain" element={<WeatherMain />} />
<Route path="forecast" element={<ForecastWeather />} />
<Route path="settings" element={<Settings />} />
<Route path="*" element={<NotFound />} />
</Routes>
</BrowserRouter>
);
}
export default App;