Minor design and import changes

This commit is contained in:
Peter KW 2024-04-13 21:10:37 +02:00
parent bcac9c020e
commit 0e2b62f5ba
4 changed files with 10 additions and 6 deletions

View file

@ -22,10 +22,12 @@ export function ProjectListAdmin(props: {
const [projectName, setProjectName] = useState(""); const [projectName, setProjectName] = useState("");
const [userModalVisible, setUserModalVisible] = useState(false); const [userModalVisible, setUserModalVisible] = useState(false);
const [username, setUsername] = useState(""); const [username, setUsername] = useState("");
const [userRole, setUserRole] = useState("");
const [search, setSearch] = useState(""); const [search, setSearch] = useState("");
const handleClickUser = (username: string): void => { const handleClickUser = (username: string, userRole: string): void => {
setUsername(username); setUsername(username);
setUserRole(userRole);
setUserModalVisible(true); setUserModalVisible(true);
}; };
@ -41,6 +43,7 @@ export function ProjectListAdmin(props: {
const handleCloseUser = (): void => { const handleCloseUser = (): void => {
setUsername(""); setUsername("");
setUserRole("");
setUserModalVisible(false); setUserModalVisible(false);
}; };
@ -59,6 +62,7 @@ export function ProjectListAdmin(props: {
onClose={handleCloseUser} onClose={handleCloseUser}
username={username} username={username}
projectName={projectName} projectName={projectName}
role={userRole}
/> />
)} )}
<div> <div>
@ -70,7 +74,7 @@ export function ProjectListAdmin(props: {
setSearch(e.target.value); setSearch(e.target.value);
}} }}
/> />
<ul className="mt-3 border-2 text-left border-black rounded-2xl px-2 divide-y divide-gray-300 font-semibold text-[30px] cursor-pointer overflow-auto h-[65vh] w-[50vw]"> <ul className="mt-3 border-2 text-left border-black rounded-2xl px-2 divide-y divide-gray-300 font-semibold text-[30px] cursor-pointer overflow-auto h-[60vh] w-[40vw]">
{props.projects {props.projects
.filter((project) => { .filter((project) => {
return search.toLowerCase() === "" return search.toLowerCase() === ""

View file

@ -45,7 +45,7 @@ export function UserListAdmin(props: { users: string[] }): JSX.Element {
setSearch(e.target.value); setSearch(e.target.value);
}} }}
/> />
<ul className="mt-3 border-2 text-left border-black rounded-2xl px-2 divide-y divide-gray-300 font-semibold text-[30px] transition-all cursor-pointer overflow-auto h-[65vh] w-[50vw]"> <ul className="mt-3 border-2 text-left border-black rounded-2xl px-2 divide-y divide-gray-300 font-semibold text-[30px] transition-all cursor-pointer overflow-auto h-[60vh] w-[40vw]">
{props.users {props.users
.filter((user) => { .filter((user) => {
return search.toLowerCase() === "" return search.toLowerCase() === ""

View file

@ -8,7 +8,7 @@ function UserProjectListAdmin(props: { username: string }): JSX.Element {
GetProjects({ setProjectsProp: setProjects, username: props.username }); GetProjects({ setProjectsProp: setProjects, username: props.username });
return ( return (
<div className="border-2 border-black bg-white rounded-lg text-left overflow-auto h-[15vh] font-medium"> <div className="border-2 border-black bg-white rounded-2xl text-left overflow-auto h-[15vh] font-medium">
<ul className="divide-y-2"> <ul className="divide-y-2">
{projects.map((project) => ( {projects.map((project) => (
<li className="mx-2 my-1" key={project.id}> <li className="mx-2 my-1" key={project.id}>

View file

@ -1,11 +1,11 @@
import { Link } from "react-router-dom"; import { Link } from "react-router-dom";
import BackButton from "../../Components/BackButton";
import BasicWindow from "../../Components/BasicWindow"; import BasicWindow from "../../Components/BasicWindow";
import Button from "../../Components/Button"; import Button from "../../Components/Button";
import { ProjectListAdmin } from "../../Components/ProjectListAdmin"; import { ProjectListAdmin } from "../../Components/ProjectListAdmin";
import { Project } from "../../Types/goTypes"; import { Project } from "../../Types/goTypes";
import GetProjects from "../../Components/GetProjects"; import GetProjects from "../../Components/GetProjects";
import { useState } from "react"; import { useState } from "react";
import NavButton from "../../Components/NavButton";
function AdminManageProjects(): JSX.Element { function AdminManageProjects(): JSX.Element {
const [projects, setProjects] = useState<Project[]>([]); const [projects, setProjects] = useState<Project[]>([]);
@ -26,7 +26,7 @@ function AdminManageProjects(): JSX.Element {
type="button" type="button"
/> />
</Link> </Link>
<BackButton /> <NavButton navTo="/admin" label={"Back"} />
</> </>
); );