From 843691c30089b67c2b70ef99c1fa41c8112b78ca Mon Sep 17 00:00:00 2001 From: Alejandro <95312462+AGMASO@users.noreply.github.com> Date: Wed, 29 Oct 2025 10:42:14 +0100 Subject: [PATCH] fix: banner onclick on mobile now links to the desired route --- src/layouts/TopBarNotify.tsx | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/layouts/TopBarNotify.tsx b/src/layouts/TopBarNotify.tsx index 8f4ef2673d..aaf4ddc88c 100644 --- a/src/layouts/TopBarNotify.tsx +++ b/src/layouts/TopBarNotify.tsx @@ -64,6 +64,8 @@ export default function TopBarNotify({ campaigns }: TopBarNotifyProps) { return warningBarOpen !== 'false'; }); + const isBannerClickable = sm && Boolean(currentCampaign?.buttonAction); + useEffect(() => { if (!currentCampaign) return; @@ -113,6 +115,11 @@ export default function TopBarNotify({ campaigns }: TopBarNotifyProps) { } }; + const handleBannerClick = () => { + if (!isBannerClickable) return; + handleButtonAction(); + }; + // Note: hide warnings when mobile menu is open if (mobileDrawerOpen) return null; @@ -137,7 +144,9 @@ export default function TopBarNotify({ campaigns }: TopBarNotifyProps) { justifyContent: 'center', alignItems: 'center', width: '100%', + cursor: isBannerClickable ? 'pointer' : 'default', }} + onClick={handleBannerClick} variant="dense" > @@ -155,7 +164,7 @@ export default function TopBarNotify({ campaigns }: TopBarNotifyProps) { '' )} - {currentCampaign.learnMoreLink && md ? ( + {md && currentCampaign.learnMoreLink && !isBannerClickable ? ( typeof currentCampaign.learnMoreLink === 'string' ? ( - {!md && currentCampaign.buttonText && currentCampaign.buttonAction ? ( + {!sm && currentCampaign.buttonText && currentCampaign.buttonAction ? (