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} ); }