From e6052d5832341fc30af7381e55e9645e384ddb0d Mon Sep 17 00:00:00 2001 From: Benjy Cui Date: Tue, 20 Dec 2016 11:06:40 +0800 Subject: [PATCH] docs: update demo for badge --- .../__tests__/__snapshots__/demo.test.js.snap | 795 +++++++++--------- components/badge/demo/99plus.md | 27 - components/badge/demo/basic.md | 4 +- components/badge/demo/change.md | 28 +- components/badge/demo/link.md | 2 +- components/badge/demo/no-wrapper.md | 2 +- components/badge/demo/overflow.md | 14 +- components/badge/demo/status.md | 2 +- 8 files changed, 423 insertions(+), 451 deletions(-) delete mode 100644 components/badge/demo/99plus.md diff --git a/components/badge/__tests__/__snapshots__/demo.test.js.snap b/components/badge/__tests__/__snapshots__/demo.test.js.snap index b581f047c4..e0259d963a 100644 --- a/components/badge/__tests__/__snapshots__/demo.test.js.snap +++ b/components/badge/__tests__/__snapshots__/demo.test.js.snap @@ -1,281 +1,3 @@ -exports[`test renders ./components/badge/demo/99plus.md correctly 1`] = ` -
- - - - -

- 0 -

-

- 1 -

-

- 2 -

-

- 3 -

-

- 4 -

-

- 5 -

-

- 6 -

-

- 7 -

-

- 8 -

-

- 9 -

-

- 0 -

-

- 1 -

-

- 2 -

-

- 3 -

-

- 4 -

-

- 5 -

-

- 6 -

-

- 7 -

-

- 8 -

-

- 9 -

-

- 0 -

-

- 1 -

-

- 2 -

-

- 3 -

-

- 4 -

-

- 5 -

-

- 6 -

-

- 7 -

-

- 8 -

-

- 9 -

-
- -

- 0 -

-

- 1 -

-

- 2 -

-

- 3 -

-

- 4 -

-

- 5 -

-

- 6 -

-

- 7 -

-

- 8 -

-

- 9 -

-

- 0 -

-

- 1 -

-

- 2 -

-

- 3 -

-

- 4 -

-

- 5 -

-

- 6 -

-

- 7 -

-

- 8 -

-

- 9 -

-

- 0 -

-

- 1 -

-

- 2 -

-

- 3 -

-

- 4 -

-

- 5 -

-

- 6 -

-

- 7 -

-

- 8 -

-

- 9 -

-
-
-
- - - - 99+ - - -
-`; - exports[`test renders ./components/badge/demo/basic.md correctly 1`] = ` `; -exports[`test renders ./components/badge/demo/change.md correctly 1`] = ` +exports[`test renders ./components/badge/demo/change.md correctly 1`] = ` +
+
+ + + + +

+ 0 +

+

+ 1 +

+

+ 2 +

+

+ 3 +

+

+ 4 +

+

+ 5 +

+

+ 6 +

+

+ 7 +

+

+ 8 +

+

+ 9 +

+

+ 0 +

+

+ 1 +

+

+ 2 +

+

+ 3 +

+

+ 4 +

+

+ 5 +

+

+ 6 +

+

+ 7 +

+

+ 8 +

+

+ 9 +

+

+ 0 +

+

+ 1 +

+

+ 2 +

+

+ 3 +

+

+ 4 +

+

+ 5 +

+

+ 6 +

+

+ 7 +

+

+ 8 +

+

+ 9 +

+
+
+ +
+ + +
+
+
+ + + + + + + +
+
+`; + +exports[`test renders ./components/badge/demo/dot.md correctly 1`] = ` +
+ + + + + + + Link something + + + +
+`; + +exports[`test renders ./components/badge/demo/link.md correctly 1`] = ` + + + + + +

+ 0 +

+

+ 1 +

+

+ 2 +

+

+ 3 +

+

+ 4 +

+

+ 5 +

+

+ 6 +

+

+ 7 +

+

+ 8 +

+

+ 9 +

+

+ 0 +

+

+ 1 +

+

+ 2 +

+

+ 3 +

+

+ 4 +

+

+ 5 +

+

+ 6 +

+

+ 7 +

+

+ 8 +

+

+ 9 +

+

+ 0 +

+

+ 1 +

+

+ 2 +

+

+ 3 +

+

+ 4 +

+

+ 5 +

+

+ 6 +

+

+ 7 +

+

+ 8 +

+

+ 9 +

