mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-18 19:39:51 +08:00
fix: Avatar.Group item could be wrapped (#39993)
* fix: AvatarGroup item could be wrapped * test: update snapshot * refactor avatarGroup space * test: update snapshot * revert avatarGroupBorderColor
This commit is contained in:
parent
dc2686d7eb
commit
6683c58b2d
@ -345,6 +345,9 @@ Array [
|
|||||||
src="https://joeschmoe.io/api/v1/random"
|
src="https://joeschmoe.io/api/v1/random"
|
||||||
/>
|
/>
|
||||||
</span>
|
</span>
|
||||||
|
<a
|
||||||
|
href="https://ant.design"
|
||||||
|
>
|
||||||
<span
|
<span
|
||||||
class="ant-avatar ant-avatar-circle"
|
class="ant-avatar ant-avatar-circle"
|
||||||
style="background-color:#f56a00"
|
style="background-color:#f56a00"
|
||||||
@ -356,6 +359,7 @@ Array [
|
|||||||
K
|
K
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
|
</a>
|
||||||
<span
|
<span
|
||||||
class="ant-avatar ant-avatar-circle ant-avatar-icon"
|
class="ant-avatar ant-avatar-circle ant-avatar-icon"
|
||||||
style="background-color:#87d068"
|
style="background-color:#87d068"
|
||||||
|
@ -345,6 +345,9 @@ Array [
|
|||||||
src="https://joeschmoe.io/api/v1/random"
|
src="https://joeschmoe.io/api/v1/random"
|
||||||
/>
|
/>
|
||||||
</span>
|
</span>
|
||||||
|
<a
|
||||||
|
href="https://ant.design"
|
||||||
|
>
|
||||||
<span
|
<span
|
||||||
class="ant-avatar ant-avatar-circle"
|
class="ant-avatar ant-avatar-circle"
|
||||||
style="background-color:#f56a00"
|
style="background-color:#f56a00"
|
||||||
@ -356,6 +359,7 @@ Array [
|
|||||||
K
|
K
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
|
</a>
|
||||||
<span
|
<span
|
||||||
class="ant-avatar ant-avatar-circle ant-avatar-icon"
|
class="ant-avatar ant-avatar-circle ant-avatar-icon"
|
||||||
style="background-color:#87d068"
|
style="background-color:#87d068"
|
||||||
|
@ -6,7 +6,9 @@ const App: React.FC = () => (
|
|||||||
<>
|
<>
|
||||||
<Avatar.Group>
|
<Avatar.Group>
|
||||||
<Avatar src="https://joeschmoe.io/api/v1/random" />
|
<Avatar src="https://joeschmoe.io/api/v1/random" />
|
||||||
|
<a href="https://ant.design">
|
||||||
<Avatar style={{ backgroundColor: '#f56a00' }}>K</Avatar>
|
<Avatar style={{ backgroundColor: '#f56a00' }}>K</Avatar>
|
||||||
|
</a>
|
||||||
<Tooltip title="Ant User" placement="top">
|
<Tooltip title="Ant User" placement="top">
|
||||||
<Avatar style={{ backgroundColor: '#87d068' }} icon={<UserOutlined />} />
|
<Avatar style={{ backgroundColor: '#87d068' }} icon={<UserOutlined />} />
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
|
@ -110,7 +110,7 @@ const genBaseStyle: GenerateStyle<AvatarToken> = (token) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const genGroupStyle: GenerateStyle<AvatarToken> = (token) => {
|
const genGroupStyle: GenerateStyle<AvatarToken> = (token) => {
|
||||||
const { componentCls, avatarGroupBorderColor, avatarGroupOverlapping, avatarGroupSpace } = token;
|
const { componentCls, avatarGroupBorderColor, avatarGroupSpace } = token;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
[`${componentCls}-group`]: {
|
[`${componentCls}-group`]: {
|
||||||
@ -118,18 +118,12 @@ const genGroupStyle: GenerateStyle<AvatarToken> = (token) => {
|
|||||||
|
|
||||||
[`${componentCls}`]: {
|
[`${componentCls}`]: {
|
||||||
borderColor: avatarGroupBorderColor,
|
borderColor: avatarGroupBorderColor,
|
||||||
|
|
||||||
[`&:not(:first-child)`]: {
|
|
||||||
marginInlineStart: -avatarGroupOverlapping,
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
|
|
||||||
[`&-popover`]: {
|
[`> *:not(:first-child)`]: {
|
||||||
[`${componentCls} + ${componentCls}`]: {
|
|
||||||
marginInlineStart: avatarGroupSpace,
|
marginInlineStart: avatarGroupSpace,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -162,8 +156,7 @@ export default genComponentStyleHook('Avatar', (token) => {
|
|||||||
avatarFontSizeBase: Math.round((fontSizeLG + fontSizeXL) / 2),
|
avatarFontSizeBase: Math.round((fontSizeLG + fontSizeXL) / 2),
|
||||||
avatarFontSizeLG: fontSizeHeading3,
|
avatarFontSizeLG: fontSizeHeading3,
|
||||||
avatarFontSizeSM: fontSize,
|
avatarFontSizeSM: fontSize,
|
||||||
avatarGroupOverlapping: marginXS,
|
avatarGroupSpace: -marginXS,
|
||||||
avatarGroupSpace: marginXS,
|
|
||||||
avatarGroupBorderColor: colorBorderBg,
|
avatarGroupBorderColor: colorBorderBg,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user