-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApp.jsx
More file actions
57 lines (52 loc) · 1.65 KB
/
App.jsx
File metadata and controls
57 lines (52 loc) · 1.65 KB
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
50
51
52
53
54
55
56
57
import { useState } from "react";
import { AnimatePresence } from "framer-motion";
import { HashRouter as Router, Routes, Route } from "react-router-dom";
import { ToastContainer } from "react-toastify";
import routes from "@/routes/index";
import Navbar from "@/components/Navbar/index";
import Footer from "@/components/Footer/index";
import Cursor from "./components/Cursor";
import CursorVariantProvider from "@/context/CursorVariantProvider";
import Loader from "@/components/Loader";
import ScrollToTop from "@/components/ScrollToTop";
const navLinks = [
{ name: "About Us", path: "/about-us" },
{ name: "Our Team", path: "/teams" },
{ name: "Gallery", path: "/gallery" },
{ name: "Events", path: "/events" },
{ name: "Contact Us", path: "/contact" },
];
function App() {
const [loading, setLoading] = useState(true);
// Function to be called when the loader finishes
const handleLoadComplete = () => {
setLoading(false); // Set loading to false once the loader is done
};
return (
<CursorVariantProvider>
<AnimatePresence>
{loading ? (
<Loader onLoadComplete={handleLoadComplete} />
) : (
<Router>
<Navbar links={navLinks} />
<Cursor />
<ToastContainer />
<ScrollToTop />
<Routes>
{routes.map((route) => (
<Route
path={route.path}
element={route.render}
key={route.label}
/>
))}
</Routes>
<Footer />
</Router>
)}
</AnimatePresence>
</CursorVariantProvider>
);
}
export default App;