Skip to content

Commit

Permalink
Merge pull request #447 from oceanbase/dengfuping-ui
Browse files Browse the repository at this point in the history
fix(ui): FooterToolbar children large size should work correctly
  • Loading branch information
dengfuping authored Jan 29, 2024
2 parents ea63501 + d06dfc9 commit 4c6d2c3
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ exports[`FooterToolbar portalDom is true 1`] = `
class="ant-pro-footer-bar-right"
>
<button
class="ant-btn ant-btn-default ant-btn-lg"
class="ant-btn ant-btn-default"
type="button"
>
<span>
Cancel
</span>
</button>
<button
class="ant-btn ant-btn-primary ant-btn-lg"
class="ant-btn ant-btn-primary"
type="button"
>
<span>
Expand All @@ -48,15 +48,15 @@ exports[`FooterToolbar render 1`] = `
class="ant-pro-footer-bar-right"
>
<button
class="ant-btn ant-btn-default ant-btn-lg"
class="ant-btn ant-btn-default"
type="button"
>
<span>
Cancel
</span>
</button>
<button
class="ant-btn ant-btn-primary ant-btn-lg"
class="ant-btn ant-btn-primary"
type="button"
>
<span>
Expand Down
18 changes: 1 addition & 17 deletions packages/ui/src/FooterToolbar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,30 +10,14 @@ const FooterToolbar: React.FC<FooterToolbarProps> = ({
// render footer under parent instead of body by default
portalDom = false,
prefixCls: customizePrefixCls,
children,
...restProps
}) => {
const { getPrefixCls } = useContext(ConfigProvider.ConfigContext);
const prefixCls = getPrefixCls('pro-footer-bar', customizePrefixCls);
const { wrapSSR } = useStyle(prefixCls);

const { token } = theme.useToken();

return wrapSSR(
<AntFooterToolbar portalDom={portalDom} prefixCls={customizePrefixCls} {...restProps}>
<ConfigProvider
// large size component
componentSize="large"
// middle font size
theme={{
token: {
fontSizeLG: token.fontSize,
},
}}
>
{children}
</ConfigProvider>
</AntFooterToolbar>
<AntFooterToolbar portalDom={portalDom} prefixCls={customizePrefixCls} {...restProps} />
);
};

Expand Down
4 changes: 1 addition & 3 deletions packages/ui/src/PageContainer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { PageContainer as AntPageContainer } from '@ant-design/pro-components';
import classNames from 'classnames';
import { isObject } from 'lodash';
import React, { useContext } from 'react';
import { ConfigProvider, Space, Tooltip, theme } from '@oceanbase/design';
import { ConfigProvider, Space, Tooltip } from '@oceanbase/design';
import LocaleWrapper from '../locale/LocaleWrapper';
import ItemRender from './ItemRender';
import zhCN from './locale/zh-CN';
Expand Down Expand Up @@ -46,8 +46,6 @@ const PageContainer = ({
const prefixCls = getPrefixCls('pro-page-container', customizePrefixCls);
const { wrapSSR } = useStyle(prefixCls);

const { token } = theme.useToken();

const { reload, subTitle, breadcrumb } = header || {};
const reloadProps =
isObject(reload) && !React.isValidElement(reload)
Expand Down

0 comments on commit 4c6d2c3

Please sign in to comment.