From ec9dbf57fd6ea8f290f776eccfe221006a921857 Mon Sep 17 00:00:00 2001
From: futreall <86553580+futreall@users.noreply.github.com>
Date: Sun, 8 Dec 2024 02:00:26 +0200
Subject: [PATCH] Optimized Banner Component (#1170)
stylistic improvements
---
libs/base-ui/components/Layout/Nav/Banner.tsx | 9 ++--
libs/base-ui/contexts/Analytics.tsx | 10 +++--
libs/base-ui/contexts/Experiments.tsx | 44 +++++++++----------
3 files changed, 32 insertions(+), 31 deletions(-)
diff --git a/libs/base-ui/components/Layout/Nav/Banner.tsx b/libs/base-ui/components/Layout/Nav/Banner.tsx
index ed2815c..021f10a 100644
--- a/libs/base-ui/components/Layout/Nav/Banner.tsx
+++ b/libs/base-ui/components/Layout/Nav/Banner.tsx
@@ -19,7 +19,10 @@ type BannerProps = {
};
export default function Banner({ href, text, bannerName }: BannerProps) {
- const [isBannerVisible, setIsBannerVisible] = useLocalStorage(`${bannerName}Visible`, true);
+ const [isBannerVisible, setIsBannerVisible] = useLocalStorage(
+ `${bannerName}Visible`,
+ true,
+ );
const pathname = usePathname();
const isOnPage = pathname === href.split('?')[0];
@@ -33,7 +36,7 @@ export default function Banner({ href, text, bannerName }: BannerProps) {
},
AnalyticsEventImportance.high,
);
- }, [logEvent, ActionType, ComponentType, AnalyticsEventImportance]);
+ }, [logEvent, ActionType, ComponentType, AnalyticsEventImportance, bannerName]);
const hideBanner = useCallback(() => {
setIsBannerVisible(false);
@@ -47,7 +50,7 @@ export default function Banner({ href, text, bannerName }: BannerProps) {
-
{text}
+
{text}