Skip to content

Commit

Permalink
add Badge demo
Browse files Browse the repository at this point in the history
  • Loading branch information
ddcat1115 committed Jun 9, 2017
1 parent 153fb0f commit 8749438
Show file tree
Hide file tree
Showing 10 changed files with 539 additions and 27 deletions.
198 changes: 198 additions & 0 deletions components/avatar/__tests__/__snapshots__/demo.test.js.snap
Original file line number Diff line number Diff line change
@@ -1,5 +1,203 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`renders ./components/avatar/demo/badge.md correctly 1`] = `
<div>
<span
style="margin-right:24px;"
>
<span
class="ant-badge"
title="1"
>
<span
class="ant-avatar ant-avatar-square ant-avatar-icon"
>
<i
class="anticon anticon-user"
/>
</span>
<sup
class="ant-scroll-number ant-badge-count"
data-show="true"
>
<span
class="ant-scroll-number-only"
style="transition:none;-ms-transform:translateY(-1100%);-webkit-transform:translateY(-1100%);transform:translateY(-1100%);"
>
<p
class=""
>
0
</p>
<p
class=""
>
1
</p>
<p
class=""
>
2
</p>
<p
class=""
>
3
</p>
<p
class=""
>
4
</p>
<p
class=""
>
5
</p>
<p
class=""
>
6
</p>
<p
class=""
>
7
</p>
<p
class=""
>
8
</p>
<p
class=""
>
9
</p>
<p
class=""
>
0
</p>
<p
class="current"
>
1
</p>
<p
class=""
>
2
</p>
<p
class=""
>
3
</p>
<p
class=""
>
4
</p>
<p
class=""
>
5
</p>
<p
class=""
>
6
</p>
<p
class=""
>
7
</p>
<p
class=""
>
8
</p>
<p
class=""
>
9
</p>
<p
class=""
>
0
</p>
<p
class=""
>
1
</p>
<p
class=""
>
2
</p>
<p
class=""
>
3
</p>
<p
class=""
>
4
</p>
<p
class=""
>
5
</p>
<p
class=""
>
6
</p>
<p
class=""
>
7
</p>
<p
class=""
>
8
</p>
<p
class=""
>
9
</p>
</span>
</sup>
</span>
</span>
<span>
<span
class="ant-badge"
>
<span
class="ant-avatar ant-avatar-square ant-avatar-icon"
>
<i
class="anticon anticon-user"
/>
</span>
<sup
class="ant-scroll-number ant-badge-dot"
data-show="true"
/>
</span>
</span>
</div>
`;

exports[`renders ./components/avatar/demo/basic.md correctly 1`] = `
<div>
<div
Expand Down
29 changes: 29 additions & 0 deletions components/avatar/demo/badge.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
order: 3
title:
zh-CN: 带徽标的头像
en-US: With Badge
---

## zh-CN

通常用于消息提示。

## en-US

Usually used for messages remind.

````jsx
import { Avatar, Badge } from 'antd';

ReactDOM.render(
<div>
<span style={{ marginRight: 24 }}>
<Badge count={1}><Avatar shape="square" icon="user" /></Badge>
</span>
<span>
<Badge dot><Avatar shape="square" icon="user" /></Badge>
</span>
</div>
, mountNode);
````
2 changes: 1 addition & 1 deletion components/avatar/index.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ type: Data Display
title: Avatar
---

用来代表用户或事物,支持图片、Icon(antd-Icon)或字符展示
用来代表用户或事物,支持图片、图标或字符展示

## API

Expand Down
7 changes: 5 additions & 2 deletions components/form/__tests__/__snapshots__/demo.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -2161,7 +2161,6 @@ exports[`renders ./components/form/demo/validate-other.md correctly 1`] = `
<input
autocomplete="off"
class="ant-input-number-input"
id="input-number"
max="10"
min="1"
value="3"
Expand Down Expand Up @@ -2268,9 +2267,13 @@ exports[`renders ./components/form/demo/validate-other.md correctly 1`] = `
/>
</div>
<div
aria-disabled="false"
aria-valuemax="100"
aria-valuemin="0"
aria-valuenow="0"
class="ant-slider-handle"
role="slider"
style="left:0%;"
value="0"
/>
<div
class="ant-slider-mark"
Expand Down
12 changes: 10 additions & 2 deletions components/grid/__tests__/__snapshots__/demo.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -511,9 +511,13 @@ exports[`renders ./components/grid/demo/playground.md correctly 1`] = `
/>
</div>
<div
aria-disabled="false"
aria-valuemax="5"
aria-valuemin="0"
aria-valuenow="1"
class="ant-slider-handle"
role="slider"
style="left:20%;"
value="1"
/>
<div
class="ant-slider-mark"
Expand Down Expand Up @@ -604,9 +608,13 @@ exports[`renders ./components/grid/demo/playground.md correctly 1`] = `
/>
</div>
<div
aria-disabled="false"
aria-valuemax="5"
aria-valuemin="0"
aria-valuenow="2"
class="ant-slider-handle"
role="slider"
style="left:40%;"
value="2"
/>
<div
class="ant-slider-mark"
Expand Down
Loading

0 comments on commit 8749438

Please sign in to comment.