Skip to content

Commit

Permalink
[DEV-1497] Fix homepage webinar banner visibility (#716)
Browse files Browse the repository at this point in the history
* fix banner visibility

* linte

---------

Co-authored-by: marcobottaro <[email protected]>
  • Loading branch information
tommaso1 and marcobottaro authored Mar 8, 2024
1 parent 0db977b commit 6d8f876
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/pretty-ears-work.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"nextjs-website": patch
---

Fix webinar banner visibility
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ const WebinarHeaderBanner: FC<WebinarHeaderBannerProps> = ({ 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);

Expand Down

0 comments on commit 6d8f876

Please sign in to comment.