feat(nav): current-language badge (HU/EN/DE) on the rail language switcher

The icon-only rail switcher now shows the active language code as a small corner badge,
so the current language reads at a glance without opening the menu.
This commit is contained in:
npeter83 2026-07-01 22:50:59 +02:00
parent b59208e006
commit c6fe94450b

View file

@ -92,9 +92,14 @@ export default function LanguageSwitcher({
onClick={toggleRail}
title={current.label}
aria-label={current.label}
className="p-2 rounded-lg text-muted hover:text-fg hover:bg-card transition"
className="relative p-2 rounded-lg text-muted hover:text-fg hover:bg-card transition"
>
<Globe className="w-5 h-5" />
{/* Current-language badge (HU/EN/DE) so the active language reads at a glance without
opening the menu. The ring matches the page background to detach it from the icon. */}
<span className="absolute -bottom-1 -right-1 text-[8px] font-bold leading-none px-1 py-[1px] rounded bg-accent text-accent-fg ring-2 ring-bg">
{current.code.toUpperCase()}
</span>
</button>
{open &&
createPortal(