Add ProjectNameContext to NewWeeklyReport and handle project selection in YourProjectsPage
This commit is contained in:
parent
164ff781b3
commit
3f8d56963b
2 changed files with 23 additions and 5 deletions
|
|
@ -3,6 +3,7 @@ import { NewWeeklyReport } from "../Types/goTypes";
|
|||
import { api } from "../API/API";
|
||||
import { useNavigate } from "react-router-dom";
|
||||
import Button from "./Button";
|
||||
import { ProjectNameContext } from "../Pages/YourProjectsPage";
|
||||
|
||||
export default function NewWeeklyReport(): JSX.Element {
|
||||
const [week, setWeek] = useState(0);
|
||||
|
|
@ -13,7 +14,7 @@ export default function NewWeeklyReport(): JSX.Element {
|
|||
const [studyTime, setStudyTime] = useState(0);
|
||||
const [testingTime, setTestingTime] = useState(0);
|
||||
|
||||
// const projectName = useContext(projectNameContext);
|
||||
const projectName = useContext(ProjectNameContext);
|
||||
const token = localStorage.getItem("accessToken") ?? "";
|
||||
|
||||
const handleNewWeeklyReport = async (): Promise<void> => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue