Gets all project members and displays them properly now
This commit is contained in:
parent
bca12151b7
commit
9b30b82237
1 changed files with 14 additions and 1 deletions
|
@ -1,10 +1,15 @@
|
||||||
|
import { useState } from "react";
|
||||||
import Button from "./Button";
|
import Button from "./Button";
|
||||||
|
import { UserProjectMember } from "../Types/goTypes";
|
||||||
|
import GetUsersInProject from "./GetUsersInProject";
|
||||||
|
|
||||||
function UserInfoModal(props: {
|
function UserInfoModal(props: {
|
||||||
isVisible: boolean;
|
isVisible: boolean;
|
||||||
projectname: string;
|
projectname: string;
|
||||||
onClose: () => void;
|
onClose: () => void;
|
||||||
}): JSX.Element {
|
}): JSX.Element {
|
||||||
|
const [users, setUsers] = useState<UserProjectMember[]>([]);
|
||||||
|
GetUsersInProject({ projectName: props.projectname, setUsersProp: setUsers });
|
||||||
if (!props.isVisible) return <></>;
|
if (!props.isVisible) return <></>;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
@ -18,7 +23,15 @@ function UserInfoModal(props: {
|
||||||
<h2 className="font-bold text-[22px] mb-[20px]">
|
<h2 className="font-bold text-[22px] mb-[20px]">
|
||||||
Members of this project:
|
Members of this project:
|
||||||
</h2>
|
</h2>
|
||||||
<div className="pr-6 pl-6">{/*Show all members in project*/}</div>
|
<div className="border-2 border-black bg-white p-2 rounded-lg text-center pl-6 pr-6">
|
||||||
|
<ul>
|
||||||
|
{users.map((user) => (
|
||||||
|
<li key={user.Username}>
|
||||||
|
<span>{user.Username}</span>
|
||||||
|
</li>
|
||||||
|
))}
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="items-center space-x-6 pr-6 pl-6">
|
<div className="items-center space-x-6 pr-6 pl-6">
|
||||||
<Button
|
<Button
|
||||||
|
|
Loading…
Reference in a new issue