mirror of
https://github.com/facebook/docusaurus.git
synced 2025-06-02 02:42:41 +02:00
fix: apply announcement bar class if only needed (#5699)
This commit is contained in:
parent
54015de628
commit
fee10c9e13
4 changed files with 19 additions and 21 deletions
|
@ -33,7 +33,7 @@ const setDismissedInStorage = (bool: boolean) =>
|
|||
AnnouncementBarDismissStorage.set(String(bool));
|
||||
|
||||
type AnnouncementBarAPI = {
|
||||
readonly isClosed: boolean;
|
||||
readonly isActive: boolean;
|
||||
readonly close: () => void;
|
||||
};
|
||||
|
||||
|
@ -87,7 +87,7 @@ const useAnnouncementBarContextValue = (): AnnouncementBarAPI => {
|
|||
|
||||
return useMemo(() => {
|
||||
return {
|
||||
isClosed,
|
||||
isActive: !!announcementBar && !isClosed,
|
||||
close: handleClose,
|
||||
};
|
||||
}, [isClosed]);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue