fix: apply announcement bar class if only needed (#5699)

This commit is contained in:
Alexey Pyltsyn 2021-10-14 12:10:59 +03:00 committed by GitHub
parent 54015de628
commit fee10c9e13
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 19 additions and 21 deletions

View file

@ -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]);