fix: show current language flag instead of next language in landing page button
All checks were successful
Deploy to Production / Build and Deploy (push) Successful in 2m24s
All checks were successful
Deploy to Production / Build and Deploy (push) Successful in 2m24s
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -38,6 +38,7 @@ export function LanguageSwitcher({ variant = "select" }: LanguageSwitcherProps)
|
|||||||
const currentIndex = languages.findIndex((l) => l.value === locale);
|
const currentIndex = languages.findIndex((l) => l.value === locale);
|
||||||
const nextIndex = (currentIndex + 1) % languages.length;
|
const nextIndex = (currentIndex + 1) % languages.length;
|
||||||
const nextLang = languages[nextIndex];
|
const nextLang = languages[nextIndex];
|
||||||
|
const currentLang = languages[currentIndex];
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Button
|
<Button
|
||||||
@@ -47,7 +48,8 @@ export function LanguageSwitcher({ variant = "select" }: LanguageSwitcherProps)
|
|||||||
className="gap-1.5 text-muted-foreground hover:text-foreground"
|
className="gap-1.5 text-muted-foreground hover:text-foreground"
|
||||||
>
|
>
|
||||||
<Globe className="h-4 w-4" />
|
<Globe className="h-4 w-4" />
|
||||||
<span className="text-sm">{nextLang.flag}</span>
|
<span className="text-sm">{currentLang.flag}</span>
|
||||||
|
<span className="text-xs font-medium uppercase">{currentLang.value}</span>
|
||||||
</Button>
|
</Button>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user