mirror of
https://github.com/ant-design/ant-design.git
synced 2025-06-07 09:26:06 +08:00
demo: fixed the avatars are all the same picture (#40809)
* demo: update demo * update snap * update snap * update snap
This commit is contained in:
parent
3e5058c8c3
commit
33275b6e80
@ -53,7 +53,7 @@ describe('Avatar Render', () => {
|
||||
|
||||
it('should handle onError correctly', () => {
|
||||
const LOAD_FAILURE_SRC = 'http://error.url/';
|
||||
const LOAD_SUCCESS_SRC = 'https://joeschmoe.io/api/v1/random';
|
||||
const LOAD_SUCCESS_SRC = 'https://joesch.moe/api/v1/random';
|
||||
const Foo: React.FC = () => {
|
||||
const [avatarSrc, setAvatarSrc] = useState<typeof LOAD_FAILURE_SRC | typeof LOAD_SUCCESS_SRC>(
|
||||
LOAD_FAILURE_SRC,
|
||||
@ -75,7 +75,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://joeschmoe.io/api/v1/random';
|
||||
const LOAD_SUCCESS_SRC = 'https://joesch.moe/api/v1/random';
|
||||
|
||||
const div = global.document.createElement('div');
|
||||
global.document.body.appendChild(div);
|
||||
@ -172,7 +172,7 @@ describe('Avatar Render', () => {
|
||||
});
|
||||
|
||||
it('should exist crossorigin attribute', () => {
|
||||
const LOAD_SUCCESS_SRC = 'https://joeschmoe.io/api/v1/random';
|
||||
const LOAD_SUCCESS_SRC = 'https://joesch.moe/api/v1/random';
|
||||
const crossOrigin = 'anonymous';
|
||||
const { container } = render(
|
||||
<Avatar src={LOAD_SUCCESS_SRC} crossOrigin={crossOrigin}>
|
||||
@ -184,7 +184,7 @@ describe('Avatar Render', () => {
|
||||
});
|
||||
|
||||
it('should not exist crossorigin attribute', () => {
|
||||
const LOAD_SUCCESS_SRC = 'https://joeschmoe.io/api/v1/random';
|
||||
const LOAD_SUCCESS_SRC = 'https://joesch.moe/api/v1/random';
|
||||
const { container } = render(<Avatar src={LOAD_SUCCESS_SRC}>crossorigin</Avatar>);
|
||||
expect(container.querySelector('img')?.crossOrigin).toBeFalsy();
|
||||
expect(container.querySelector('img')?.crossOrigin).toEqual('');
|
||||
|
@ -140,7 +140,7 @@ exports[`Avatar Render should handle onError correctly 1`] = `
|
||||
class="ant-avatar ant-avatar-circle ant-avatar-image"
|
||||
>
|
||||
<img
|
||||
src="https://joeschmoe.io/api/v1/random"
|
||||
src="https://joesch.moe/api/v1/random"
|
||||
/>
|
||||
</span>
|
||||
`;
|
||||
@ -163,7 +163,7 @@ exports[`Avatar Render should show image on success after a failure state 2`] =
|
||||
class="ant-avatar ant-avatar-circle ant-avatar-image"
|
||||
>
|
||||
<img
|
||||
src="https://joeschmoe.io/api/v1/random"
|
||||
src="https://joesch.moe/api/v1/random"
|
||||
/>
|
||||
</span>
|
||||
`;
|
||||
|
@ -415,7 +415,7 @@ Array [
|
||||
class="ant-avatar ant-avatar-circle ant-avatar-image"
|
||||
>
|
||||
<img
|
||||
src="https://joesch.moe/api/v1/random"
|
||||
src="https://joesch.moe/api/v1/random?key=1"
|
||||
/>
|
||||
</span>
|
||||
<a
|
||||
@ -517,7 +517,7 @@ Array [
|
||||
class="ant-avatar ant-avatar-circle ant-avatar-image"
|
||||
>
|
||||
<img
|
||||
src="https://joesch.moe/api/v1/random"
|
||||
src="https://joesch.moe/api/v1/random?key=2"
|
||||
/>
|
||||
</span>
|
||||
<span
|
||||
@ -653,7 +653,7 @@ Array [
|
||||
class="ant-avatar ant-avatar-lg ant-avatar-circle ant-avatar-image"
|
||||
>
|
||||
<img
|
||||
src="https://joesch.moe/api/v1/random"
|
||||
src="https://joesch.moe/api/v1/random?key=3"
|
||||
/>
|
||||
</span>
|
||||
<span
|
||||
|
@ -415,7 +415,7 @@ Array [
|
||||
class="ant-avatar ant-avatar-circle ant-avatar-image"
|
||||
>
|
||||
<img
|
||||
src="https://joesch.moe/api/v1/random"
|
||||
src="https://joesch.moe/api/v1/random?key=1"
|
||||
/>
|
||||
</span>
|
||||
<a
|
||||
@ -493,7 +493,7 @@ Array [
|
||||
class="ant-avatar ant-avatar-circle ant-avatar-image"
|
||||
>
|
||||
<img
|
||||
src="https://joesch.moe/api/v1/random"
|
||||
src="https://joesch.moe/api/v1/random?key=2"
|
||||
/>
|
||||
</span>
|
||||
<span
|
||||
@ -530,7 +530,7 @@ Array [
|
||||
class="ant-avatar ant-avatar-lg ant-avatar-circle ant-avatar-image"
|
||||
>
|
||||
<img
|
||||
src="https://joesch.moe/api/v1/random"
|
||||
src="https://joesch.moe/api/v1/random?key=3"
|
||||
/>
|
||||
</span>
|
||||
<span
|
||||
|
@ -1,11 +1,11 @@
|
||||
import { AntDesignOutlined, UserOutlined } from '@ant-design/icons';
|
||||
import { Avatar, Divider, Tooltip } from 'antd';
|
||||
import React from 'react';
|
||||
import { AntDesignOutlined,UserOutlined } from '@ant-design/icons';
|
||||
import { Avatar,Divider,Tooltip } from 'antd';
|
||||
|
||||
const App: React.FC = () => (
|
||||
<>
|
||||
<Avatar.Group>
|
||||
<Avatar src="https://joesch.moe/api/v1/random" />
|
||||
<Avatar src="https://joesch.moe/api/v1/random?key=1" />
|
||||
<a href="https://ant.design">
|
||||
<Avatar style={{ backgroundColor: '#f56a00' }}>K</Avatar>
|
||||
</a>
|
||||
@ -16,7 +16,7 @@ const App: React.FC = () => (
|
||||
</Avatar.Group>
|
||||
<Divider />
|
||||
<Avatar.Group maxCount={2} maxStyle={{ color: '#f56a00', backgroundColor: '#fde3cf' }}>
|
||||
<Avatar src="https://joesch.moe/api/v1/random" />
|
||||
<Avatar src="https://joesch.moe/api/v1/random?key=2" />
|
||||
<Avatar style={{ backgroundColor: '#f56a00' }}>K</Avatar>
|
||||
<Tooltip title="Ant User" placement="top">
|
||||
<Avatar style={{ backgroundColor: '#87d068' }} icon={<UserOutlined />} />
|
||||
@ -29,7 +29,7 @@ const App: React.FC = () => (
|
||||
size="large"
|
||||
maxStyle={{ color: '#f56a00', backgroundColor: '#fde3cf' }}
|
||||
>
|
||||
<Avatar src="https://joesch.moe/api/v1/random" />
|
||||
<Avatar src="https://joesch.moe/api/v1/random?key=3" />
|
||||
<Avatar style={{ backgroundColor: '#f56a00' }}>K</Avatar>
|
||||
<Tooltip title="Ant User" placement="top">
|
||||
<Avatar style={{ backgroundColor: '#87d068' }} icon={<UserOutlined />} />
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { EditOutlined, EllipsisOutlined, SettingOutlined } from '@ant-design/icons';
|
||||
import { Avatar, Card, Skeleton, Switch } from 'antd';
|
||||
import React, { useState } from 'react';
|
||||
import { EditOutlined,EllipsisOutlined,SettingOutlined } from '@ant-design/icons';
|
||||
import { Avatar,Card,Skeleton,Switch } from 'antd';
|
||||
|
||||
const { Meta } = Card;
|
||||
|
||||
@ -14,15 +14,13 @@ const App: React.FC = () => {
|
||||
return (
|
||||
<>
|
||||
<Switch checked={!loading} onChange={onChange} />
|
||||
|
||||
<Card style={{ width: 300, marginTop: 16 }} loading={loading}>
|
||||
<Meta
|
||||
avatar={<Avatar src="https://joesch.moe/api/v1/random" />}
|
||||
avatar={<Avatar src="https://joesch.moe/api/v1/random?key=1" />}
|
||||
title="Card title"
|
||||
description="This is the description"
|
||||
/>
|
||||
</Card>
|
||||
|
||||
<Card
|
||||
style={{ width: 300, marginTop: 16 }}
|
||||
actions={[
|
||||
@ -33,7 +31,7 @@ const App: React.FC = () => {
|
||||
>
|
||||
<Skeleton loading={loading} avatar active>
|
||||
<Meta
|
||||
avatar={<Avatar src="https://joesch.moe/api/v1/random" />}
|
||||
avatar={<Avatar src="https://joesch.moe/api/v1/random?key=2" />}
|
||||
title="Card title"
|
||||
description="This is the description"
|
||||
/>
|
||||
|
@ -17327,7 +17327,7 @@ exports[`ConfigProvider components List configProvider 1`] = `
|
||||
class="config-avatar config-avatar-circle config-avatar-image"
|
||||
>
|
||||
<img
|
||||
src="https://joeschmoe.io/api/v1/random"
|
||||
src="https://joesch.moe/api/v1/random"
|
||||
/>
|
||||
</span>
|
||||
</div>
|
||||
@ -17379,7 +17379,7 @@ exports[`ConfigProvider components List configProvider componentDisabled 1`] = `
|
||||
class="config-avatar config-avatar-circle config-avatar-image"
|
||||
>
|
||||
<img
|
||||
src="https://joeschmoe.io/api/v1/random"
|
||||
src="https://joesch.moe/api/v1/random"
|
||||
/>
|
||||
</span>
|
||||
</div>
|
||||
@ -17431,7 +17431,7 @@ exports[`ConfigProvider components List configProvider componentSize large 1`] =
|
||||
class="config-avatar config-avatar-circle config-avatar-image"
|
||||
>
|
||||
<img
|
||||
src="https://joeschmoe.io/api/v1/random"
|
||||
src="https://joesch.moe/api/v1/random"
|
||||
/>
|
||||
</span>
|
||||
</div>
|
||||
@ -17483,7 +17483,7 @@ exports[`ConfigProvider components List configProvider componentSize middle 1`]
|
||||
class="config-avatar config-avatar-circle config-avatar-image"
|
||||
>
|
||||
<img
|
||||
src="https://joeschmoe.io/api/v1/random"
|
||||
src="https://joesch.moe/api/v1/random"
|
||||
/>
|
||||
</span>
|
||||
</div>
|
||||
@ -17535,7 +17535,7 @@ exports[`ConfigProvider components List configProvider virtual and dropdownMatch
|
||||
class="ant-avatar ant-avatar-circle ant-avatar-image"
|
||||
>
|
||||
<img
|
||||
src="https://joeschmoe.io/api/v1/random"
|
||||
src="https://joesch.moe/api/v1/random"
|
||||
/>
|
||||
</span>
|
||||
</div>
|
||||
@ -17587,7 +17587,7 @@ exports[`ConfigProvider components List normal 1`] = `
|
||||
class="ant-avatar ant-avatar-circle ant-avatar-image"
|
||||
>
|
||||
<img
|
||||
src="https://joeschmoe.io/api/v1/random"
|
||||
src="https://joesch.moe/api/v1/random"
|
||||
/>
|
||||
</span>
|
||||
</div>
|
||||
@ -17639,7 +17639,7 @@ exports[`ConfigProvider components List prefixCls 1`] = `
|
||||
class="ant-avatar ant-avatar-circle ant-avatar-image"
|
||||
>
|
||||
<img
|
||||
src="https://joeschmoe.io/api/v1/random"
|
||||
src="https://joesch.moe/api/v1/random"
|
||||
/>
|
||||
</span>
|
||||
</div>
|
||||
|
@ -40,6 +40,7 @@ import Skeleton from '../../skeleton';
|
||||
import type { SliderTooltipProps } from '../../slider';
|
||||
import Slider from '../../slider';
|
||||
// eslint-disable-next-line import/no-named-as-default
|
||||
import { render } from '../../../tests/utils';
|
||||
import Spin from '../../spin';
|
||||
import Statistic from '../../statistic';
|
||||
import Steps from '../../steps';
|
||||
@ -55,7 +56,6 @@ import Transfer from '../../transfer';
|
||||
import Tree from '../../tree';
|
||||
import TreeSelect from '../../tree-select';
|
||||
import Upload from '../../upload';
|
||||
import { render } from '../../../tests/utils';
|
||||
|
||||
dayjs.extend(customParseFormat);
|
||||
jest.mock('rc-util/lib/Portal');
|
||||
@ -351,7 +351,7 @@ describe('ConfigProvider', () => {
|
||||
<List.Item {...props}>
|
||||
<List.Item.Meta
|
||||
{...props}
|
||||
avatar={<Avatar src="https://joeschmoe.io/api/v1/random" />}
|
||||
avatar={<Avatar src="https://joesch.moe/api/v1/random" />}
|
||||
title="Ant Design"
|
||||
description="Ant Design, a design language for background applications, is refined by Ant UED Team"
|
||||
/>
|
||||
|
@ -8,8 +8,8 @@ describe('List Item Layout', () => {
|
||||
{
|
||||
key: 1,
|
||||
href: 'https://ant.design',
|
||||
title: `ant design`,
|
||||
avatar: 'https://joeschmoe.io/api/v1/random',
|
||||
title: 'ant design',
|
||||
avatar: 'https://joesch.moe/api/v1/random',
|
||||
description:
|
||||
'Ant Design, a design language for background applications, is refined by Ant UED Team.',
|
||||
content:
|
||||
|
@ -26,7 +26,7 @@ exports[`renders ./components/list/demo/basic.tsx extend context correctly 1`] =
|
||||
class="ant-avatar ant-avatar-circle ant-avatar-image"
|
||||
>
|
||||
<img
|
||||
src="https://joesch.moe/api/v1/random"
|
||||
src="https://joesch.moe/api/v1/random?key=0"
|
||||
/>
|
||||
</span>
|
||||
</div>
|
||||
@ -63,7 +63,7 @@ exports[`renders ./components/list/demo/basic.tsx extend context correctly 1`] =
|
||||
class="ant-avatar ant-avatar-circle ant-avatar-image"
|
||||
>
|
||||
<img
|
||||
src="https://joesch.moe/api/v1/random"
|
||||
src="https://joesch.moe/api/v1/random?key=1"
|
||||
/>
|
||||
</span>
|
||||
</div>
|
||||
@ -100,7 +100,7 @@ exports[`renders ./components/list/demo/basic.tsx extend context correctly 1`] =
|
||||
class="ant-avatar ant-avatar-circle ant-avatar-image"
|
||||
>
|
||||
<img
|
||||
src="https://joesch.moe/api/v1/random"
|
||||
src="https://joesch.moe/api/v1/random?key=2"
|
||||
/>
|
||||
</span>
|
||||
</div>
|
||||
@ -137,7 +137,7 @@ exports[`renders ./components/list/demo/basic.tsx extend context correctly 1`] =
|
||||
class="ant-avatar ant-avatar-circle ant-avatar-image"
|
||||
>
|
||||
<img
|
||||
src="https://joesch.moe/api/v1/random"
|
||||
src="https://joesch.moe/api/v1/random?key=3"
|
||||
/>
|
||||
</span>
|
||||
</div>
|
||||
@ -1360,7 +1360,7 @@ Array [
|
||||
class="ant-avatar ant-avatar-circle ant-avatar-image"
|
||||
>
|
||||
<img
|
||||
src="https://joesch.moe/api/v1/random"
|
||||
src="https://joesch.moe/api/v1/random?key=0"
|
||||
/>
|
||||
</span>
|
||||
</div>
|
||||
@ -1397,7 +1397,7 @@ Array [
|
||||
class="ant-avatar ant-avatar-circle ant-avatar-image"
|
||||
>
|
||||
<img
|
||||
src="https://joesch.moe/api/v1/random"
|
||||
src="https://joesch.moe/api/v1/random?key=1"
|
||||
/>
|
||||
</span>
|
||||
</div>
|
||||
@ -1434,7 +1434,7 @@ Array [
|
||||
class="ant-avatar ant-avatar-circle ant-avatar-image"
|
||||
>
|
||||
<img
|
||||
src="https://joesch.moe/api/v1/random"
|
||||
src="https://joesch.moe/api/v1/random?key=2"
|
||||
/>
|
||||
</span>
|
||||
</div>
|
||||
@ -1471,7 +1471,7 @@ Array [
|
||||
class="ant-avatar ant-avatar-circle ant-avatar-image"
|
||||
>
|
||||
<img
|
||||
src="https://joesch.moe/api/v1/random"
|
||||
src="https://joesch.moe/api/v1/random?key=3"
|
||||
/>
|
||||
</span>
|
||||
</div>
|
||||
@ -2072,7 +2072,7 @@ exports[`renders ./components/list/demo/vertical.tsx extend context correctly 1`
|
||||
class="ant-avatar ant-avatar-circle ant-avatar-image"
|
||||
>
|
||||
<img
|
||||
src="https://joesch.moe/api/v1/random"
|
||||
src="https://joesch.moe/api/v1/random?key=0"
|
||||
/>
|
||||
</span>
|
||||
</div>
|
||||
@ -2238,7 +2238,7 @@ exports[`renders ./components/list/demo/vertical.tsx extend context correctly 1`
|
||||
class="ant-avatar ant-avatar-circle ant-avatar-image"
|
||||
>
|
||||
<img
|
||||
src="https://joesch.moe/api/v1/random"
|
||||
src="https://joesch.moe/api/v1/random?key=1"
|
||||
/>
|
||||
</span>
|
||||
</div>
|
||||
@ -2404,7 +2404,7 @@ exports[`renders ./components/list/demo/vertical.tsx extend context correctly 1`
|
||||
class="ant-avatar ant-avatar-circle ant-avatar-image"
|
||||
>
|
||||
<img
|
||||
src="https://joesch.moe/api/v1/random"
|
||||
src="https://joesch.moe/api/v1/random?key=2"
|
||||
/>
|
||||
</span>
|
||||
</div>
|
||||
|
@ -26,7 +26,7 @@ exports[`renders ./components/list/demo/basic.tsx correctly 1`] = `
|
||||
class="ant-avatar ant-avatar-circle ant-avatar-image"
|
||||
>
|
||||
<img
|
||||
src="https://joesch.moe/api/v1/random"
|
||||
src="https://joesch.moe/api/v1/random?key=0"
|
||||
/>
|
||||
</span>
|
||||
</div>
|
||||
@ -63,7 +63,7 @@ exports[`renders ./components/list/demo/basic.tsx correctly 1`] = `
|
||||
class="ant-avatar ant-avatar-circle ant-avatar-image"
|
||||
>
|
||||
<img
|
||||
src="https://joesch.moe/api/v1/random"
|
||||
src="https://joesch.moe/api/v1/random?key=1"
|
||||
/>
|
||||
</span>
|
||||
</div>
|
||||
@ -100,7 +100,7 @@ exports[`renders ./components/list/demo/basic.tsx correctly 1`] = `
|
||||
class="ant-avatar ant-avatar-circle ant-avatar-image"
|
||||
>
|
||||
<img
|
||||
src="https://joesch.moe/api/v1/random"
|
||||
src="https://joesch.moe/api/v1/random?key=2"
|
||||
/>
|
||||
</span>
|
||||
</div>
|
||||
@ -137,7 +137,7 @@ exports[`renders ./components/list/demo/basic.tsx correctly 1`] = `
|
||||
class="ant-avatar ant-avatar-circle ant-avatar-image"
|
||||
>
|
||||
<img
|
||||
src="https://joesch.moe/api/v1/random"
|
||||
src="https://joesch.moe/api/v1/random?key=3"
|
||||
/>
|
||||
</span>
|
||||
</div>
|
||||
@ -1360,7 +1360,7 @@ Array [
|
||||
class="ant-avatar ant-avatar-circle ant-avatar-image"
|
||||
>
|
||||
<img
|
||||
src="https://joesch.moe/api/v1/random"
|
||||
src="https://joesch.moe/api/v1/random?key=0"
|
||||
/>
|
||||
</span>
|
||||
</div>
|
||||
@ -1397,7 +1397,7 @@ Array [
|
||||
class="ant-avatar ant-avatar-circle ant-avatar-image"
|
||||
>
|
||||
<img
|
||||
src="https://joesch.moe/api/v1/random"
|
||||
src="https://joesch.moe/api/v1/random?key=1"
|
||||
/>
|
||||
</span>
|
||||
</div>
|
||||
@ -1434,7 +1434,7 @@ Array [
|
||||
class="ant-avatar ant-avatar-circle ant-avatar-image"
|
||||
>
|
||||
<img
|
||||
src="https://joesch.moe/api/v1/random"
|
||||
src="https://joesch.moe/api/v1/random?key=2"
|
||||
/>
|
||||
</span>
|
||||
</div>
|
||||
@ -1471,7 +1471,7 @@ Array [
|
||||
class="ant-avatar ant-avatar-circle ant-avatar-image"
|
||||
>
|
||||
<img
|
||||
src="https://joesch.moe/api/v1/random"
|
||||
src="https://joesch.moe/api/v1/random?key=3"
|
||||
/>
|
||||
</span>
|
||||
</div>
|
||||
@ -2072,7 +2072,7 @@ exports[`renders ./components/list/demo/vertical.tsx correctly 1`] = `
|
||||
class="ant-avatar ant-avatar-circle ant-avatar-image"
|
||||
>
|
||||
<img
|
||||
src="https://joesch.moe/api/v1/random"
|
||||
src="https://joesch.moe/api/v1/random?key=0"
|
||||
/>
|
||||
</span>
|
||||
</div>
|
||||
@ -2238,7 +2238,7 @@ exports[`renders ./components/list/demo/vertical.tsx correctly 1`] = `
|
||||
class="ant-avatar ant-avatar-circle ant-avatar-image"
|
||||
>
|
||||
<img
|
||||
src="https://joesch.moe/api/v1/random"
|
||||
src="https://joesch.moe/api/v1/random?key=1"
|
||||
/>
|
||||
</span>
|
||||
</div>
|
||||
@ -2404,7 +2404,7 @@ exports[`renders ./components/list/demo/vertical.tsx correctly 1`] = `
|
||||
class="ant-avatar ant-avatar-circle ant-avatar-image"
|
||||
>
|
||||
<img
|
||||
src="https://joesch.moe/api/v1/random"
|
||||
src="https://joesch.moe/api/v1/random?key=2"
|
||||
/>
|
||||
</span>
|
||||
</div>
|
||||
|
@ -1,5 +1,5 @@
|
||||
import React from 'react';
|
||||
import { Avatar, List } from 'antd';
|
||||
import React from 'react';
|
||||
|
||||
const data = [
|
||||
{
|
||||
@ -20,10 +20,10 @@ const App: React.FC = () => (
|
||||
<List
|
||||
itemLayout="horizontal"
|
||||
dataSource={data}
|
||||
renderItem={(item) => (
|
||||
renderItem={(item, index) => (
|
||||
<List.Item>
|
||||
<List.Item.Meta
|
||||
avatar={<Avatar src="https://joesch.moe/api/v1/random" />}
|
||||
avatar={<Avatar src={`https://joesch.moe/api/v1/random?key=${index}`} />}
|
||||
title={<a href="https://ant.design">{item.title}</a>}
|
||||
description="Ant Design, a design language for background applications, is refined by Ant UED Team"
|
||||
/>
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { Avatar, List, Radio, Space } from 'antd';
|
||||
import React, { useState } from 'react';
|
||||
import { Avatar, List, Space, Radio } from 'antd';
|
||||
|
||||
type PaginationPosition = 'top' | 'bottom' | 'both';
|
||||
|
||||
@ -30,7 +30,7 @@ const App: React.FC = () => {
|
||||
|
||||
return (
|
||||
<>
|
||||
<Space direction='vertical' style={{ marginBottom: '20px' }} size="middle">
|
||||
<Space direction="vertical" style={{ marginBottom: '20px' }} size="middle">
|
||||
<Space>
|
||||
<span>Pagination Position:</span>
|
||||
<Radio.Group
|
||||
@ -67,10 +67,10 @@ const App: React.FC = () => {
|
||||
<List
|
||||
pagination={{ position, align }}
|
||||
dataSource={data}
|
||||
renderItem={(item) => (
|
||||
renderItem={(item, index) => (
|
||||
<List.Item>
|
||||
<List.Item.Meta
|
||||
avatar={<Avatar src="https://joesch.moe/api/v1/random" />}
|
||||
avatar={<Avatar src={`https://joesch.moe/api/v1/random?key=${index}`} />}
|
||||
title={<a href="https://ant.design">{item.title}</a>}
|
||||
description="Ant Design, a design language for background applications, is refined by Ant UED Team"
|
||||
/>
|
||||
|
@ -1,11 +1,11 @@
|
||||
import { LikeOutlined, MessageOutlined, StarOutlined } from '@ant-design/icons';
|
||||
import { Avatar, List, Space } from 'antd';
|
||||
import React from 'react';
|
||||
import { LikeOutlined,MessageOutlined,StarOutlined } from '@ant-design/icons';
|
||||
import { Avatar,List,Space } from 'antd';
|
||||
|
||||
const data = Array.from({ length: 23 }).map((_, i) => ({
|
||||
href: 'https://ant.design',
|
||||
title: `ant design part ${i}`,
|
||||
avatar: 'https://joesch.moe/api/v1/random',
|
||||
avatar: `https://joesch.moe/api/v1/random?key=${i}`,
|
||||
description:
|
||||
'Ant Design, a design language for background applications, is refined by Ant UED Team.',
|
||||
content:
|
||||
|
@ -1,7 +1,7 @@
|
||||
import type Icon from '@ant-design/icons';
|
||||
import { LikeOutlined,MessageOutlined,StarOutlined } from '@ant-design/icons';
|
||||
import { Avatar,List,Skeleton,Switch } from 'antd';
|
||||
import React,{ useState } from 'react';
|
||||
import { LikeOutlined, MessageOutlined, StarOutlined } from '@ant-design/icons';
|
||||
import { Avatar, List, Skeleton, Switch } from 'antd';
|
||||
import React, { useState } from 'react';
|
||||
|
||||
interface IconTextProps {
|
||||
icon: typeof Icon;
|
||||
@ -11,7 +11,7 @@ interface IconTextProps {
|
||||
const listData = Array.from({ length: 3 }).map((_, i) => ({
|
||||
href: 'https://ant.design',
|
||||
title: `ant design part ${i + 1}`,
|
||||
avatar: 'https://joesch.moe/api/v1/random',
|
||||
avatar: `https://joesch.moe/api/v1/random?key=${i}`,
|
||||
description:
|
||||
'Ant Design, a design language for background applications, is refined by Ant UED Team.',
|
||||
content:
|
||||
|
@ -895,7 +895,7 @@ exports[`renders ./components/steps/demo/inline.tsx extend context correctly 1`]
|
||||
class="ant-avatar ant-avatar-circle ant-avatar-image"
|
||||
>
|
||||
<img
|
||||
src="https://joesch.moe/api/v1/random"
|
||||
src="https://joesch.moe/api/v1/random?key=0"
|
||||
/>
|
||||
</span>
|
||||
</div>
|
||||
@ -1117,7 +1117,7 @@ exports[`renders ./components/steps/demo/inline.tsx extend context correctly 1`]
|
||||
class="ant-avatar ant-avatar-circle ant-avatar-image"
|
||||
>
|
||||
<img
|
||||
src="https://joesch.moe/api/v1/random"
|
||||
src="https://joesch.moe/api/v1/random?key=1"
|
||||
/>
|
||||
</span>
|
||||
</div>
|
||||
@ -1339,7 +1339,7 @@ exports[`renders ./components/steps/demo/inline.tsx extend context correctly 1`]
|
||||
class="ant-avatar ant-avatar-circle ant-avatar-image"
|
||||
>
|
||||
<img
|
||||
src="https://joesch.moe/api/v1/random"
|
||||
src="https://joesch.moe/api/v1/random?key=2"
|
||||
/>
|
||||
</span>
|
||||
</div>
|
||||
@ -1561,7 +1561,7 @@ exports[`renders ./components/steps/demo/inline.tsx extend context correctly 1`]
|
||||
class="ant-avatar ant-avatar-circle ant-avatar-image"
|
||||
>
|
||||
<img
|
||||
src="https://joesch.moe/api/v1/random"
|
||||
src="https://joesch.moe/api/v1/random?key=3"
|
||||
/>
|
||||
</span>
|
||||
</div>
|
||||
|
@ -751,7 +751,7 @@ exports[`renders ./components/steps/demo/inline.tsx correctly 1`] = `
|
||||
class="ant-avatar ant-avatar-circle ant-avatar-image"
|
||||
>
|
||||
<img
|
||||
src="https://joesch.moe/api/v1/random"
|
||||
src="https://joesch.moe/api/v1/random?key=0"
|
||||
/>
|
||||
</span>
|
||||
</div>
|
||||
@ -901,7 +901,7 @@ exports[`renders ./components/steps/demo/inline.tsx correctly 1`] = `
|
||||
class="ant-avatar ant-avatar-circle ant-avatar-image"
|
||||
>
|
||||
<img
|
||||
src="https://joesch.moe/api/v1/random"
|
||||
src="https://joesch.moe/api/v1/random?key=1"
|
||||
/>
|
||||
</span>
|
||||
</div>
|
||||
@ -1051,7 +1051,7 @@ exports[`renders ./components/steps/demo/inline.tsx correctly 1`] = `
|
||||
class="ant-avatar ant-avatar-circle ant-avatar-image"
|
||||
>
|
||||
<img
|
||||
src="https://joesch.moe/api/v1/random"
|
||||
src="https://joesch.moe/api/v1/random?key=2"
|
||||
/>
|
||||
</span>
|
||||
</div>
|
||||
@ -1201,7 +1201,7 @@ exports[`renders ./components/steps/demo/inline.tsx correctly 1`] = `
|
||||
class="ant-avatar ant-avatar-circle ant-avatar-image"
|
||||
>
|
||||
<img
|
||||
src="https://joesch.moe/api/v1/random"
|
||||
src="https://joesch.moe/api/v1/random?key=3"
|
||||
/>
|
||||
</span>
|
||||
</div>
|
||||
|
@ -1,6 +1,6 @@
|
||||
import React from 'react';
|
||||
import type { StepsProps } from 'antd';
|
||||
import { Steps, List, Avatar } from 'antd';
|
||||
import { Avatar, List, Steps } from 'antd';
|
||||
import React from 'react';
|
||||
|
||||
const data = [
|
||||
{
|
||||
@ -42,10 +42,10 @@ const App: React.FC = () => (
|
||||
<List
|
||||
itemLayout="horizontal"
|
||||
dataSource={data}
|
||||
renderItem={(item) => (
|
||||
renderItem={(item, index) => (
|
||||
<List.Item>
|
||||
<List.Item.Meta
|
||||
avatar={<Avatar src="https://joesch.moe/api/v1/random" />}
|
||||
avatar={<Avatar src={`https://joesch.moe/api/v1/random?key=${index}`} />}
|
||||
title={<a href="https://ant.design">{item.title}</a>}
|
||||
description="Ant Design, a design language for background applications, is refined by Ant UED Team"
|
||||
/>
|
||||
|
@ -1,3 +1,4 @@
|
||||
/* eslint-disable no-console */
|
||||
const React = require('react');
|
||||
const util = require('util');
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user