Adding comments to PMProjectMenu, UserInfoModal, UserProjectListAdmin, UserProjectMenu

This commit is contained in:
Johanna 2024-03-21 00:49:56 +01:00
parent 4c5c4f2189
commit f43ad10dd9
4 changed files with 20 additions and 3 deletions

View file

@ -1,6 +1,11 @@
import { Link, useParams } from "react-router-dom";
import { JSX } from "react/jsx-runtime";
/**
* Handles the rendering of the PM Project Menu.
* @param {string} projectName - The name of the project.
* @returns {JSX.Element} The JSX element representing the PM Project Menu.
*/
function PMProjectMenu(): JSX.Element {
const { projectName } = useParams();
return (

View file

@ -3,6 +3,14 @@ import Button from "./Button";
import DeleteUser from "./DeleteUser";
import UserProjectListAdmin from "./UserProjectListAdmin";
/**
* Component representing a modal to display user information.
* @param {object} props - Component properties.
* @param {boolean} props.isVisible - Determines if the modal is visible.
* @param {string} props.username - The username to display.
* @param {() => void} props.onClose - Function to handle closing the modal.
* @returns {JSX.Element} The JSX element representing the UserInfoModal.
*/
function UserInfoModal(props: {
isVisible: boolean;
username: string;

View file

@ -2,6 +2,10 @@ import { useEffect, useState } from "react";
import { api } from "../API/API";
import { Project } from "../Types/goTypes";
/**
* Component for displaying a list of projects associated with the current user.
* @returns {JSX.Element} The JSX element representing the UserProjectListAdmin component.
*/
function UserProjectListAdmin(): JSX.Element {
const [projects, setProjects] = useState<Project[]>([]);

View file

@ -4,9 +4,9 @@ import { useParams, Link } from "react-router-dom";
import { JSX } from "react/jsx-runtime";
/**
* Renders the user project menu component.
*
* @returns JSX.Element representing the user project menu.
* Renders the menu for a specific project for the user.
* It provides options to view existing time reports and create new ones.
* @returns {JSX.Element} The JSX element representing the user project menu.
*/
function UserProjectMenu(): JSX.Element {
const { projectName } = useParams();