2023-05-26 17:59:13 +08:00
|
|
|
import React from 'react';
|
2024-04-08 14:04:08 +08:00
|
|
|
import { AntDesignOutlined, UserOutlined } from '@ant-design/icons';
|
2023-07-28 16:17:43 +08:00
|
|
|
import { Avatar, Badge, ConfigProvider, Space, Tooltip } from 'antd';
|
2023-05-26 17:59:13 +08:00
|
|
|
|
|
|
|
const App: React.FC = () => (
|
|
|
|
<ConfigProvider
|
|
|
|
theme={{
|
|
|
|
components: {
|
|
|
|
Avatar: {
|
|
|
|
containerSize: 60,
|
|
|
|
containerSizeLG: 30,
|
|
|
|
containerSizeSM: 16,
|
|
|
|
|
|
|
|
textFontSize: 18,
|
|
|
|
textFontSizeLG: 28,
|
|
|
|
textFontSizeSM: 12,
|
|
|
|
|
|
|
|
borderRadius: 10,
|
|
|
|
groupOverlapping: -10,
|
|
|
|
groupBorderColor: '#eee',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}}
|
|
|
|
>
|
|
|
|
<Space>
|
|
|
|
<Avatar shape="circle" src="http://abc.com/not-exist.jpg">
|
|
|
|
A
|
|
|
|
</Avatar>
|
|
|
|
</Space>
|
|
|
|
<Space>
|
2024-06-01 14:44:53 +08:00
|
|
|
<Avatar.Group
|
|
|
|
max={{
|
|
|
|
count: 2,
|
|
|
|
style: { color: '#f56a00', backgroundColor: '#fde3cf' },
|
|
|
|
}}
|
|
|
|
>
|
2023-12-27 17:50:24 +08:00
|
|
|
<Avatar src="https://api.dicebear.com/7.x/miniavs/svg?seed=2" />
|
2023-05-26 17:59:13 +08:00
|
|
|
<Avatar style={{ backgroundColor: '#f56a00' }}>K</Avatar>
|
|
|
|
<Tooltip title="Ant User" placement="top">
|
|
|
|
<Avatar style={{ backgroundColor: '#87d068' }} icon={<UserOutlined />} />
|
|
|
|
</Tooltip>
|
|
|
|
<Avatar style={{ backgroundColor: '#1890ff' }} icon={<AntDesignOutlined />} />
|
|
|
|
</Avatar.Group>
|
|
|
|
</Space>
|
|
|
|
<Space>
|
|
|
|
<Badge count={1}>
|
|
|
|
<Avatar shape="square" icon={<UserOutlined />} />
|
|
|
|
</Badge>
|
|
|
|
<Badge dot>
|
|
|
|
<Avatar shape="square" icon={<UserOutlined />} />
|
|
|
|
</Badge>
|
|
|
|
</Space>
|
|
|
|
</ConfigProvider>
|
|
|
|
);
|
|
|
|
|
|
|
|
export default App;
|