From 7f7013931dc90bd00542282372fb4648b9294379 Mon Sep 17 00:00:00 2001 From: zdl <3489966805@qq.com> Date: Thu, 25 Dec 2025 18:48:26 +0800 Subject: [PATCH] =?UTF-8?q?feat(PageLoader):=20=E6=B7=BB=E5=8A=A0=20inline?= =?UTF-8?q?=20=E6=A8=A1=E5=BC=8F=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 新增 inline 参数,用于页面内部加载状态 - 保持原有全屏模式用于路由懒加载 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- src/components/Loading/PageLoader.js | 42 ++++++++++++++++++---------- 1 file changed, 28 insertions(+), 14 deletions(-) diff --git a/src/components/Loading/PageLoader.js b/src/components/Loading/PageLoader.js index 29a45fdd..14eed799 100644 --- a/src/components/Loading/PageLoader.js +++ b/src/components/Loading/PageLoader.js @@ -1,13 +1,38 @@ // src/components/Loading/PageLoader.js import React from 'react'; -import { Box, Spinner, Text, VStack } from '@chakra-ui/react'; +import { Box, Spinner, Text, VStack, Center } from '@chakra-ui/react'; import { forumColors } from 'theme/forumTheme'; /** * 页面加载组件 - 用于路由懒加载的 fallback * 黑金主题:深色背景 + 金色 Spinner + * + * @param {string} message - 加载提示文字 + * @param {boolean} inline - 是否为内联模式(不占满整个视口) + * @param {string} py - 内联模式下的垂直内边距 */ -export default function PageLoader({ message = '加载中...' }) { +export default function PageLoader({ message = '加载中...', inline = false, py = '20' }) { + const content = ( + + + + {message} + + + ); + + // 内联模式:用于页面内部局部加载 + if (inline) { + return
{content}
; + } + + // 全屏模式:用于路由懒加载 return ( - - - - {message} - - + {content} ); }