From e864caac00055f3a7ae8203beaba1a6aeceeb2d7 Mon Sep 17 00:00:00 2001 From: sepehr Date: Sun, 30 Aug 2026 09:08:58 +0200 Subject: [PATCH] fix(landing): replace language cycle button with dropdown selector The landing page language switcher cycled to the next language on every click. It is now a dropdown listing all 13 languages; the cycling button variant is removed from the LanguageSwitcher component. --- .../src/components/landing/landing-page.tsx | 4 +- .../src/components/ui/language-switcher.tsx | 39 ++++--------------- 2 files changed, 10 insertions(+), 33 deletions(-) diff --git a/frontend/src/components/landing/landing-page.tsx b/frontend/src/components/landing/landing-page.tsx index d7e382d..6481881 100644 --- a/frontend/src/components/landing/landing-page.tsx +++ b/frontend/src/components/landing/landing-page.tsx @@ -56,7 +56,7 @@ const Navbar = () => { {t('landing.nav.formats')} {t('landing.nav.pricing')}
- + {t('landing.nav.login')} {t('landing.nav.startFree')} @@ -78,7 +78,7 @@ const Navbar = () => { >
- +
setIsOpen(false)} className="block py-3 text-lg font-bold text-brand-dark dark:text-white">{t('landing.nav.why')} setIsOpen(false)} className="block py-3 text-lg font-bold text-brand-dark dark:text-white">{t('landing.nav.formats')} diff --git a/frontend/src/components/ui/language-switcher.tsx b/frontend/src/components/ui/language-switcher.tsx index 80ddc81..712f28e 100644 --- a/frontend/src/components/ui/language-switcher.tsx +++ b/frontend/src/components/ui/language-switcher.tsx @@ -1,7 +1,6 @@ "use client"; import { Globe } from "lucide-react"; -import { Button } from "@/components/ui/button"; import { Select, SelectContent, @@ -28,49 +27,27 @@ const languages: { value: Locale; label: string; flag: string }[] = [ ]; interface LanguageSwitcherProps { - variant?: "select" | "button"; + className?: string; } -export function LanguageSwitcher({ variant = "select" }: LanguageSwitcherProps) { +export function LanguageSwitcher({ className }: LanguageSwitcherProps) { const { locale, setLocale } = useI18n(); - - if (variant === "button") { - const currentIndex = languages.findIndex((l) => l.value === locale); - const nextIndex = (currentIndex + 1) % languages.length; - const nextLang = languages[nextIndex]; - const currentLang = languages[currentIndex]; - - return ( - - ); - } + const current = languages.find((l) => l.value === locale) ?? languages[0]; return (