File tree Expand file tree Collapse file tree 3 files changed +5
-3
lines changed
Expand file tree Collapse file tree 3 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -62,9 +62,7 @@ const App: React.FC = () => {
6262 i18n . changeLanguage ( settingData ?. data ?. config ?. language )
6363 }
6464
65- const customMobileBackgroundImage =
66- // @ts -expect-error CustomMobileBackgroundImage is a global variable
67- ( window . CustomMobileBackgroundImage as string ) !== "" ? window . CustomMobileBackgroundImage : undefined
65+ const customMobileBackgroundImage = window . CustomMobileBackgroundImage !== "" ? window . CustomMobileBackgroundImage : undefined
6866
6967 return (
7068 < Router basename = { import . meta. env . BASE_URL } >
Original file line number Diff line number Diff line change @@ -41,6 +41,8 @@ function Header() {
4141 // @ts -expect-error CustomDesc is a global variable
4242 const customDesc = window . CustomDesc || t ( "nezha" )
4343
44+ const customMobileBackgroundImage = window . CustomMobileBackgroundImage !== "" ? window . CustomMobileBackgroundImage : undefined
45+
4446 useEffect ( ( ) => {
4547 const link = document . querySelector ( "link[rel*='icon']" ) || document . createElement ( "link" )
4648 // @ts -expect-error set link.type
@@ -109,6 +111,7 @@ function Header() {
109111 onClick = { handleBackgroundToggle }
110112 className = { cn ( "rounded-full px-[9px] bg-white dark:bg-black" , {
111113 "bg-white/70 dark:bg-black/70" : customBackgroundImage ,
114+ "hidden sm:block" : customMobileBackgroundImage ,
112115 } ) }
113116 >
114117 < ImageMinus className = "w-4 h-4" />
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ import { useEffect, useState } from "react"
33declare global {
44 interface Window {
55 CustomBackgroundImage : string
6+ CustomMobileBackgroundImage : string
67 }
78}
89
You can’t perform that action at this time.
0 commit comments