From 67f2b57f00216ded3b34965629d6fdd2f16bc25f Mon Sep 17 00:00:00 2001 From: sct Date: Mon, 4 Jan 2021 16:40:39 +0000 Subject: [PATCH] fix(frontend): apply same titlecard hover effect to personcard --- src/components/PersonCard/index.tsx | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/src/components/PersonCard/index.tsx b/src/components/PersonCard/index.tsx index 592ab445d..ce4469202 100644 --- a/src/components/PersonCard/index.tsx +++ b/src/components/PersonCard/index.tsx @@ -1,5 +1,5 @@ import Link from 'next/link'; -import React from 'react'; +import React, { useState } from 'react'; interface PersonCardProps { personId: number; @@ -16,13 +16,30 @@ const PersonCard: React.FC = ({ profilePath, canExpand = false, }) => { + const [isHovered, setHovered] = useState(false); + return ( - + { + setHovered(true); + }} + onMouseLeave={() => setHovered(false)} + onKeyDown={(e) => { + if (e.key === 'Enter') { + setHovered(true); + } + }} + role="link" + tabIndex={0} + >