forked from CodeGraphContext/CodeGraphContext
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApp.tsx
More file actions
57 lines (52 loc) · 1.73 KB
/
Copy pathApp.tsx
File metadata and controls
57 lines (52 loc) · 1.73 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 { useEffect } from "react";
import { Toaster } from "@/components/ui/toaster";
import { Toaster as Sonner } from "@/components/ui/sonner";
import { TooltipProvider } from "@/components/ui/tooltip";
import { ThemeProvider } from "@/components/ThemeProvider";
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
import { BrowserRouter, Routes, Route } from "react-router-dom";
import Index from "./pages/Index";
import NotFound from "./pages/NotFound";
import MoveToTop from "./components/MoveToTop";
import Navbar from "./components/Navbar";
// ✅ Import AOS library and CSS
import AOS from "aos";
import "aos/dist/aos.css";
const queryClient = new QueryClient();
const App: React.FC = () => {
// ✅ Initialize AOS once on mount
useEffect(() => {
AOS.init({
duration: 800, // Animation duration (ms)
easing: "ease-in-out", // Smooth transition
once: true, // Run animation only once
mirror: false, // Do not animate when scrolling back up
});
}, []);
return (
<BrowserRouter>
<QueryClientProvider client={queryClient}>
<ThemeProvider
attribute="class"
defaultTheme="dark"
enableSystem
disableTransitionOnChange
>
<TooltipProvider>
<Toaster />
<Sonner />
<Navbar />
<Routes>
<Route path="/" element={<Index />} />
{/* ADD ALL CUSTOM ROUTES ABOVE THE CATCH-ALL "*" ROUTE */}
<Route path="*" element={<NotFound />} />
</Routes>
{/* Move to Top button */}
<MoveToTop />
</TooltipProvider>
</ThemeProvider>
</QueryClientProvider>
</BrowserRouter>
);
};
export default App;