From 976553824a336fad687c535a0e98f6f889781441 Mon Sep 17 00:00:00 2001 From: corpulent Date: Thu, 28 Jul 2022 19:09:56 +0300 Subject: [PATCH] fix: preview block markup fixes --- .../src/components/Projects/PreviewBlock.tsx | 23 ++++++++++--------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/services/frontend/src/components/Projects/PreviewBlock.tsx b/services/frontend/src/components/Projects/PreviewBlock.tsx index 8b81916..79f4130 100644 --- a/services/frontend/src/components/Projects/PreviewBlock.tsx +++ b/services/frontend/src/components/Projects/PreviewBlock.tsx @@ -1,5 +1,5 @@ import { useState } from "react"; -import { Link } from "react-router-dom"; +import { Link, useNavigate } from "react-router-dom"; import { PencilIcon, TrashIcon } from "@heroicons/react/outline"; import { truncateStr } from "../../utils"; import { IProject } from "../../types"; @@ -15,6 +15,7 @@ const PreviewBlock = (props: IPreviewBlockProps) => { const [isHovering, setIsHovering] = useState(false); const [showDeleteConfirmModal, setShowDeleteConfirmModal] = useState(false); const mutation = useDeleteProject(project.uuid); + const navigate = useNavigate(); const handleMouseOver = () => { setIsHovering(true); @@ -24,7 +25,12 @@ const PreviewBlock = (props: IPreviewBlockProps) => { setIsHovering(false); }; - const onDelete = () => { + const handleClick = (e: any) => { + navigate(`/projects/${project.uuid}`); + }; + + const onDelete = (e: any) => { + e.stopPropagation(); setShowDeleteConfirmModal(true); }; @@ -37,8 +43,10 @@ const PreviewBlock = (props: IPreviewBlockProps) => {
{ flex items-center space-x-3 - hover:border-gray-400 + hover:bg-gray-200 `} >
{truncateStr(project.name, 25)}
@@ -57,18 +65,11 @@ const PreviewBlock = (props: IPreviewBlockProps) => { {isHovering && (
- - - -
)}