From 6d8f876d715ad6863272e763262c3bdfc4c4be23 Mon Sep 17 00:00:00 2001 From: tommaso1 Date: Fri, 8 Mar 2024 18:40:43 +0100 Subject: [PATCH] [DEV-1497] Fix homepage webinar banner visibility (#716) * fix banner visibility * linte --------- Co-authored-by: marcobottaro <39835990+marcobottaro@users.noreply.github.com> --- .changeset/pretty-ears-work.md | 5 +++++ .../atoms/WebinarHeaderBanner/WebinarHeaderBanner.tsx | 3 +-- 2 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 .changeset/pretty-ears-work.md diff --git a/.changeset/pretty-ears-work.md b/.changeset/pretty-ears-work.md new file mode 100644 index 000000000..c94c06a45 --- /dev/null +++ b/.changeset/pretty-ears-work.md @@ -0,0 +1,5 @@ +--- +"nextjs-website": patch +--- + +Fix webinar banner visibility diff --git a/apps/nextjs-website/src/components/atoms/WebinarHeaderBanner/WebinarHeaderBanner.tsx b/apps/nextjs-website/src/components/atoms/WebinarHeaderBanner/WebinarHeaderBanner.tsx index 604dbb898..6b44f1f0d 100644 --- a/apps/nextjs-website/src/components/atoms/WebinarHeaderBanner/WebinarHeaderBanner.tsx +++ b/apps/nextjs-website/src/components/atoms/WebinarHeaderBanner/WebinarHeaderBanner.tsx @@ -24,8 +24,7 @@ const WebinarHeaderBanner: FC = ({ webinars }) => { endDateTime && new Date(endDateTime).getTime() > new Date().getTime() ); const { slug, title: text, endDateTime } = webinar || {}; - const storedDateTime = - (slug && window?.localStorage.getItem(slug)) || new Date().toISOString(); + const storedDateTime = slug && window?.localStorage.getItem(slug); const shouldShow = !storedDateTime || new Date(storedDateTime) < new Date(); const [visible, setVisible] = useState(shouldShow);