Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Badge dot with status #44153

Merged
merged 2 commits into from
Aug 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
21 changes: 21 additions & 0 deletions components/badge/__tests__/__snapshots__/demo-extend.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -1674,6 +1674,27 @@ exports[`renders components/badge/demo/mix.tsx extend context correctly 1`] = `
/>
</span>
</div>
<div
class="ant-space-item"
style="margin-right: 16px; padding-bottom: 16px;"
>
<span
class="ant-badge ant-badge-status"
>
<span
class="ant-avatar ant-avatar-lg ant-avatar-square"
>
<span
class="ant-avatar-string"
style="transform: scale(1) translateX(-50%);"
/>
</span>
<sup
class="ant-scroll-number ant-badge-dot ant-badge-status-processing"
data-show="true"
/>
</span>
</div>
<div
class="ant-space-item"
style="margin-right: 16px; padding-bottom: 16px;"
Expand Down
21 changes: 21 additions & 0 deletions components/badge/__tests__/__snapshots__/demo.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -1663,6 +1663,27 @@ exports[`renders components/badge/demo/mix.tsx correctly 1`] = `
/>
</span>
</div>
<div
class="ant-space-item"
style="margin-right:16px;padding-bottom:16px"
>
<span
class="ant-badge ant-badge-status"
>
<span
class="ant-avatar ant-avatar-lg ant-avatar-square"
>
<span
class="ant-avatar-string"
style="opacity:0"
/>
</span>
<sup
class="ant-scroll-number ant-badge-dot ant-badge-status-processing"
data-show="true"
/>
</span>
</div>
<div
class="ant-space-item"
style="margin-right:16px;padding-bottom:16px"
Expand Down
9 changes: 6 additions & 3 deletions components/badge/demo/mix.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ const App: React.FC = () => (
<Badge dot status="warning">
<Avatar shape="square" size="large" />
</Badge>
<Badge dot status="processing">
<Avatar shape="square" size="large" />
</Badge>
<Badge dot color="blue">
<Avatar shape="square" size="large" />
</Badge>
Expand All @@ -32,12 +35,12 @@ const App: React.FC = () => (

<Space size="middle" wrap>
<Badge count={0} showZero />
<Badge count={0} showZero color='blue' />
<Badge count={0} showZero color='#f0f' />
<Badge count={0} showZero color="blue" />
<Badge count={0} showZero color="#f0f" />
<Badge count={0} showZero>
<Avatar shape="square" size="large" />
</Badge>
<Badge count={0} showZero color='blue'>
<Badge count={0} showZero color="blue">
<Avatar shape="square" size="large" />
</Badge>
</Space>
Expand Down
2 changes: 1 addition & 1 deletion components/badge/style/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ const genSharedBadgeStyle: GenerateStyle<BadgeToken> = (token: BadgeToken): CSSO
backgroundColor: token.colorSuccess,
},
[`${componentCls}-status-processing`]: {
position: 'relative',
overflow: 'visible',
color: token.colorPrimary,
backgroundColor: token.colorPrimary,

Expand Down