forked from codex-iter/website-frontend
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.jsx
38 lines (35 loc) · 1.31 KB
/
App.jsx
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
import { BrowserRouter, Routes, Route } from "react-router-dom";
import Home from "./pages/Home";
import About from "./pages/About";
import NotFound from "./pages/404";
import Community from "./pages/Community";
import ContactForm from "./pages/Contact";
import Events from "./pages/Events";
import Base from "./layouts/Base";
import Subscribe from "./components/Subscribe";
import { useState } from "react";
// import NewsletterPage from "./pages/NewsletterPage";
export default function App() {
const [isVisible, setIsVisible] = useState(false);
const handleSetVisible = (value)=>{
setIsVisible(value);
};
return (
<div className="bg-primary">
{isVisible&&<Subscribe handle={handleSetVisible} />}
<BrowserRouter>
<Base>
<Routes>
<Route path="/" element={<Home handle={handleSetVisible} />} />
<Route path="/about-us" element={<About handle={handleSetVisible} />} />
<Route path="/community" element={<Community />} />
<Route path="/events" element={<Events />} />
<Route path="/contact-us" element={<ContactForm />} />
{/* <Route path="/newsletter" element={<NewsletterPage />} /> */}
<Route path="*" element={<NotFound />} />
</Routes>
</Base>
</BrowserRouter>
</div>
);
}