2024-03-18 10:43:52 +01:00
|
|
|
import { useState, useEffect } from "react";
|
2024-03-17 10:38:25 +01:00
|
|
|
|
|
|
|
import LoginPage from "./LoginPage";
|
|
|
|
import { useNavigate } from "react-router-dom";
|
|
|
|
|
|
|
|
function App(): JSX.Element {
|
|
|
|
const navigate = useNavigate();
|
|
|
|
const [authority, setAuthority] = useState(0);
|
2024-03-18 10:43:52 +01:00
|
|
|
|
|
|
|
useEffect(() => {
|
|
|
|
if (authority === 1) {
|
|
|
|
navigate("/admin");
|
|
|
|
} else if (authority === 2) {
|
|
|
|
navigate("/pm");
|
|
|
|
} else if (authority === 3) {
|
2024-03-18 21:37:52 +01:00
|
|
|
navigate("/yourProjects");
|
2024-03-18 10:43:52 +01:00
|
|
|
}
|
|
|
|
}, [authority, navigate]);
|
2024-03-17 10:38:25 +01:00
|
|
|
|
|
|
|
return <LoginPage setAuthority={setAuthority} />;
|
|
|
|
}
|
|
|
|
|
|
|
|
export default App;
|