mirror of
https://github.com/hazemKrimi/personal-website.git
synced 2026-05-01 18:00:26 +00:00
Add click handler to card component
This commit is contained in:
+3
-2
@@ -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<Props> = ({ title, description, tags }) => {
|
||||
const Card: FC<Props> = ({ title, description, tags, onClick }) => {
|
||||
const { dark } = useContext(DarkModeContext);
|
||||
|
||||
return (
|
||||
<StyledCard dark={dark}>
|
||||
<StyledCard dark={dark} onClick={onClick}>
|
||||
<div>
|
||||
<h3>{title}</h3>
|
||||
<p>{description}</p>
|
||||
|
||||
Reference in New Issue
Block a user