jalil.arfaoui.net/src/components/logo.astro

19 lines
707 B
Text
Raw Normal View History

---
import HomeIcon from "./icons/HomeIcon.astro";
const pathname = Astro.url.pathname;
const currentLang = pathname.startsWith('/en') ? 'en' : pathname.startsWith('/ar') ? 'ar' : 'fr';
const isHome = pathname === '/' || pathname === '/en' || pathname === '/en/' || pathname === '/ar' || pathname === '/ar/';
const homeUrl = currentLang === 'en' ? '/en' : currentLang === 'ar' ? '/ar' : '/';
---
{!isHome && (
<a
href={homeUrl}
class="group relative z-30 flex items-center text-neutral-600 dark:text-neutral-300 hover:text-black dark:hover:text-white transition-colors"
title="Accueil"
2024-08-18 19:06:50 +02:00
>
<HomeIcon size={20} class="group-hover:scale-110 transition-transform duration-200" />
</a>
)}