diff --git a/packages/frontend/src/components/projects/ProjectCard/ProjectCard.tsx b/packages/frontend/src/components/projects/ProjectCard/ProjectCard.tsx index 85603037..83aba24e 100644 --- a/packages/frontend/src/components/projects/ProjectCard/ProjectCard.tsx +++ b/packages/frontend/src/components/projects/ProjectCard/ProjectCard.tsx @@ -1,4 +1,8 @@ -import React, { ComponentPropsWithoutRef, MouseEvent } from 'react'; +import React, { + ComponentPropsWithoutRef, + MouseEvent, + useCallback, +} from 'react'; import { ProjectCardTheme, projectCardTheme } from './ProjectCard.theme'; import { Project } from 'gql-client'; import { Button } from 'components/shared/Button'; @@ -11,7 +15,7 @@ import { WarningDiamondIcon, } from 'components/shared/CustomIcon'; import { relativeTimeMs } from 'utils/time'; -import { Link } from 'react-router-dom'; +import { useNavigate } from 'react-router-dom'; import { Avatar } from 'components/shared/Avatar'; import { getInitials } from 'utils/geInitials'; import { @@ -38,14 +42,24 @@ export const ProjectCard = ({ // TODO: Update this to use the actual status from the API const hasError = status === 'failure'; + const navigate = useNavigate(); + const handleOptionsClick = ( e: MouseEvent, ) => { e.stopPropagation(); }; + const handleClick = useCallback(() => { + navigate(`projects/${project.id}`); + }, [project.id, navigate]); + return ( -
+
{/* Upper content */}
{/* Icon container */} @@ -54,14 +68,13 @@ export const ProjectCard = ({ imageSrc={project.icon} initials={getInitials(project.name)} /> - {/*
*/} {/* Title and website */} - +

{project.name}

{project.deployments[0]?.domain?.name ?? 'No domain'}

- +
{/* Icons */}
{hasError && }