mirror of
https://github.com/woodchen-ink/nezha-dash-v1.git
synced 2025-07-18 09:31:55 +08:00
feat: improve inline settings handling for mobile responsiveness (#34)
* feat: improve inline settings handling for mobile responsiveness * chore: auto-fix linting and formatting issues
This commit is contained in:
parent
99d349b0ed
commit
1a38ce8c77
@ -62,12 +62,26 @@ export default function Servers() {
|
||||
}, [])
|
||||
|
||||
useEffect(() => {
|
||||
const checkInlineSettings = () => {
|
||||
const isMobile = window.innerWidth < 768
|
||||
|
||||
if (!isMobile) {
|
||||
const inlineState = localStorage.getItem("inline")
|
||||
if (window.ForceCardInline) {
|
||||
setInline("1")
|
||||
} else if (inlineState !== null) {
|
||||
setInline(inlineState)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
checkInlineSettings()
|
||||
|
||||
window.addEventListener("resize", checkInlineSettings)
|
||||
|
||||
return () => {
|
||||
window.removeEventListener("resize", checkInlineSettings)
|
||||
}
|
||||
}, [])
|
||||
|
||||
useEffect(() => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user