From 1d589423fe0bf982932770ca35aebef0d49899af Mon Sep 17 00:00:00 2001 From: dengfuping Date: Wed, 18 Oct 2023 20:22:50 +0800 Subject: [PATCH] fix(ui): PageContainer min-height should be calc(100vh - 48px) in BasicLayout --- packages/ui/src/BasicLayout/index.tsx | 4 ++-- packages/ui/src/BasicLayout/style/index.ts | 12 +++++++----- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/packages/ui/src/BasicLayout/index.tsx b/packages/ui/src/BasicLayout/index.tsx index 6fe4d68f9..8a464ef9c 100644 --- a/packages/ui/src/BasicLayout/index.tsx +++ b/packages/ui/src/BasicLayout/index.tsx @@ -96,9 +96,9 @@ const BasicLayout: React.FC = ({ ...restProps }) => { const { getPrefixCls } = useContext(ConfigProvider.ConfigContext); - const prefixCls = getPrefixCls('basic-layout', customizePrefixCls); + const prefixCls = getPrefixCls('pro-basic-layout', customizePrefixCls); const { wrapSSR } = useStyle(prefixCls); - const basicLayoutCls = classNames(className); + const basicLayoutCls = classNames(prefixCls, className); const navigate = useNavigate(); // 侧边栏导航是否收起 diff --git a/packages/ui/src/BasicLayout/style/index.ts b/packages/ui/src/BasicLayout/style/index.ts index f8d8048da..4babdde0b 100644 --- a/packages/ui/src/BasicLayout/style/index.ts +++ b/packages/ui/src/BasicLayout/style/index.ts @@ -7,13 +7,15 @@ export type BasicLayoutToken = FullToken; export const genBasicLayoutStyle: GenerateStyle = ( token: BasicLayoutToken ): CSSObject => { - const { proComponentsCls } = token; + const { componentCls, proComponentsCls } = token; return { - // Set style of PageContainer in BasicLayout - [`${proComponentsCls}-page-container`]: { - // 48px is the height of BasicLayout header - minHeight: 'calc(100vh - 48px)', + [`${componentCls}`]: { + // Set style of PageContainer in BasicLayout + [`${proComponentsCls}-page-container`]: { + // 48px is the height of BasicLayout header + minHeight: 'calc(100vh - 48px)', + }, }, [`${proComponentsCls}-footer-bar`]: { width: `calc(100% - 192px - 24px)`,