From b15043be051f8b019c3d923fb8497036384ed30a Mon Sep 17 00:00:00 2001 From: carlh7777 Date: Thu, 4 Jun 2026 16:25:03 +0200 Subject: [PATCH 1/3] refactor(user-settings): enhance sidebar responsiveness and layout - Updated the sidebar component to utilize the `useIsMobile` hook for better responsiveness on mobile devices. - Adjusted CSS classes for the sidebar and main content area to improve layout and spacing across different screen sizes. - Ensured that user information and menu items adapt based on the device type, enhancing user experience on mobile. - Cleaned up unused code and comments for better readability. --- web/src/pages/user-setting/index.tsx | 8 +- web/src/pages/user-setting/sidebar/index.tsx | 89 +++++++++++++------- 2 files changed, 63 insertions(+), 34 deletions(-) diff --git a/web/src/pages/user-setting/index.tsx b/web/src/pages/user-setting/index.tsx index 080ed3b8d16..beef40eb4fa 100644 --- a/web/src/pages/user-setting/index.tsx +++ b/web/src/pages/user-setting/index.tsx @@ -5,10 +5,14 @@ import { cn } from '@/lib/utils'; const UserSetting = () => { return ( -
+
-
+
diff --git a/web/src/pages/user-setting/sidebar/index.tsx b/web/src/pages/user-setting/sidebar/index.tsx index e093ce02039..d4ca339cadd 100644 --- a/web/src/pages/user-setting/sidebar/index.tsx +++ b/web/src/pages/user-setting/sidebar/index.tsx @@ -1,3 +1,4 @@ +import { useIsMobile } from '@/components/hooks/use-mobile'; import { IconFontFill } from '@/components/icon-font'; import { RAGFlowAvatar } from '@/components/ragflow-avatar'; import ThemeSwitch from '@/components/theme-switch'; @@ -13,6 +14,7 @@ import { Routes } from '@/routes'; import { TFunction } from 'i18next'; import { LucideBox, + LucideLogOut, LucideServer, LucideUnplug, LucideUser, @@ -54,17 +56,10 @@ const menuItems = (t: TFunction) => [ label: t('setting.api'), key: Routes.Api, }, - // { - // icon: MessageSquareQuote, - // label: 'Prompt Templates', - // key: Routes.Profile, - // }, - // { icon: TextSearch, label: 'Retrieval Templates', key: Routes.Profile }, - // { icon: Cog, label: t('setting.system'), key: Routes.System }, - // { icon: Banknote, label: 'Plan', key: Routes.Plan }, ]; export function SideBar() { + const isMobile = useIsMobile(); const { data: userInfo } = useFetchUserInfo(); const { handleMenuClick, active: activeItemKey } = useHandleMenuClick(); const { version, fetchSystemVersion } = useFetchSystemVersion(); @@ -77,48 +72,65 @@ export function SideBar() { const { logout } = useLogout(); return ( -