Skip to content

Commit

Permalink
demo: improve drawer demo and test case code
Browse files Browse the repository at this point in the history
  • Loading branch information
afc163 committed Aug 5, 2018
1 parent 1b3d063 commit 76afe50
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 59 deletions.
2 changes: 1 addition & 1 deletion components/drawer/__tests__/MultiDrawer.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class MultiDrawer extends React.Component {
</Button>
<Drawer
title="Multi-level drawer"
wrapClassName="test_drawer"
className="test_drawer"
width={520}
closable={false}
onClose={this.onClose}
Expand Down
6 changes: 0 additions & 6 deletions components/drawer/demo/basic-left.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,3 @@ class App extends React.Component {

ReactDOM.render(<App />, mountNode);
```

<style>
#_hj_feedback_container{
display:none
}
</style>
7 changes: 0 additions & 7 deletions components/drawer/demo/basic-right.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,3 @@ class App extends React.Component {

ReactDOM.render(<App />, mountNode);
```


<style>
#_hj_feedback_container{
display:none
}
</style>
15 changes: 4 additions & 11 deletions components/drawer/demo/from-drawer.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,9 @@ class DrawerForm extends React.Component {
};

onClose = () => {
this.setState(
{
visible: false,
}
);
this.setState({
visible: false,
});
};

render() {
Expand Down Expand Up @@ -174,13 +172,8 @@ class DrawerForm extends React.Component {
);
}
}

const App = Form.create()(DrawerForm);

ReactDOM.render(<App />, mountNode);
```

<style>
#_hj_feedback_container{
display:none
}
</style>
9 changes: 1 addition & 8 deletions components/drawer/demo/multi-level-drawer.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,12 @@ class App extends React.Component {
<Drawer
title="Multi-level drawer"
width={520}
wrapClassName="test_drawer"
closable={false}
onClose={this.onClose}
visible={this.state.visible}
>
<Button type="primary" onClick={this.showChildrenDrawer}>
Two-level drawer
Two-level drawer
</Button>
<Drawer
title="Two-level Drawer"
Expand Down Expand Up @@ -102,9 +101,3 @@ class App extends React.Component {

ReactDOM.render(<App />, mountNode);
```

<style>
#_hj_feedback_container{
display:none
}
</style>
44 changes: 18 additions & 26 deletions components/drawer/demo/user-profile.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,29 +24,27 @@ const pStyle = {
marginBottom: 16,
};

const DescriptionItem = ({ title, content }) => {
return (
<div
const DescriptionItem = ({ title, content }) => (
<div
style={{
fontSize: 14,
lineHeight: '22px',
marginBottom: 7,
color: 'rgba(0,0,0,0.65)',
}}
>
<p
style={{
fontSize: 14,
lineHeight: '22px',
marginBottom: 7,
color: 'rgba(0,0,0,0.65)',
marginRight: 8,
display: 'inline-block',
color: 'rgba(0,0,0,0.85)',
}}
>
<p
style={{
marginRight: 8,
display: 'inline-block',
color: 'rgba(0,0,0,0.85)',
}}
>
{title}:
</p>
{content}
</div>
);
};
{title}:
</p>
{content}
</div>
);

class App extends React.Component {
state = { visible: false };
Expand Down Expand Up @@ -185,9 +183,3 @@ class App extends React.Component {

ReactDOM.render(<App />, mountNode);
```

<style>
#_hj_feedback_container{
display:none
}
</style>
6 changes: 6 additions & 0 deletions components/drawer/index.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,9 @@ A Drawer is a panel that is typically overlaid on top of a page and slides in fr
| zIndex | The `z-index` of the Drawer. | Number | 1000 |
| placement | The placement of the Drawer. | 'left' \| 'right' | 'right'
| onClose | Specify a callback that will be called when a user clicks mask, close button or Cancel button. | function(e) | - |

<style>
#_hj_feedback_container {
display: none;
}
</style>
6 changes: 6 additions & 0 deletions components/drawer/index.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,9 @@ title: Drawer
| zIndex | 设置 Drawer 的 `z-index` | Number | 1000 |
| placement | 抽屉的方向 | 'left' \| 'right' | 'right'
| onClose | 点击遮罩层或右上角叉或取消按钮的回调 | function(e) ||

<style>
#_hj_feedback_container {
display: none;
}
</style>

0 comments on commit 76afe50

Please sign in to comment.