From d3bb6f49e5d597b7c73816de2cbffd54dd766978 Mon Sep 17 00:00:00 2001 From: Mattias Date: Wed, 20 Mar 2024 13:51:49 +0100 Subject: [PATCH] New comp changeRoles --- frontend/src/Components/ChangeRoles.tsx | 83 +++++++++++++++++++ .../ProjectManagerPages/PMChangeRole.tsx | 15 ++-- 2 files changed, 89 insertions(+), 9 deletions(-) create mode 100644 frontend/src/Components/ChangeRoles.tsx diff --git a/frontend/src/Components/ChangeRoles.tsx b/frontend/src/Components/ChangeRoles.tsx new file mode 100644 index 0000000..e11d623 --- /dev/null +++ b/frontend/src/Components/ChangeRoles.tsx @@ -0,0 +1,83 @@ +import { useState } from "react"; +import { useParams } from "react-router-dom"; +import Button from "./Button"; + +export default function ChangeRoles(): JSX.Element { + const [selectedRole, setSelectedRole] = useState(""); + const { username } = useParams(); + + const handleRoleChange = ( + event: React.ChangeEvent, + ): void => { + setSelectedRole(event.target.value); + }; + + // const handleSubmit = async (event: React.FormEvent) => { + // event.preventDefault(); + + // const response = await api.changeRole(username, selectedRole, token); + // if (response.success) { + // console.log("Role changed successfully"); + // } else { + // console.error("Failed to change role:", response.message); + // } + // }; + + return ( + <> +

+ Change roll for: {username} +

+
+
+
+ +
+
+ +
+
+ +
+
+