From c989a6726586c7f71f6582eaebd9a3fbcc7cfd89 Mon Sep 17 00:00:00 2001 From: hamster1963 <1410514192@qq.com> Date: Sun, 28 Dec 2025 16:21:17 +0800 Subject: [PATCH] fix: update GroupSwitch and Server components for improved tab handling and styling --- src/components/GroupSwitch.tsx | 9 +++++++++ src/pages/Server.tsx | 27 ++++++++------------------- 2 files changed, 17 insertions(+), 19 deletions(-) diff --git a/src/components/GroupSwitch.tsx b/src/components/GroupSwitch.tsx index 12dadc6..54da229 100644 --- a/src/components/GroupSwitch.tsx +++ b/src/components/GroupSwitch.tsx @@ -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 (
- +