style: replace language abbreviations with flag images
This commit is contained in:
parent
8999b15931
commit
279c0cf067
1 changed files with 8 additions and 3 deletions
|
|
@ -42,10 +42,15 @@ export function LanguageSwitcher({ className }: LanguageSwitcherProps) {
|
|||
console.log(`[LanguageSwitcher] Selecting ${l.code}`);
|
||||
setLocale(l.code);
|
||||
}}
|
||||
className="flex items-center gap-2 cursor-pointer focus:outline-none focus:bg-accent focus:text-accent-foreground"
|
||||
className="flex items-center gap-3 cursor-pointer focus:outline-none focus:bg-accent focus:text-accent-foreground py-2"
|
||||
>
|
||||
<span className="text-lg">{l.flag}</span>
|
||||
<span>{l.name}</span>
|
||||
<img
|
||||
src={`https://flagcdn.com/w20/${l.code === "en" ? "us" : l.code === "es" ? "es" : "br"}.png`}
|
||||
alt={`${l.name} flag`}
|
||||
width="20"
|
||||
className="rounded-sm shadow-sm"
|
||||
/>
|
||||
<span className="font-medium">{l.name}</span>
|
||||
{locale === l.code && <span className="ml-auto text-xs opacity-50">✓</span>}
|
||||
</DropdownMenuItem>
|
||||
))}
|
||||
|
|
|
|||
Loading…
Reference in a new issue