From 4ff1b3c19f07117c0a7e36f24dd7a38f9c336dca Mon Sep 17 00:00:00 2001 From: Mauricio Siu <47042324+Siumauricio@users.noreply.github.com> Date: Thu, 27 Jun 2024 23:04:12 -0600 Subject: [PATCH] refactor(#168): make project card be clickable everywhere --- components/dashboard/projects/show.tsx | 217 +++++++++++++------------ 1 file changed, 113 insertions(+), 104 deletions(-) diff --git a/components/dashboard/projects/show.tsx b/components/dashboard/projects/show.tsx index 124a447d1..8df235833 100644 --- a/components/dashboard/projects/show.tsx +++ b/components/dashboard/projects/show.tsx @@ -76,8 +76,8 @@ export const ShowProjects = () => { project?.compose.length; return (
- - + + - - - - -
- - - {project.name} - -
+ + + +
+ + + {project.name} + +
- - {project.description} + + {project.description} + -
-
- - - - - - - Actions - +
+ + + + + + + Actions + - +
e.stopPropagation()}> + +
- {(auth?.rol === "admin" || - user?.canDeleteProjects) && ( - - - e.preventDefault()} - > - - Delete - - - - - - Are you sure to delete this project? - - {!emptyServices ? ( -
- - - You have active services, please delete - them first - -
- ) : ( - - This action cannot be undone - - )} -
- - Cancel - { - await mutateAsync({ - projectId: project.projectId, - }) - .then(() => { - toast.success( - "Project delete succesfully", - ); - }) - .catch(() => { - toast.error( - "Error to delete this project", - ); - }) - .finally(() => { - utils.project.all.invalidate(); - }); - }} - > - Delete - - -
-
- )} -
-
+
e.stopPropagation()}> + {(auth?.rol === "admin" || + user?.canDeleteProjects) && ( + + + e.preventDefault()} + > + + Delete + + + + + + Are you sure to delete this project? + + {!emptyServices ? ( +
+ + + You have active services, please + delete them first + +
+ ) : ( + + This action cannot be undone + + )} +
+ + + Cancel + + { + await mutateAsync({ + projectId: project.projectId, + }) + .then(() => { + toast.success( + "Project delete succesfully", + ); + }) + .catch(() => { + toast.error( + "Error to delete this project", + ); + }) + .finally(() => { + utils.project.all.invalidate(); + }); + }} + > + Delete + + +
+
+ )} +
+ + +
+ + + +
+ + Created + + + {totalServices}{" "} + {totalServices === 1 ? "service" : "services"} +
- - - -
- Created - - {totalServices}{" "} - {totalServices === 1 ? "service" : "services"} - -
-
- +
+ +
); })}