File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change 1+ import { basePath } from "../../../metadata" ;
12import { Translation } from "../../../translation/" ;
23import { InfoCircleIcon } from "../../icons" ;
34
45export const SiteNoticeBanner = ( ) => {
6+ const storageKey = `typst-docs-web${ basePath . replace ( / \/ / g, "-" ) } banner-hidden` ;
57 return (
68 < div
7- x-data = " {
9+ x-data = { ` {
810 bannerVisible: false,
911 bannerVisibleAfter: 300,
1012 checkBannerStatus() {
11- const isBannerHidden = localStorage.getItem('typst-jp-banner-hidden ') === 'true';
13+ const isBannerHidden = localStorage.getItem('${ storageKey } ') === 'true';
1214 if (!isBannerHidden) {
1315 setTimeout(() => {
1416 this.bannerVisible = true;
@@ -18,9 +20,9 @@ export const SiteNoticeBanner = () => {
1820 },
1921 hideBanner() {
2022 this.bannerVisible = false;
21- localStorage.setItem('typst-jp-banner-hidden ', 'true');
23+ localStorage.setItem('${ storageKey } ', 'true');
2224 }
23- }"
25+ }` }
2426 x-init = "checkBannerStatus()"
2527 x-show = "bannerVisible"
2628 x-transition :enter = "transition ease-out duration-500"
You can’t perform that action at this time.
0 commit comments