From 8db25cc191fa41d1d13f8308ef94787de61b9f2e Mon Sep 17 00:00:00 2001 From: jeromelin Date: Tue, 17 Oct 2023 18:27:58 +0800 Subject: [PATCH] perf(tab-bar): remove safeArea props --- packages/zarm/src/tab-bar/TabBar.tsx | 4 +--- packages/zarm/src/tab-bar/demo.md | 1 - packages/zarm/src/tab-bar/interface.ts | 1 - 3 files changed, 1 insertion(+), 5 deletions(-) diff --git a/packages/zarm/src/tab-bar/TabBar.tsx b/packages/zarm/src/tab-bar/TabBar.tsx index 23da597e0..34f7d8d6a 100644 --- a/packages/zarm/src/tab-bar/TabBar.tsx +++ b/packages/zarm/src/tab-bar/TabBar.tsx @@ -1,7 +1,6 @@ import { createBEM } from '@zarm-design/bem'; import React, { cloneElement, useCallback, useState } from 'react'; import { ConfigContext } from '../config-provider'; -import SafeArea from '../safe-area'; import type { HTMLProps } from '../utils/utilityTypes'; import type { BaseTabBarProps } from './interface'; import type { TabBarItemProps } from './TabBarItem'; @@ -27,7 +26,7 @@ const TabBar = React.forwardRef((props, ref) => { const bem = createBEM('tab-bar', { prefixCls }); - const { className, children, onChange, activeKey, defaultActiveKey, safeArea, ...rest } = props; + const { className, children, onChange, activeKey, defaultActiveKey, ...rest } = props; const [selectedKey, setSelectedKey] = useState(defaultActiveKey); @@ -79,7 +78,6 @@ const TabBar = React.forwardRef((props, ref) => { return (
{items}
- {safeArea && }
); }) as CompoundedComponent; diff --git a/packages/zarm/src/tab-bar/demo.md b/packages/zarm/src/tab-bar/demo.md index c555d80dd..97c92dbfc 100644 --- a/packages/zarm/src/tab-bar/demo.md +++ b/packages/zarm/src/tab-bar/demo.md @@ -178,7 +178,6 @@ ReactDOM.render(, mountNode); | :--------------- | :-------------------------------- | :----- | :------------------------- | | activeKey | number \| string | - | 当前选中项 | | defaultActiveKey | number \| string | - | 初始选中项, 默认第一个选中 | -| safeArea | boolean | false | 是否适配安全区域 | | onChange | (value: number \| string) => void | - | 值变化时触发的回调函数 | ### TabBar.Item diff --git a/packages/zarm/src/tab-bar/interface.ts b/packages/zarm/src/tab-bar/interface.ts index 448820b68..caaafd6a9 100644 --- a/packages/zarm/src/tab-bar/interface.ts +++ b/packages/zarm/src/tab-bar/interface.ts @@ -4,7 +4,6 @@ import type { BaseBadgeProps } from '../badge/interface'; export interface BaseTabBarProps { defaultActiveKey?: string | number; activeKey?: string | number; - safeArea?: boolean; onChange?: (value: number | string) => void; }