| 1 | import { Routes, Route, useLocation } from "react-router-dom"; |
| 2 | import * as Tooltip from "@radix-ui/react-tooltip"; |
| 3 | |
| 4 | import Navbar from "./components/Navbar"; |
| 5 | import AnimatedPage from "./components/AnimatedPage"; |
| 6 | import Home from "./pages/Home"; |
| 7 | import Cut from "./pages/Cut"; |
| 8 | import Profile from "./pages/Profile"; |
| 9 | import { AccountProvider } from "./context/AccountContext"; |
| 10 | |
| 11 | export default function App() { |
| 12 | const location = useLocation(); |
| 13 | return ( |
| 14 | <Tooltip.Provider> |
| 15 | <div className="bg-gradient-to-tr from-fuchsia-100 to-sky-100 min-h-screen w-full font-sans relative safe-area"> |
| 16 | <Navbar /> |
| 17 | <main className="py-4 bottom-nav-safe max-w-2xl mx-auto px-4"> |
| 18 | <AccountProvider> |
| 19 | <Routes location={location} key={location.pathname}> |
| 20 | <Route |
| 21 | path="/" |
| 22 | element={ |
| 23 | <AnimatedPage> |
| 24 | <Home /> |
| 25 | </AnimatedPage> |
| 26 | } |
| 27 | /> |
| 28 | <Route |
| 29 | path="/cut" |
| 30 | element={ |
| 31 | <AnimatedPage> |
| 32 | <Cut /> |
| 33 | </AnimatedPage> |
| 34 | } |
| 35 | /> |
| 36 | <Route |
| 37 | path="/profile" |
| 38 | element={ |
| 39 | <AnimatedPage> |
| 40 | <Profile /> |
| 41 | </AnimatedPage> |
| 42 | } |
| 43 | /> |
| 44 | </Routes> |
| 45 | </AccountProvider> |
| 46 | </main> |
| 47 | </div> |
| 48 | </Tooltip.Provider> |
| 49 | ); |
| 50 | } |