From f953e2af406512bdbc379a41ee62321d09fc4710 Mon Sep 17 00:00:00 2001 From: Martin Date: Mon, 29 Jan 2024 15:52:15 +0100 Subject: [PATCH] Remove current event --- components/sections/EventPopup.tsx | 9 +++++++-- data/pages/index.json | 5 ----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/components/sections/EventPopup.tsx b/components/sections/EventPopup.tsx index a219dfb..62cb635 100644 --- a/components/sections/EventPopup.tsx +++ b/components/sections/EventPopup.tsx @@ -5,7 +5,7 @@ import { useState } from "react"; import { cx } from "utils"; type EventPopupType = { - image: { + image?: { src: string; alt: string; }; @@ -13,7 +13,7 @@ type EventPopupType = { href: string; title: string; }; - title: string; + title?: string; content?: string; }; @@ -33,6 +33,11 @@ const EventPopup = ({ image, title, content, cta }: EventPopupType) => { return null; } + // if image, title are null, return null + if (!image || !title) { + return null; + } + return ( " - }, - "image": { - "src": "/assets/event-community_call-jan.png", - "alt": "" } }, "hero": {