Add Button component to OtherUsersTR and update route path in main.tsx to include signedOrUnsigned parameter
This commit is contained in:
parent
f61449dea1
commit
b56e4ed76e
1 changed files with 12 additions and 0 deletions
|
@ -2,6 +2,7 @@ import { useState, useEffect } from "react";
|
|||
import { WeeklyReport } from "../Types/goTypes";
|
||||
import { api } from "../API/API";
|
||||
import { useParams } from "react-router-dom";
|
||||
import Button from "./Button";
|
||||
|
||||
/**
|
||||
* Renders the component for editing a weekly report.
|
||||
|
@ -22,6 +23,8 @@ export default function OtherUsersTR(): JSX.Element {
|
|||
const { projectName } = useParams();
|
||||
const { username } = useParams();
|
||||
const { fetchedWeek } = useParams();
|
||||
const { signedOrUnsigned } = useParams();
|
||||
console.log(projectName, username, fetchedWeek, signedOrUnsigned);
|
||||
|
||||
useEffect(() => {
|
||||
const fetchUsersWeeklyReport = async (): Promise<void> => {
|
||||
|
@ -153,6 +156,15 @@ export default function OtherUsersTR(): JSX.Element {
|
|||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
{signedOrUnsigned === "signed" && (
|
||||
<Button
|
||||
text="Unsign Report"
|
||||
onClick={(): void => {
|
||||
return;
|
||||
}}
|
||||
type="submit"
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</>
|
||||
|
|
Loading…
Reference in a new issue