Enhance Header and Layout components with new features and scripts
- Filtered out the Contact link from the main navigation in Header.astro and added a Contact icon that links to the contact page. - Integrated Rocket.Chat Livechat script into Layout.astro for improved user support interaction.
This commit is contained in:
@@ -68,9 +68,13 @@ if (!currentLang) {
|
||||
// Get translated header data - ensure we're using the current language
|
||||
const headerData = getHeaderData(currentLang);
|
||||
|
||||
// Filter out the Contact link for the main nav
|
||||
const navLinks = headerData.links.filter(link => link.text?.toLowerCase() !== 'contact');
|
||||
const contactLink = headerData.links.find(link => link.text?.toLowerCase() === 'contact');
|
||||
|
||||
const {
|
||||
id = 'header',
|
||||
links = headerData.links,
|
||||
links = navLinks,
|
||||
isSticky = false,
|
||||
isDark = false,
|
||||
isFullWidth = false,
|
||||
@@ -185,7 +189,13 @@ const {
|
||||
<div class="items-center flex justify-between w-full md:w-auto">
|
||||
<div class="flex items-center space-x-4">
|
||||
{showToggleTheme && <ToggleTheme iconClass="w-6 h-6 md:w-5 md:h-5 md:inline-block" />}
|
||||
<!-- Language Selector as Select Element -->
|
||||
{/* Contact Icon */}
|
||||
{contactLink && (
|
||||
<a href={contactLink.href} aria-label="Contact" title="Contact" class="hover:text-link dark:hover:text-white flex items-center">
|
||||
<Icon name="tabler:mail" class="w-6 h-6" />
|
||||
</a>
|
||||
)}
|
||||
{/* Language Selector as Select Element */}
|
||||
<LanguageDropdown currentLang={currentPath.split('/')[1] || 'en'} />
|
||||
</div>
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user