feat: UI调整
This commit is contained in:
@@ -30,12 +30,12 @@ const MemoizedAppFooter = memo(AppFooter);
|
||||
*/
|
||||
export default function MainLayout() {
|
||||
return (
|
||||
<Box minH="100vh" display="flex" flexDirection="column">
|
||||
<Box flex="1" h="100vh" w="100%" position="relative" display="flex" flexDirection="column">
|
||||
{/* 导航栏 - 在所有页面间共享,memo 后不会在路由切换时重新渲染 */}
|
||||
<MemoizedHomeNavbar />
|
||||
|
||||
{/* 页面内容区域 - flex: 1 占据剩余空间,包含错误边界、懒加载 */}
|
||||
<Box flex="1" w="100%" position="relative" overflow="hidden" pt="72px">
|
||||
<Box flex="1" pt="72px">
|
||||
<ErrorBoundary>
|
||||
<Suspense fallback={<PageLoader message="页面加载中..." />}>
|
||||
<Outlet />
|
||||
@@ -47,11 +47,11 @@ export default function MainLayout() {
|
||||
<MemoizedAppFooter />
|
||||
|
||||
{/* 返回顶部按钮 - 滚动超过阈值时显示 */}
|
||||
<BackToTopButton
|
||||
{/* <BackToTopButton
|
||||
scrollThreshold={BACK_TO_TOP_CONFIG.scrollThreshold}
|
||||
position={BACK_TO_TOP_CONFIG.position}
|
||||
zIndex={BACK_TO_TOP_CONFIG.zIndex}
|
||||
/>
|
||||
/> */}
|
||||
</Box>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -71,6 +71,7 @@ const LeftSidebar = ({
|
||||
>
|
||||
<Box
|
||||
w="320px"
|
||||
h="100%"
|
||||
display="flex"
|
||||
flexDirection="column"
|
||||
bg="rgba(17, 24, 39, 0.8)"
|
||||
|
||||
@@ -78,6 +78,7 @@ const RightSidebar = ({
|
||||
>
|
||||
<Box
|
||||
w="320px"
|
||||
h="100%"
|
||||
display="flex"
|
||||
flexDirection="column"
|
||||
bg="rgba(17, 24, 39, 0.8)"
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
// 超炫酷的 AI 投研助手 - HeroUI v3 现代深色主题版本
|
||||
// 使用 Framer Motion 物理动画引擎 + 毛玻璃效果
|
||||
|
||||
import React, { useState, useEffect } from 'react';
|
||||
import { Box, Flex, useToast, useColorMode } from '@chakra-ui/react';
|
||||
import React, { useState } from 'react';
|
||||
import { Box, Flex, useToast } from '@chakra-ui/react';
|
||||
import { useAuth } from '@contexts/AuthContext';
|
||||
|
||||
// 常量配置 - 从 TypeScript 模块导入
|
||||
@@ -34,7 +34,6 @@ import { useAgentSessions, useAgentChat, useFileUpload } from './hooks';
|
||||
const AgentChat = () => {
|
||||
const { user } = useAuth();
|
||||
const toast = useToast();
|
||||
const { setColorMode } = useColorMode();
|
||||
|
||||
// ==================== UI 状态(主组件管理)====================
|
||||
const [selectedModel, setSelectedModel] = useState(DEFAULT_MODEL_ID);
|
||||
@@ -85,22 +84,9 @@ const AgentChat = () => {
|
||||
// ==================== 输入框引用(保留在主组件)====================
|
||||
const inputRef = React.useRef(null);
|
||||
|
||||
// ==================== 启用深色模式 ====================
|
||||
useEffect(() => {
|
||||
// 为 AgentChat 页面强制启用深色模式
|
||||
setColorMode('dark');
|
||||
document.documentElement.classList.add('dark');
|
||||
|
||||
return () => {
|
||||
// 组件卸载时不移除,让其他页面自己控制
|
||||
// document.documentElement.classList.remove('dark');
|
||||
};
|
||||
}, [setColorMode]);
|
||||
|
||||
// ==================== 渲染组件 ====================
|
||||
return (
|
||||
<Box flex={1} bg="gray.900">
|
||||
<Flex h="100%" overflow="hidden" position="relative">
|
||||
<Flex h="100%" position="relative" bg="gray.900">
|
||||
{/* 左侧栏 */}
|
||||
<LeftSidebar
|
||||
isOpen={isLeftSidebarOpen}
|
||||
@@ -147,7 +133,6 @@ const AgentChat = () => {
|
||||
messagesCount={messages.length}
|
||||
/>
|
||||
</Flex>
|
||||
</Box>
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user