Skip to content

Commit 2ba78c1

Browse files
committed
Fix announcement bar
1 parent 6a8d3c6 commit 2ba78c1

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/partials/head.hbs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,13 @@
3434
document.documentElement.setAttribute('data-theme', initialTheme);
3535
3636
document.addEventListener('DOMContentLoaded', function() {
37-
handleBanner('announcement-bar', 'announcementClosed');
37+
handleBanner('announcement', 'announcementClosed');
3838
handleBanner('bloblang-banner', 'bloblangBannerDismissed');
3939
});
4040
// This script and the styles must be in the head to avoid flashing when the default white background changes to dark https://github.com/redpanda-data/docs-ui/pull/174
4141
window.addEventListener('DOMContentLoaded', function() {
4242
const switchButton = document.getElementById('switch-theme');
43-
const announcementBar = document.querySelector('.announcement-bar');
43+
const announcementBar = document.getElementById('announcement');
4444
if (switchButton) {
4545
setTheme(initialTheme); // Apply initial theme on load
4646
switchButton.addEventListener('click', function() {
@@ -52,6 +52,7 @@
5252
});
5353
}
5454
if (!announcementBar) return;
55+
const hasSeenAnnouncement = window.sessionStorage.getItem('announcementClosed') || window.localStorage.getItem('announcementClosed') || false;
5556
if (!hasSeenAnnouncement) {
5657
document.documentElement.style.setProperty('--announcement-bar-height', '50px');
5758
document.documentElement.style.setProperty('--announcement-bar-height--desktop', '30px');

0 commit comments

Comments
 (0)