+
+
+
+
+`; + +exports[`test renders ./components/badge/demo/no-wrapper.md correctly 1`] = `
- + class="ant-badge ant-badge-not-a-wrapper" + title="25"> + style="transition:none;-webkit-transform:translateY(-216px);transform:translateY(-216px);height:18px;">

0 @@ -479,7 +541,7 @@ exports[`test renders ./components/badge/demo/change.md correctly 1`] = ` 1

+ class="current"> 2

+ class=""> 5

- - - - - - -

-
-`; - -exports[`test renders ./components/badge/demo/dot.md correctly 1`] = ` - -`; - -exports[`test renders ./components/badge/demo/link.md correctly 1`] = ` - - - - @@ -755,21 +739,17 @@ exports[`test renders ./components/badge/demo/link.md correctly 1`] = ` - -`; - -exports[`test renders ./components/badge/demo/no-wrapper.md correctly 1`] = ` -
+ title="4"> + height="18" + style="background-color:#fff;color:#999;border-color:#d9d9d9;"> + style="transition:none;-webkit-transform:translateY(-252px);transform:translateY(-252px);height:18px;">

0 @@ -819,7 +799,7 @@ exports[`test renders ./components/badge/demo/no-wrapper.md correctly 1`] = ` 1

+ class=""> 2

+ class="current"> 4

+ + + + + 99+ + + +

+`; + +exports[`test renders ./components/badge/demo/overflow.md correctly 1`] = ` + -`; - -exports[`test renders ./components/badge/demo/overflow.md correctly 1`] = ` -
diff --git a/components/badge/demo/99plus.md b/components/badge/demo/99plus.md deleted file mode 100644 index b284cdcdbc..0000000000 --- a/components/badge/demo/99plus.md +++ /dev/null @@ -1,27 +0,0 @@ ---- -order: 1 -title: - zh-CN: 大数字 - en-US: Overflowed count ---- - -## zh-CN - -超过 99 的会显示为 `99+`。 - -## en-US - -`99+` is displayed when count is larger than `99`. - -````jsx -import { Badge } from 'antd'; - -ReactDOM.render(, mountNode); -```` diff --git a/components/badge/demo/basic.md b/components/badge/demo/basic.md index 18fc7bef83..903647b5cf 100644 --- a/components/badge/demo/basic.md +++ b/components/badge/demo/basic.md @@ -23,7 +23,7 @@ ReactDOM.render( , mountNode); ```` -````css + diff --git a/components/badge/demo/change.md b/components/badge/demo/change.md index e817b8cec0..d383e98df6 100644 --- a/components/badge/demo/change.md +++ b/components/badge/demo/change.md @@ -14,7 +14,7 @@ title: The count will be animated as it changes. ````jsx -import { Badge, Button, Icon } from 'antd'; +import { Badge, Button, Icon, Switch } from 'antd'; const ButtonGroup = Button.Group; const Test = React.createClass({ @@ -35,21 +35,16 @@ const Test = React.createClass({ } this.setState({ count }); }, - onClick() { - this.setState({ - show: !this.state.show, - }); + onChange(show) { + this.setState({ show }); }, render() { return (
- - - - - - - ); diff --git a/components/badge/demo/link.md b/components/badge/demo/link.md index 45aa19a15f..426b89061a 100644 --- a/components/badge/demo/link.md +++ b/components/badge/demo/link.md @@ -1,5 +1,5 @@ --- -order: 2 +order: 3 title: zh-CN: 可点击 en-US: Clickable diff --git a/components/badge/demo/no-wrapper.md b/components/badge/demo/no-wrapper.md index d42c5aff45..51d50bd5c7 100644 --- a/components/badge/demo/no-wrapper.md +++ b/components/badge/demo/no-wrapper.md @@ -1,5 +1,5 @@ --- -order: 0 +order: 1 title: zh-CN: 独立使用 en-US: Standalone diff --git a/components/badge/demo/overflow.md b/components/badge/demo/overflow.md index c0a786dd4b..6cce428040 100644 --- a/components/badge/demo/overflow.md +++ b/components/badge/demo/overflow.md @@ -1,22 +1,28 @@ --- -order: 6 +order: 2 title: zh-CN: 封顶数字 - en-US: Customized overflow count + en-US: Overflow Count --- ## zh-CN -超过 `overflowCount` 的会显示为 `${overflowCount}+`。 +超过 `overflowCount` 的会显示为 `${overflowCount}+`,默认的 `overflowCount` 为 `99`。 ## en-US -`${overflowCount}+` is displayed when count is larger than `overflowCount`. +`${overflowCount}+` is displayed when count is larger than `overflowCount`. The default value of `overflowCount` is `99`. ````jsx import { Badge } from 'antd'; ReactDOM.render(