Skip to content

Commit

Permalink
✨Feat: Enable clicking the background
Browse files Browse the repository at this point in the history
  • Loading branch information
0xwonj committed Sep 10, 2023
1 parent d6a6f3b commit 4e579ff
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/components/announcements/Announcement.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,18 @@ export const Announcement: FunctionComponent<AnnouncementProps> = ({
date,
link,
}) => {
const handleOnClick = () => {
if (link) {
window.location.href = link;
}
};

return (
<div className={clsx(styles.announcementRow)}>
<div
className={clsx(styles.announcementRow)}
onClick={handleOnClick}
style={{ cursor: link ? "pointer" : "default" }}
>
<span className={clsx(styles.announcementText)}>
{link ? <a href={link}>{text}</a> : text}
</span>
Expand Down

0 comments on commit 4e579ff

Please sign in to comment.