Skip to content

Commit

Permalink
perf(tab-bar): remove safeArea props
Browse files Browse the repository at this point in the history
  • Loading branch information
JeromeLin committed Oct 17, 2023
1 parent bf8be2e commit 8db25cc
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 5 deletions.
4 changes: 1 addition & 3 deletions packages/zarm/src/tab-bar/TabBar.tsx
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -27,7 +26,7 @@ const TabBar = React.forwardRef<HTMLDivElement, TabBarProps>((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);

Expand Down Expand Up @@ -79,7 +78,6 @@ const TabBar = React.forwardRef<HTMLDivElement, TabBarProps>((props, ref) => {
return (
<div {...rest} ref={ref} className={bem([className])}>
<div className={bem('wrapper')}>{items}</div>
{safeArea && <SafeArea position="bottom" />}
</div>
);
}) as CompoundedComponent;
Expand Down
1 change: 0 additions & 1 deletion packages/zarm/src/tab-bar/demo.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,6 @@ ReactDOM.render(<Demo />, mountNode);
| :--------------- | :-------------------------------- | :----- | :------------------------- |
| activeKey | number \| string | - | 当前选中项 |
| defaultActiveKey | number \| string | - | 初始选中项, 默认第一个选中 |
| safeArea | boolean | false | 是否适配安全区域 |
| onChange | (value: number \| string) => void | - | 值变化时触发的回调函数 |

### TabBar.Item
Expand Down
1 change: 0 additions & 1 deletion packages/zarm/src/tab-bar/interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

1 comment on commit 8db25cc

@vercel
Copy link

@vercel vercel bot commented on 8db25cc Oct 17, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

zarm – ./

zarm-git-master-zhongantech.vercel.app
zarm-zhongantech.vercel.app

Please sign in to comment.