Skip to content

Commit

Permalink
chore: rename prop specialTriggerStyle to zeroWidthTriggerStyle
Browse files Browse the repository at this point in the history
  • Loading branch information
orzyyyy authored and afc163 committed Oct 7, 2019
1 parent 4a29aaa commit 718a86d
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions components/layout/Sider.tsx
Expand Up @@ -52,7 +52,7 @@ export interface SiderProps extends React.HTMLAttributes<HTMLDivElement> {
defaultCollapsed?: boolean;
reverseArrow?: boolean;
onCollapse?: (collapsed: boolean, type: CollapseType) => void;
specialTriggerStyle?: React.CSSProperties;
zeroWidthTriggerStyle?: React.CSSProperties;
trigger?: React.ReactNode;
width?: number | string;
collapsedWidth?: number | string;
Expand Down Expand Up @@ -187,7 +187,7 @@ class InternalSider extends React.Component<InternalSideProps, SiderState> {
style,
width,
collapsedWidth,
specialTriggerStyle,
zeroWidthTriggerStyle,
...others
} = this.props;
const prefixCls = getPrefixCls('layout-sider', customizePrefixCls);
Expand All @@ -198,7 +198,7 @@ class InternalSider extends React.Component<InternalSideProps, SiderState> {
'breakpoint',
'onBreakpoint',
'siderHook',
'specialTriggerStyle',
'zeroWidthTriggerStyle',
]);
const rawWidth = this.state.collapsed ? collapsedWidth : width;
// use "px" as fallback unit for width
Expand All @@ -211,7 +211,7 @@ class InternalSider extends React.Component<InternalSideProps, SiderState> {
className={`${prefixCls}-zero-width-trigger ${prefixCls}-zero-width-trigger-${
reverseArrow ? 'right' : 'left'
}`}
style={specialTriggerStyle}
style={zeroWidthTriggerStyle}
>
<Icon type="bars" />
</span>
Expand Down
4 changes: 2 additions & 2 deletions components/layout/__tests__/index.test.js
Expand Up @@ -186,9 +186,9 @@ describe('Sider', () => {
);
});

it('specialTriggerStyle should work', () => {
it('zeroWidthTriggerStyle should work', () => {
const wrapper = mount(
<Sider collapsedWidth={0} collapsible specialTriggerStyle={{ background: '#F96' }}>
<Sider collapsedWidth={0} collapsible zeroWidthTriggerStyle={{ background: '#F96' }}>
<Menu theme="dark" mode="inline" defaultSelectedKeys={['1']}>
<Menu.Item key="1">
<Icon type="user" />
Expand Down
2 changes: 1 addition & 1 deletion components/layout/index.en-US.md
Expand Up @@ -95,12 +95,12 @@ The sidebar.
| defaultCollapsed | to set the initial status | boolean | false | |
| reverseArrow | reverse direction of arrow, for a sider that expands from the right | boolean | false | |
| style | to customize the styles | object | - | |
| specialTriggerStyle | to customize the styles of the special trigger that appears when collapsedWidth is 0 | object | - | 3.24.0 |
| theme | color theme of the sidebar | string: `light` `dark` | `dark` | 3.6.0 |
| trigger | specify the customized trigger, set to null to hide the trigger | string\|ReactNode | - | |
| width | width of the sidebar | number\|string | 200 | |
| onCollapse | the callback function, executed by clicking the trigger or activating the responsive layout | (collapsed, type) => {} | - | |
| onBreakpoint | the callback function, executed when [breakpoints](/components/grid#api) changed | (broken) => {} | - | 3.7.0 |
| zeroWidthTriggerStyle | to customize the styles of the special trigger that appears when `collapsedWidth` is 0 | object | - | 3.24.0 |

#### breakpoint width

Expand Down
2 changes: 1 addition & 1 deletion components/layout/index.zh-CN.md
Expand Up @@ -96,12 +96,12 @@ title: Layout
| defaultCollapsed | 是否默认收起 | boolean | false | |
| reverseArrow | 翻转折叠提示箭头的方向,当 Sider 在右边时可以使用 | boolean | false | |
| style | 指定样式 | object | - | |
| specialTriggerStyle | 指定当 `collapsedWidth` 为 0 时出现的特殊 trigger 的样式 | object | - | 3.24.0 |
| theme | 主题颜色 | string: `light` `dark` | `dark` | 3.6.0 |
| trigger | 自定义 trigger,设置为 null 时隐藏 trigger | string\|ReactNode | - | |
| width | 宽度 | number\|string | 200 | |
| onCollapse | 展开-收起时的回调函数,有点击 trigger 以及响应式反馈两种方式可以触发 | (collapsed, type) => {} | - | |
| onBreakpoint | 触发响应式布局[断点](/components/grid#api)时的回调 | (broken) => {} | - | 3.7.0 |
| zeroWidthTriggerStyle | 指定当 `collapsedWidth` 为 0 时出现的特殊 trigger 的样式 | object | - | 3.24.0 |

#### breakpoint width

Expand Down

0 comments on commit 718a86d

Please sign in to comment.