From ff6ea9611ef92128b620180bb3184f9eb388518d Mon Sep 17 00:00:00 2001 From: akcodez Date: Mon, 17 Jun 2024 15:29:33 -0700 Subject: [PATCH] fix alert banner show / hide logic, hide apex banner --- @theme/components/Navbar/Navbar.tsx | 41 ++++++++++++++++------------- 1 file changed, 23 insertions(+), 18 deletions(-) diff --git a/@theme/components/Navbar/Navbar.tsx b/@theme/components/Navbar/Navbar.tsx index 924029d944..ea4fd2878b 100644 --- a/@theme/components/Navbar/Navbar.tsx +++ b/@theme/components/Navbar/Navbar.tsx @@ -11,7 +11,7 @@ import { Search } from "@theme/components/Search/Search"; // @ts-ignore const alertBanner = { - show: true, + show: false, message: "XRP Ledger Apex is back in Amsterdam", button: "Register Now", link: "https://www.xrpledgerapex.com/?utm_source=email&utm_medium=email_marketing&utm_campaign=EVENTS_XRPL_Apex_2024_Q2&utm_term=events_page_cta_button", @@ -92,7 +92,7 @@ export function Navbar(props) { button={alertBanner.button} link={alertBanner.link} /> - + @@ -121,21 +121,24 @@ const StyledColorModeSwitcher = styled(ColorModeSwitcher)` `; export function AlertBanner(props) { - const { message, button, link } = props; - return ( -
-
- -

{message}

-
- - - {button} - - + const { message, button, link, show } = props; + if (show) { + return ( +
+
+ +

{message}

+
+ + + {button} + + +
-
- ); + ); + } + return null; } export function TopNavCollapsible(props) { @@ -174,7 +177,9 @@ export function NavDropdown(props) { return (
-
{translate(item.labelTranslationKey, item.label)}
+
+ {translate(item.labelTranslationKey, item.label)} +
{groupLinks}
); @@ -187,7 +192,7 @@ export function NavDropdown(props) { hero_href = pathPrefix + hero_href; } const splitlabel = item.label.split(" || "); - let splittranslationkey = ["",""] + let splittranslationkey = ["", ""]; if (item.labelTranslationKey) { splittranslationkey = item.labelTranslationKey.split(" || "); }