Keep language switcher in mobile nav
This commit is contained in:
@@ -3,9 +3,9 @@
|
||||
import { languages, type Locale } from "@/config/business";
|
||||
import { cn } from "@/lib/utils";
|
||||
|
||||
export default function LanguageSwitcher({ locale, onLocaleChange }: { locale: Locale; onLocaleChange: (locale: Locale) => void }) {
|
||||
export default function LanguageSwitcher({ locale, onLocaleChange, className, buttonClassName }: { locale: Locale; onLocaleChange: (locale: Locale) => void; className?: string; buttonClassName?: string }) {
|
||||
return (
|
||||
<div className="flex rounded-full border border-ink/10 bg-white/65 p-1 shadow-sm backdrop-blur-xl" aria-label="Language switcher">
|
||||
<div className={cn("flex rounded-full border border-ink/10 bg-white/65 p-1 shadow-sm backdrop-blur-xl", className)} aria-label="Language switcher">
|
||||
{languages.map((language) => (
|
||||
<button
|
||||
key={language.code}
|
||||
@@ -13,6 +13,7 @@ export default function LanguageSwitcher({ locale, onLocaleChange }: { locale: L
|
||||
onClick={() => onLocaleChange(language.code)}
|
||||
className={cn(
|
||||
"rounded-full px-3 py-1.5 text-xs font-semibold transition-all duration-300",
|
||||
buttonClassName,
|
||||
locale === language.code ? "bg-ink text-white shadow-sm" : "text-ink/55 hover:text-ink"
|
||||
)}
|
||||
aria-pressed={locale === language.code}
|
||||
|
||||
Reference in New Issue
Block a user