Highlight support if on support page
This commit is contained in:
parent
9b2963f886
commit
4b60ff664a
1 changed files with 15 additions and 3 deletions
|
@ -14,12 +14,20 @@ import { useUserAgent } from "astro-useragent"
|
|||
const uaString = Astro.request.headers.get("user-agent")
|
||||
const { source, isMobile } = useUserAgent(uaString)
|
||||
|
||||
// Check if user is on Support
|
||||
if (Astro.url.pathname.startsWith("/support")) {
|
||||
var IsOnSupport = true
|
||||
} else {
|
||||
var IsOnSupport = false
|
||||
}
|
||||
|
||||
// Properties - Selected
|
||||
if (Selected === "Home") {var Select_Home = true}
|
||||
else if (Selected === "Products") {var Select_Products = true}
|
||||
else if (Selected === "Pricing") {var Select_Pricing = true}
|
||||
else if (Selected === "Support") {var Select_Support = true}
|
||||
|
||||
import Default from '@astrojs/starlight/components/Search.astro';
|
||||
---
|
||||
|
||||
<header>
|
||||
|
@ -36,14 +44,18 @@ else if (Selected === "Support") {var Select_Support = true}
|
|||
<div class="header-center">
|
||||
<a id="menu-link-home" href="/">{t("Header.Home")}</a>
|
||||
<a id="menu-link-products" href="#">{t("Header.Products")}</a>
|
||||
<a id="menu-link-pricing" href="#">{t("Header.Pricing")}</a>
|
||||
<a id="menu-link-support" href="#">{t("Header.Support")}</a>
|
||||
<a id="menu-link-pricing" href="/pricing">{t("Header.Pricing")}</a>
|
||||
{IsOnSupport ?
|
||||
<a style="background: white; color: black;" id="menu-link-support" href="/support">{t("Header.Support")}</a>
|
||||
:
|
||||
<a id="menu-link-support" href="/support">{t("Header.Support")}</a>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
<div class="header-end">
|
||||
<a href="#">{t("Header.Login")}</a>
|
||||
<a href="#">{t("Header.SignUp")}</a>
|
||||
<sl-dropdown placement="bottom-end" distance="6">
|
||||
<sl-dropdown id="lang-menu" placement="bottom-end" distance="6">
|
||||
<sl-button slot="trigger" caret><Language/></sl-button>
|
||||
<sl-menu>
|
||||
<sl-menu-item onclick="location.href = '/'">English</sl-menu-item>
|
||||
|
|
Reference in a new issue