diff --git a/src/App.tsx b/src/App.tsx index fdaffba..ff837e6 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,9 +1,8 @@ import { Routes, Route } from "react-router-dom"; -import { AnimatePresence } from "framer-motion"; -import Home from "./Home"; -import Receive from "./Receive"; import Join from "./Join"; +import Layout from "./components/Layout"; + function App() { return (
@@ -12,7 +11,9 @@ function App() { {/* } /> */} - } /> + }> + } /> +
); diff --git a/src/Join.tsx b/src/Join.tsx index 90513ec..7e848f3 100644 --- a/src/Join.tsx +++ b/src/Join.tsx @@ -1,13 +1,11 @@ import { useEffect, useState } from "react"; -import { redirect } from "react-router-dom"; -import button from "./components/button" import WaitlistForm from "./components/WaitlistForm"; import { WaitlistAlreadyIn } from "./components/WaitlistAlreadyIn"; export default function Join() { // On load, check if the user is already on the waitlist const [waitlisted, setWaitlisted] = useState(false); - const [waitlistId, setWaitlistId] = useState(localStorage.getItem('waitlist_id') || ""); + const [waitlistId] = useState(localStorage.getItem('waitlist_id') || ""); const [loading, setLoading] = useState(true); // Fetch the waitlist status from the backend @@ -17,18 +15,17 @@ export default function Join() { if (res.status === 200) { setWaitlisted(true); } - + setLoading(false); }) + } else { + setLoading(false); } - setLoading(false); }, [waitlistId]); return ( -
-
- {waitlisted && !loading ? : !loading ? : null} -
-
+ <> + {loading ? null : waitlisted ? : } + ) } diff --git a/src/components/Layout.tsx b/src/components/Layout.tsx new file mode 100644 index 0000000..717c32c --- /dev/null +++ b/src/components/Layout.tsx @@ -0,0 +1,9 @@ +import { Outlet } from "react-router-dom"; + +export default function Layout() { + return (
+
+ +
+
) +} \ No newline at end of file diff --git a/src/main.tsx b/src/main.tsx index 049a9c5..4723db4 100644 --- a/src/main.tsx +++ b/src/main.tsx @@ -1,19 +1,11 @@ import React from 'react' import ReactDOM from 'react-dom/client' -import { createBrowserRouter, RouterProvider } from 'react-router-dom' +import { BrowserRouter } from 'react-router-dom' import App from './App' import './index.css' -const router = createBrowserRouter([ - { - path: "/", - element: , - }, -]); - ReactDOM.createRoot(document.getElementById('root') as HTMLElement).render( - - - {/* */} - , + + + )