Add UserProjectMenu component and refactor UserProjectPage
This commit is contained in:
parent
08a0ebb533
commit
d355b55634
2 changed files with 27 additions and 16 deletions
25
frontend/src/Components/UserProjectMenu.tsx
Normal file
25
frontend/src/Components/UserProjectMenu.tsx
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
import { useParams, Link } from "react-router-dom";
|
||||||
|
import { JSX } from "react/jsx-runtime";
|
||||||
|
|
||||||
|
function UserProjectMenu(): JSX.Element {
|
||||||
|
const { projectName } = useParams();
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<h1 className="font-bold text-[30px] mb-[20px]">{projectName}</h1>
|
||||||
|
<div className="border-4 border-black bg-white flex flex-col items-center justify-center min-h-[65vh] h-fit w-[50vw] rounded-3xl content-center overflow-scroll space-y-[10vh] p-[30px]">
|
||||||
|
<Link to={`/timeReports/${projectName}/`}>
|
||||||
|
<h1 className="font-bold underline text-[30px] cursor-pointer">
|
||||||
|
Your Time Reports
|
||||||
|
</h1>
|
||||||
|
</Link>
|
||||||
|
<Link to={`/newTimeReport/${projectName}`}>
|
||||||
|
<h1 className="font-bold underline text-[30px] cursor-pointer">
|
||||||
|
New Time Report
|
||||||
|
</h1>
|
||||||
|
</Link>
|
||||||
|
</div>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
export default UserProjectMenu;
|
|
@ -1,25 +1,11 @@
|
||||||
import { Link, useParams } from "react-router-dom";
|
|
||||||
import BasicWindow from "../../Components/BasicWindow";
|
import BasicWindow from "../../Components/BasicWindow";
|
||||||
import BackButton from "../../Components/BackButton";
|
import BackButton from "../../Components/BackButton";
|
||||||
|
import UserProjectMenu from "../../Components/UserProjectMenu";
|
||||||
|
|
||||||
function UserProjectPage(): JSX.Element {
|
function UserProjectPage(): JSX.Element {
|
||||||
const { projectName } = useParams();
|
|
||||||
|
|
||||||
const content = (
|
const content = (
|
||||||
<>
|
<>
|
||||||
<h1 className="font-bold text-[40px] mb-[20px]">{projectName}</h1>
|
<UserProjectMenu />
|
||||||
<div className="border-4 border-black bg-white flex flex-col items-center justify-center min-h-[65vh] h-fit w-[50vw] rounded-3xl content-center overflow-scroll space-y-[10vh] p-[30px]">
|
|
||||||
<Link to={`/timeReports/${projectName}/`}>
|
|
||||||
<h1 className="font-bold underline text-[30px] cursor-pointer">
|
|
||||||
Your Time Reports
|
|
||||||
</h1>
|
|
||||||
</Link>
|
|
||||||
<Link to={`/newTimeReport/${projectName}`}>
|
|
||||||
<h1 className="font-bold underline text-[30px] cursor-pointer">
|
|
||||||
New Time Report
|
|
||||||
</h1>
|
|
||||||
</Link>
|
|
||||||
</div>
|
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue