Skip to content

Commit

Permalink
chore: replace demo image to public avatar resources (#32479)
Browse files Browse the repository at this point in the history
* docs: replace avatar image to joeschmoe placeholder

* docs: usage randomme avatar url
  • Loading branch information
afc163 committed Oct 14, 2021
1 parent 8cafb11 commit 827225b
Show file tree
Hide file tree
Showing 23 changed files with 61 additions and 87 deletions.
8 changes: 4 additions & 4 deletions components/avatar/__tests__/Avatar.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ describe('Avatar Render', () => {

it('should handle onError correctly', () => {
const LOAD_FAILURE_SRC = 'http://error.url';
const LOAD_SUCCESS_SRC = 'https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png';
const LOAD_SUCCESS_SRC = 'https://joeschmoe.io/api/v1/random';

const div = global.document.createElement('div');
global.document.body.appendChild(div);
Expand Down Expand Up @@ -95,7 +95,7 @@ describe('Avatar Render', () => {

it('should show image on success after a failure state', () => {
const LOAD_FAILURE_SRC = 'http://error.url';
const LOAD_SUCCESS_SRC = 'https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png';
const LOAD_SUCCESS_SRC = 'https://joeschmoe.io/api/v1/random';

const div = global.document.createElement('div');
global.document.body.appendChild(div);
Expand Down Expand Up @@ -195,7 +195,7 @@ describe('Avatar Render', () => {
});

it('should exist crossorigin attribute', () => {
const LOAD_SUCCESS_SRC = 'https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png';
const LOAD_SUCCESS_SRC = 'https://joeschmoe.io/api/v1/random';
const wrapper = mount(
<Avatar src={LOAD_SUCCESS_SRC} crossOrigin="anonymous">
crossorigin
Expand All @@ -206,7 +206,7 @@ describe('Avatar Render', () => {
});

it('should not exist crossorigin attribute', () => {
const LOAD_SUCCESS_SRC = 'https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png';
const LOAD_SUCCESS_SRC = 'https://joeschmoe.io/api/v1/random';
const wrapper = mount(<Avatar src={LOAD_SUCCESS_SRC}>crossorigin</Avatar>);
expect(wrapper.html().includes('crossorigin')).toEqual(false);
expect(wrapper.find('img').prop('crossOrigin')).toEqual(undefined);
Expand Down
8 changes: 4 additions & 4 deletions components/avatar/__tests__/__snapshots__/Avatar.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -156,15 +156,15 @@ exports[`Avatar Render should handle onError correctly 1`] = `
onError={[Function]}
shape="circle"
size="default"
src="https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png"
src="https://joeschmoe.io/api/v1/random"
>
<span
className="ant-avatar ant-avatar-circle ant-avatar-image"
style={Object {}}
>
<img
onError={[Function]}
src="https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png"
src="https://joeschmoe.io/api/v1/random"
/>
</span>
</Avatar>
Expand Down Expand Up @@ -205,15 +205,15 @@ exports[`Avatar Render should show image on success after a failure state 2`] =
<Avatar
shape="circle"
size="default"
src="https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png"
src="https://joeschmoe.io/api/v1/random"
>
<span
className="ant-avatar ant-avatar-circle ant-avatar-image"
style={Object {}}
>
<img
onError={[Function]}
src="https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png"
src="https://joeschmoe.io/api/v1/random"
/>
</span>
</Avatar>
Expand Down
11 changes: 6 additions & 5 deletions components/avatar/__tests__/__snapshots__/demo.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ Array [
class="ant-avatar ant-avatar-circle ant-avatar-image"
>
<img
src="https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png"
src="https://joeschmoe.io/api/v1/random"
/>
</span>
<span
Expand Down Expand Up @@ -416,7 +416,7 @@ Array [
class="ant-avatar ant-avatar-circle ant-avatar-image"
>
<img
src="https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png"
src="https://joeschmoe.io/api/v1/random"
/>
</span>
<span
Expand Down Expand Up @@ -453,7 +453,7 @@ Array [
class="ant-avatar ant-avatar-lg ant-avatar-circle ant-avatar-image"
>
<img
src="https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png"
src="https://joeschmoe.io/api/v1/random"
/>
</span>
<span
Expand Down Expand Up @@ -635,7 +635,7 @@ Array [
class="ant-avatar ant-avatar-circle ant-avatar-image"
>
<img
src="https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png"
src="https://joeschmoe.io/api/v1/random"
/>
</span>,
<span
Expand All @@ -646,7 +646,8 @@ Array [
>
<img
class="ant-image-img"
src="https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png"
src="https://joeschmoe.io/api/v1/random"
style="width:32px"
/>
<div
class="ant-image-mask"
Expand Down
6 changes: 3 additions & 3 deletions components/avatar/demo/group.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import { UserOutlined, AntDesignOutlined } from '@ant-design/icons';
const Demo = () => (
<>
<Avatar.Group>
<Avatar src="https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png" />
<Avatar src="https://joeschmoe.io/api/v1/random" />
<Avatar style={{ backgroundColor: '#f56a00' }}>K</Avatar>
<Tooltip title="Ant User" placement="top">
<Avatar style={{ backgroundColor: '#87d068' }} icon={<UserOutlined />} />
Expand All @@ -29,7 +29,7 @@ const Demo = () => (
</Avatar.Group>
<Divider />
<Avatar.Group maxCount={2} maxStyle={{ color: '#f56a00', backgroundColor: '#fde3cf' }}>
<Avatar src="https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png" />
<Avatar src="https://joeschmoe.io/api/v1/random" />
<Avatar style={{ backgroundColor: '#f56a00' }}>K</Avatar>
<Tooltip title="Ant User" placement="top">
<Avatar style={{ backgroundColor: '#87d068' }} icon={<UserOutlined />} />
Expand All @@ -42,7 +42,7 @@ const Demo = () => (
size="large"
maxStyle={{ color: '#f56a00', backgroundColor: '#fde3cf' }}
>
<Avatar src="https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png" />
<Avatar src="https://joeschmoe.io/api/v1/random" />
<Avatar style={{ backgroundColor: '#f56a00' }}>K</Avatar>
<Tooltip title="Ant User" placement="top">
<Avatar style={{ backgroundColor: '#87d068' }} icon={<UserOutlined />} />
Expand Down
6 changes: 2 additions & 4 deletions components/avatar/demo/type.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,8 @@ ReactDOM.render(
<Avatar icon={<UserOutlined />} />
<Avatar>U</Avatar>
<Avatar size={40}>USER</Avatar>
<Avatar src="https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png" />
<Avatar
src={<Image src="https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png" />}
/>
<Avatar src="https://joeschmoe.io/api/v1/random" />
<Avatar src={<Image src="https://joeschmoe.io/api/v1/random" style={{ width: 32 }} />} />
<Avatar style={{ color: '#f56a00', backgroundColor: '#fde3cf' }}>U</Avatar>
<Avatar style={{ backgroundColor: '#87d068' }} icon={<UserOutlined />} />
</>,
Expand Down
2 changes: 1 addition & 1 deletion components/card/__tests__/__snapshots__/demo.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -682,7 +682,7 @@ exports[`renders ./components/card/demo/meta.md correctly 1`] = `
class="ant-avatar ant-avatar-circle ant-avatar-image"
>
<img
src="https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png"
src="https://joeschmoe.io/api/v1/random"
/>
</span>
</div>
Expand Down
8 changes: 2 additions & 6 deletions components/card/demo/loading.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,7 @@ class App extends React.Component {

<Card style={{ width: 300, marginTop: 16 }} loading={loading}>
<Meta
avatar={
<Avatar src="https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png" />
}
avatar={<Avatar src="https://joeschmoe.io/api/v1/random" />}
title="Card title"
description="This is the description"
/>
Expand All @@ -55,9 +53,7 @@ class App extends React.Component {
>
<Skeleton loading={loading} avatar active>
<Meta
avatar={
<Avatar src="https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png" />
}
avatar={<Avatar src="https://joeschmoe.io/api/v1/random" />}
title="Card title"
description="This is the description"
/>
Expand Down
2 changes: 1 addition & 1 deletion components/card/demo/meta.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ ReactDOM.render(
]}
>
<Meta
avatar={<Avatar src="https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png" />}
avatar={<Avatar src="https://joeschmoe.io/api/v1/random" />}
title="Card title"
description="This is the description"
/>
Expand Down
16 changes: 8 additions & 8 deletions components/comment/__tests__/__snapshots__/demo.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ exports[`renders ./components/comment/demo/basic.md correctly 1`] = `
>
<img
alt="Han Solo"
src="https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png"
src="https://joeschmoe.io/api/v1/random"
/>
</span>
</div>
Expand Down Expand Up @@ -132,7 +132,7 @@ exports[`renders ./components/comment/demo/editor.md correctly 1`] = `
>
<img
alt="Han Solo"
src="https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png"
src="https://joeschmoe.io/api/v1/random"
/>
</span>
</div>
Expand Down Expand Up @@ -222,7 +222,7 @@ exports[`renders ./components/comment/demo/list.md correctly 1`] = `
>
<img
alt="comment-avatar"
src="https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png"
src="https://joeschmoe.io/api/v1/random"
/>
</div>
<div
Expand Down Expand Up @@ -276,7 +276,7 @@ exports[`renders ./components/comment/demo/list.md correctly 1`] = `
>
<img
alt="comment-avatar"
src="https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png"
src="https://joeschmoe.io/api/v1/random"
/>
</div>
<div
Expand Down Expand Up @@ -339,7 +339,7 @@ exports[`renders ./components/comment/demo/nested.md correctly 1`] = `
>
<img
alt="Han Solo"
src="https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png"
src="https://joeschmoe.io/api/v1/random"
/>
</span>
</div>
Expand Down Expand Up @@ -392,7 +392,7 @@ exports[`renders ./components/comment/demo/nested.md correctly 1`] = `
>
<img
alt="Han Solo"
src="https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png"
src="https://joeschmoe.io/api/v1/random"
/>
</span>
</div>
Expand Down Expand Up @@ -445,7 +445,7 @@ exports[`renders ./components/comment/demo/nested.md correctly 1`] = `
>
<img
alt="Han Solo"
src="https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png"
src="https://joeschmoe.io/api/v1/random"
/>
</span>
</div>
Expand Down Expand Up @@ -496,7 +496,7 @@ exports[`renders ./components/comment/demo/nested.md correctly 1`] = `
>
<img
alt="Han Solo"
src="https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png"
src="https://joeschmoe.io/api/v1/random"
/>
</span>
</div>
Expand Down
7 changes: 1 addition & 6 deletions components/comment/demo/basic.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,7 @@ const Demo = () => {
<Comment
actions={actions}
author={<a>Han Solo</a>}
avatar={
<Avatar
src="https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png"
alt="Han Solo"
/>
}
avatar={<Avatar src="https://joeschmoe.io/api/v1/random" alt="Han Solo" />}
content={
<p>
We supply a series of design principles, practical patterns and high quality design
Expand Down
9 changes: 2 additions & 7 deletions components/comment/demo/editor.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class App extends React.Component {
...this.state.comments,
{
author: 'Han Solo',
avatar: 'https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png',
avatar: 'https://joeschmoe.io/api/v1/random',
content: <p>{this.state.value}</p>,
datetime: moment().fromNow(),
},
Expand All @@ -87,12 +87,7 @@ class App extends React.Component {
<>
{comments.length > 0 && <CommentList comments={comments} />}
<Comment
avatar={
<Avatar
src="https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png"
alt="Han Solo"
/>
}
avatar={<Avatar src="https://joeschmoe.io/api/v1/random" alt="Han Solo" />}
content={
<Editor
onChange={this.handleChange}
Expand Down
4 changes: 2 additions & 2 deletions components/comment/demo/list.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const data = [
{
actions: [<span key="comment-list-reply-to-0">Reply to</span>],
author: 'Han Solo',
avatar: 'https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png',
avatar: 'https://joeschmoe.io/api/v1/random',
content: (
<p>
We supply a series of design principles, practical patterns and high quality design
Expand All @@ -38,7 +38,7 @@ const data = [
{
actions: [<span key="comment-list-reply-to-0">Reply to</span>],
author: 'Han Solo',
avatar: 'https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png',
avatar: 'https://joeschmoe.io/api/v1/random',
content: (
<p>
We supply a series of design principles, practical patterns and high quality design
Expand Down
7 changes: 1 addition & 6 deletions components/comment/demo/nested.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,7 @@ const ExampleComment = ({ children }) => (
<Comment
actions={[<span key="comment-nested-reply-to">Reply to</span>]}
author={<a>Han Solo</a>}
avatar={
<Avatar
src="https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png"
alt="Han Solo"
/>
}
avatar={<Avatar src="https://joeschmoe.io/api/v1/random" alt="Han Solo" />}
content={
<p>
We supply a series of design principles, practical patterns and high quality design
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14852,7 +14852,7 @@ exports[`ConfigProvider components List configProvider 1`] = `
class="config-avatar config-avatar-circle config-avatar-image"
>
<img
src="https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png"
src="https://joeschmoe.io/api/v1/random"
/>
</span>
</div>
Expand Down Expand Up @@ -14904,7 +14904,7 @@ exports[`ConfigProvider components List configProvider componentSize large 1`] =
class="config-avatar config-avatar-circle config-avatar-image"
>
<img
src="https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png"
src="https://joeschmoe.io/api/v1/random"
/>
</span>
</div>
Expand Down Expand Up @@ -14956,7 +14956,7 @@ exports[`ConfigProvider components List configProvider componentSize middle 1`]
class="config-avatar config-avatar-circle config-avatar-image"
>
<img
src="https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png"
src="https://joeschmoe.io/api/v1/random"
/>
</span>
</div>
Expand Down Expand Up @@ -15008,7 +15008,7 @@ exports[`ConfigProvider components List configProvider virtual and dropdownMatch
class="ant-avatar ant-avatar-circle ant-avatar-image"
>
<img
src="https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png"
src="https://joeschmoe.io/api/v1/random"
/>
</span>
</div>
Expand Down Expand Up @@ -15060,7 +15060,7 @@ exports[`ConfigProvider components List normal 1`] = `
class="ant-avatar ant-avatar-circle ant-avatar-image"
>
<img
src="https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png"
src="https://joeschmoe.io/api/v1/random"
/>
</span>
</div>
Expand Down Expand Up @@ -15112,7 +15112,7 @@ exports[`ConfigProvider components List prefixCls 1`] = `
class="ant-avatar ant-avatar-circle ant-avatar-image"
>
<img
src="https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png"
src="https://joeschmoe.io/api/v1/random"
/>
</span>
</div>
Expand Down
Loading

0 comments on commit 827225b

Please sign in to comment.