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
|
// Get translated header data - ensure we're using the current language
|
||||||
const headerData = getHeaderData(currentLang);
|
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 {
|
const {
|
||||||
id = 'header',
|
id = 'header',
|
||||||
links = headerData.links,
|
links = navLinks,
|
||||||
isSticky = false,
|
isSticky = false,
|
||||||
isDark = false,
|
isDark = false,
|
||||||
isFullWidth = false,
|
isFullWidth = false,
|
||||||
@@ -185,7 +189,13 @@ const {
|
|||||||
<div class="items-center flex justify-between w-full md:w-auto">
|
<div class="items-center flex justify-between w-full md:w-auto">
|
||||||
<div class="flex items-center space-x-4">
|
<div class="flex items-center space-x-4">
|
||||||
{showToggleTheme && <ToggleTheme iconClass="w-6 h-6 md:w-5 md:h-5 md:inline-block" />}
|
{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'} />
|
<LanguageDropdown currentLang={currentPath.split('/')[1] || 'en'} />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@@ -73,5 +73,15 @@ const { language, textDirection } = I18N;
|
|||||||
<LanguagePersistence />
|
<LanguagePersistence />
|
||||||
<CookieBanner />
|
<CookieBanner />
|
||||||
<BackToTop />
|
<BackToTop />
|
||||||
|
<!-- Start of Rocket.Chat Livechat Script -->
|
||||||
|
<script type="text/javascript">
|
||||||
|
(function(w, d, s, u) {
|
||||||
|
w.RocketChat = function(c) { w.RocketChat._.push(c) }; w.RocketChat._ = []; w.RocketChat.url = u;
|
||||||
|
const h = d.getElementsByTagName(s)[0], j = d.createElement(s);
|
||||||
|
j.async = true; j.src = 'https://chat.365devnet.eu/livechat/rocketchat-livechat.min.js?_=201903270000';
|
||||||
|
h.parentNode.insertBefore(j, h);
|
||||||
|
})(window, document, 'script', 'https://chat.365devnet.eu/livechat');
|
||||||
|
</script>
|
||||||
|
<!-- End of Rocket.Chat Livechat Script -->
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
Reference in New Issue
Block a user