mirror of
https://github.com/Buriburizaem0n/nezha-dash-v1.git
synced 2026-02-05 21:20:08 +00:00
feat: components with custom background use transparent background
This commit is contained in:
@@ -7,12 +7,17 @@ import {
|
||||
DropdownMenuItem,
|
||||
DropdownMenuTrigger,
|
||||
} from "@/components/ui/dropdown-menu"
|
||||
import { cn } from "@/lib/utils"
|
||||
import { CheckCircleIcon } from "@heroicons/react/20/solid"
|
||||
import { useTranslation } from "react-i18next"
|
||||
|
||||
export function LanguageSwitcher() {
|
||||
const { t, i18n } = useTranslation()
|
||||
|
||||
const customBackgroundImage =
|
||||
// @ts-expect-error ShowNetTransfer is a global variable
|
||||
(window.CustomBackgroundImage as string) !== "" ? window.CustomBackgroundImage : undefined
|
||||
|
||||
const locale = i18n.languages[0]
|
||||
|
||||
const handleSelect = (e: Event, newLocale: string) => {
|
||||
@@ -32,7 +37,9 @@ export function LanguageSwitcher() {
|
||||
<Button
|
||||
variant="outline"
|
||||
size="sm"
|
||||
className="rounded-full px-[9px] bg-white dark:bg-black"
|
||||
className={cn("rounded-full px-[9px] bg-white dark:bg-black", {
|
||||
"bg-white/50 dark:bg-black/50": customBackgroundImage,
|
||||
})}
|
||||
>
|
||||
{localeItems.find((item) => item.code === locale)?.name}
|
||||
<span className="sr-only">Change language</span>
|
||||
|
||||
Reference in New Issue
Block a user