Skip to content

Commit e51fca5

Browse files
committed
fix(docs): replace deprecated <Icon> with named icon components in demos
Migrate all 27 demo files from the old <Icon name="..." /> API to the new @tiny-design/icons named exports (e.g. <IconUser />, <IconDown />). Spinning icons now use the withSpin HOC.
1 parent 117866e commit e51fca5

27 files changed

Lines changed: 65 additions & 57 deletions

File tree

packages/react/src/avatar/demo/basic.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,17 @@ Different sizes setting by `size` and two shapes are available.
1313
return (
1414
<>
1515
<div>
16-
<Avatar icon={<Icon name="user" size={50} />} size={70} style={style}/>
17-
<Avatar icon={<Icon name="user" size={35} />} size={50} style={style}/>
18-
<Avatar icon={<Icon name="user" size={25} />} style={style}/>
19-
<Avatar icon={<Icon name="user" />} size={24} style={style}/>
16+
<Avatar icon={<IconUser size={50} />} size={70} style={style}/>
17+
<Avatar icon={<IconUser size={35} />} size={50} style={style}/>
18+
<Avatar icon={<IconUser size={25} />} style={style}/>
19+
<Avatar icon={<IconUser />} size={24} style={style}/>
2020
</div>
2121
<br/>
2222
<div>
23-
<Avatar shape="square" icon={<Icon name="user" size={50} />} size={70} style={style}/>
24-
<Avatar shape="square" icon={<Icon name="user" size={35} />} size={50} style={style}/>
25-
<Avatar shape="square" icon={<Icon name="user" size={25} />} style={style}/>
26-
<Avatar shape="square" icon={<Icon name="user" />} size={24} style={style}/>
23+
<Avatar shape="square" icon={<IconUser size={50} />} size={70} style={style}/>
24+
<Avatar shape="square" icon={<IconUser size={35} />} size={50} style={style}/>
25+
<Avatar shape="square" icon={<IconUser size={25} />} style={style}/>
26+
<Avatar shape="square" icon={<IconUser />} size={24} style={style}/>
2727
</div>
2828
</>
2929
);

packages/react/src/avatar/demo/type.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ Image, Icon and letter are supported, and the latter two kinds avatar can have c
1212

1313
return (
1414
<>
15-
<Avatar icon={<Icon name="user" size={20}/>} style={style}/>
15+
<Avatar icon={<IconUser size={20}/>} style={style}/>
1616
<Avatar style={style}>U</Avatar>
1717
<Avatar style={style}>USER</Avatar>
1818
<Avatar src="/avatar/avatar1.png" style={{ ...style }}/>
1919
<Avatar style={{ ...style, color: '#f56a00', backgroundColor: '#fde3cf' }}>LW</Avatar>
20-
<Avatar style={{ ...style, backgroundColor: '#87d068' }} icon={<Icon name="user" size={20}/>} />
20+
<Avatar style={{ ...style, backgroundColor: '#87d068' }} icon={<IconUser size={20}/>} />
2121
</>
2222
);
2323
}

packages/react/src/badge/demo/basic.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Simplest Usage.
3030
<Badge count="hot" style={badgeStyle}>
3131
<span style={spanStyle} />
3232
</Badge>
33-
<Badge count={<Icon name="lock" style={{ color: '#f5222d' }} />}>
33+
<Badge count={<IconLock style={{ color: '#f5222d' }} />}>
3434
<span style={spanStyle} />
3535
</Badge>
3636
</>

packages/react/src/badge/demo/dot.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ Display a red badge without a specific count.
1313
return (
1414
<>
1515
<Badge dot style={badgeStyle}>
16-
<Icon name="broadcast" />
16+
<IconBroadcast />
1717
</Badge>
1818
<Badge dot={false} style={badgeStyle}>
19-
<Icon name="broadcast" />
19+
<IconBroadcast />
2020
</Badge>
2121
<Badge dot>
2222
<span>Something</span>

packages/react/src/breadcrumb/demo/icon.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ Using an icon replaces a text or combination.
77
```jsx live
88
<Breadcrumb>
99
<Breadcrumb.Item>
10-
<Icon name="home" />
10+
<IconHome />
1111
</Breadcrumb.Item>
1212
<Breadcrumb.Item>
13-
<a href="#/components/breadcrumb"><Icon name="inspection" />Project List</a>
13+
<a href="#/components/breadcrumb"><IconInspection />Project List</a>
1414
</Breadcrumb.Item>
1515
<Breadcrumb.Item>A Project</Breadcrumb.Item>
1616
</Breadcrumb>

packages/react/src/button/demo/icon.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ Use icons to add more meaning to Button. You can use icon alone to save some spa
66

77
```jsx live
88
<Flex gap="sm">
9-
<Button icon={<Icon name="wifi"/>} color="primary"/>
10-
<Button icon={<Icon name="gift"/>} color="primary"/>
11-
<Button icon={<Icon name="search"/>} color="primary">Search</Button>
12-
<Button btnType="primary">Upload <Icon name="cloud-upload"/></Button>
9+
<Button icon={<IconWifi/>} color="primary"/>
10+
<Button icon={<IconGift/>} color="primary"/>
11+
<Button icon={<IconSearch/>} color="primary">Search</Button>
12+
<Button btnType="primary">Upload <IconCloudUpload/></Button>
1313
</Flex>
1414
```
1515

packages/react/src/dropdown/demo/basic.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ A very simple dropdown.
1313
</Menu>
1414
)}>
1515
<a onClick={e => e.preventDefault()}>
16-
Hover me <Icon name="down" size={12}/>
16+
Hover me <IconDown size={12}/>
1717
</a>
1818
</Dropdown>
1919
```

packages/react/src/dropdown/demo/cascade.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ The menu has multiple levels.
2222
</Menu>
2323
)}>
2424
<a onClick={e => e.preventDefault()}>
25-
Cascade dropdowm <Icon name="down" size={12}/>
25+
Cascade dropdowm <IconDown size={12}/>
2626
</a>
2727
</Dropdown>
2828
```

packages/react/src/dropdown/demo/close.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class CloseExample extends React.PureComponent {
4444
onVisibleChange={this.handleVisibleChange}
4545
visible={this.state.visible}>
4646
<a onClick={e => e.preventDefault()}>
47-
Hover me <Icon name="down" size={12}/>
47+
Hover me <IconDown size={12}/>
4848
</a>
4949
</Dropdown>
5050
);

packages/react/src/dropdown/demo/other.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Divider and disabled menu item.
1414
</Menu>
1515
)}>
1616
<a onClick={e => e.preventDefault()}>
17-
Hover me <Icon name="down" size={12}/>
17+
Hover me <IconDown size={12}/>
1818
</a>
1919
</Dropdown>
2020
```

0 commit comments

Comments
 (0)