mirror of
https://github.com/woodchen-ink/nezha-dash-v1.git
synced 2025-07-18 09:31:55 +08:00
fix: remove header disable bg button on mobile
This commit is contained in:
parent
561513e6e1
commit
a9e27e4ac9
@ -62,9 +62,7 @@ const App: React.FC = () => {
|
|||||||
i18n.changeLanguage(settingData?.data?.config?.language)
|
i18n.changeLanguage(settingData?.data?.config?.language)
|
||||||
}
|
}
|
||||||
|
|
||||||
const customMobileBackgroundImage =
|
const customMobileBackgroundImage = window.CustomMobileBackgroundImage !== "" ? window.CustomMobileBackgroundImage : undefined
|
||||||
// @ts-expect-error CustomMobileBackgroundImage is a global variable
|
|
||||||
(window.CustomMobileBackgroundImage as string) !== "" ? window.CustomMobileBackgroundImage : undefined
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Router basename={import.meta.env.BASE_URL}>
|
<Router basename={import.meta.env.BASE_URL}>
|
||||||
|
@ -41,6 +41,8 @@ function Header() {
|
|||||||
// @ts-expect-error CustomDesc is a global variable
|
// @ts-expect-error CustomDesc is a global variable
|
||||||
const customDesc = window.CustomDesc || t("nezha")
|
const customDesc = window.CustomDesc || t("nezha")
|
||||||
|
|
||||||
|
const customMobileBackgroundImage = window.CustomMobileBackgroundImage !== "" ? window.CustomMobileBackgroundImage : undefined
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const link = document.querySelector("link[rel*='icon']") || document.createElement("link")
|
const link = document.querySelector("link[rel*='icon']") || document.createElement("link")
|
||||||
// @ts-expect-error set link.type
|
// @ts-expect-error set link.type
|
||||||
@ -109,6 +111,7 @@ function Header() {
|
|||||||
onClick={handleBackgroundToggle}
|
onClick={handleBackgroundToggle}
|
||||||
className={cn("rounded-full px-[9px] bg-white dark:bg-black", {
|
className={cn("rounded-full px-[9px] bg-white dark:bg-black", {
|
||||||
"bg-white/70 dark:bg-black/70": customBackgroundImage,
|
"bg-white/70 dark:bg-black/70": customBackgroundImage,
|
||||||
|
"hidden sm:block": customMobileBackgroundImage,
|
||||||
})}
|
})}
|
||||||
>
|
>
|
||||||
<ImageMinus className="w-4 h-4" />
|
<ImageMinus className="w-4 h-4" />
|
||||||
|
@ -3,6 +3,7 @@ import { useEffect, useState } from "react"
|
|||||||
declare global {
|
declare global {
|
||||||
interface Window {
|
interface Window {
|
||||||
CustomBackgroundImage: string
|
CustomBackgroundImage: string
|
||||||
|
CustomMobileBackgroundImage: string
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user