From 690d0b30cff49ac371a5f3ac1cfdfc53cfbd7cbb Mon Sep 17 00:00:00 2001 From: Hazem Krimi Date: Thu, 14 Jan 2021 23:36:35 +0100 Subject: [PATCH] Add click handler to card component --- components/Card.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/components/Card.tsx b/components/Card.tsx index 709c17f..18f65d1 100644 --- a/components/Card.tsx +++ b/components/Card.tsx @@ -6,6 +6,7 @@ interface Props { title: string; description: string; tags?: string[]; + onClick?: () => void; } const StyledCard = styled.div<{ dark: boolean }>` @@ -44,11 +45,11 @@ const StyledCard = styled.div<{ dark: boolean }>` } `; -const Card: FC = ({ title, description, tags }) => { +const Card: FC = ({ title, description, tags, onClick }) => { const { dark } = useContext(DarkModeContext); return ( - +

{title}

{description}