mirror of
https://github.com/Buriburizaem0n/nezha-dash-v1.git
synced 2026-05-06 13:58:43 +00:00
fix: update GroupSwitch and Server components for improved tab handling and styling
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { cn } from "@/lib/utils"
|
||||
import { m } from "framer-motion"
|
||||
import { s } from "node_modules/framer-motion/dist/types.d-6pKw1mTI"
|
||||
import { createRef, useEffect, useRef } from "react"
|
||||
|
||||
export default function GroupSwitch({
|
||||
@@ -36,6 +37,10 @@ export default function GroupSwitch({
|
||||
}, [])
|
||||
|
||||
useEffect(() => {
|
||||
if (tabs.length === 1 && tabs[0] === "All") {
|
||||
setCurrentTab("All")
|
||||
return
|
||||
}
|
||||
const savedGroup = sessionStorage.getItem("selectedGroup")
|
||||
if (savedGroup && tabs.includes(savedGroup)) {
|
||||
setCurrentTab(savedGroup)
|
||||
@@ -54,6 +59,10 @@ export default function GroupSwitch({
|
||||
}
|
||||
}, [currentTab])
|
||||
|
||||
if (tabs.length === 1 && tabs[0] === "All") {
|
||||
return null
|
||||
}
|
||||
|
||||
return (
|
||||
<div ref={scrollRef} className="scrollbar-hidden z-50 flex flex-col items-start overflow-x-scroll rounded-[50px]">
|
||||
<div
|
||||
|
||||
Reference in New Issue
Block a user