initial commit
This commit is contained in:
20
frontend/studia/src/App.tsx
Normal file
20
frontend/studia/src/App.tsx
Normal file
@@ -0,0 +1,20 @@
|
||||
import { useState } from "react";
|
||||
import Landing from "./pages/Landing";
|
||||
// import Dashboard from "./pages/Dashboard";
|
||||
import Dashboard from "./pages/Dashboard"
|
||||
import LoginModal from "./components/LoginModal";
|
||||
|
||||
export default function App() {
|
||||
const [token, setToken] = useState(localStorage.getItem("token"));
|
||||
const [showLogin, setShowLogin] = useState(false);
|
||||
|
||||
if (!token)
|
||||
return (
|
||||
<>
|
||||
<Landing onLogin={() => setShowLogin(true)} />
|
||||
{showLogin && <LoginModal onSuccess={setToken} />}
|
||||
</>
|
||||
);
|
||||
|
||||
return <Dashboard />;
|
||||
}
|
||||
Reference in New Issue
Block a user