Everything run from this file
This commit is contained in:
parent
02332c284b
commit
15ec2108d3
1 changed files with 20 additions and 0 deletions
20
frontend/src/Pages/App.tsx
Normal file
20
frontend/src/Pages/App.tsx
Normal file
|
@ -0,0 +1,20 @@
|
|||
import { useState } from "react";
|
||||
|
||||
import LoginPage from "./LoginPage";
|
||||
import { useNavigate } from "react-router-dom";
|
||||
|
||||
function App(): JSX.Element {
|
||||
const navigate = useNavigate();
|
||||
const [authority, setAuthority] = useState(0);
|
||||
if (authority === 1) {
|
||||
navigate("/admin");
|
||||
} else if (authority === 2) {
|
||||
navigate("/pm");
|
||||
} else if (authority === 3) {
|
||||
navigate("/user");
|
||||
}
|
||||
|
||||
return <LoginPage setAuthority={setAuthority} />;
|
||||
}
|
||||
|
||||
export default App;
|
Loading…
Reference in a new issue