We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5b2bf82 commit b17821eCopy full SHA for b17821e
packages/gitbook/src/components/Announcement/AnnouncementDismissedScript.tsx
@@ -1,5 +1,6 @@
1
'use client';
2
3
+import * as React from 'react';
4
import {
5
ANNOUNCEMENT_CSS_CLASS,
6
ANNOUNCEMENT_DAYS_TILL_RESET,
@@ -18,6 +19,15 @@ export function AnnouncementDismissedScript() {
18
19
20
]).slice(1, -1);
21
22
+ // makes sure keeps the banner state when navigating between sites
23
+ React.useEffect(() => {
24
+ checkStorageForDismissedScript(
25
+ ANNOUNCEMENT_STORAGE_KEY,
26
+ ANNOUNCEMENT_DAYS_TILL_RESET,
27
+ ANNOUNCEMENT_CSS_CLASS
28
+ );
29
+ }, []);
30
+
31
return (
32
<script
33
suppressHydrationWarning
0 commit comments