Modul for viewing user info in admin manage users page
This commit is contained in:
parent
db4f869712
commit
a0759b099a
1 changed files with 46 additions and 0 deletions
46
frontend/src/Components/UserInfoModal.tsx
Normal file
46
frontend/src/Components/UserInfoModal.tsx
Normal file
|
@ -0,0 +1,46 @@
|
|||
import Button from "./Button";
|
||||
import DeleteUser from "./DeleteUser";
|
||||
import UserProjectListAdmin from "./UserProjectListAdmin";
|
||||
|
||||
function UserInfoModal(props: {
|
||||
isVisible: boolean;
|
||||
username: string;
|
||||
onClose: () => void;
|
||||
}): JSX.Element {
|
||||
if (!props.isVisible) return <></>;
|
||||
|
||||
return (
|
||||
<div
|
||||
className="fixed inset-0 bg-black bg-opacity-30 backdrop-blur-sm
|
||||
flex justify-center items-center"
|
||||
>
|
||||
<div className="border-4 border-black bg-white p-2 rounded-lg text-center">
|
||||
<h1 className="font-bold text-[30px] mb-[20px]">{props.username}</h1>
|
||||
<div>
|
||||
<h2 className="font-bold text-[22px] mb-[20px]">
|
||||
Member of these projects:
|
||||
</h2>
|
||||
<UserProjectListAdmin username={props.username} />
|
||||
</div>
|
||||
<div className="items-center space-x-6 pr-6 pl-6">
|
||||
<Button
|
||||
text={"Delete"}
|
||||
onClick={function (): void {
|
||||
DeleteUser({ usernameToDelete: props.username });
|
||||
}}
|
||||
type="button"
|
||||
/>
|
||||
<Button
|
||||
text={"Close"}
|
||||
onClick={function (): void {
|
||||
props.onClose();
|
||||
}}
|
||||
type="button"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export default UserInfoModal;
|
Loading…
Reference in a new issue