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

Badge support customize color #15764

Merged
merged 4 commits into from Mar 31, 2019
Merged

Badge support customize color #15764

merged 4 commits into from Mar 31, 2019

Conversation

@zombieJ
Copy link
Member

@zombieJ zombieJ commented Mar 31, 2019

🤔 This is a ...

  • New feature
  • Bug fix
  • Site / document update
  • Component style update
  • TypeScript definition update
  • Refactoring
  • Code style optimization
  • Branch merge
  • Other (about what?)

👻 What's the background?

ref: #15734

💡 Solution

Add new color prop:

 <Badge color="#f50" text="#f50" />
 <Badge color="pink" text="pink" />

📝 Changelog description

  1. Badge support customize color

  2. Badge 支持自定义颜色

☑️ Self Check before Merge

  • Doc is updated/provided or not needed
  • Demo is updated/provided or not needed
  • TypeScript definition is updated/provided or not needed
  • Changelog is provided or not needed
@zombieJ zombieJ requested review from afc163 and ztplz Mar 31, 2019
@codecov
Copy link

@codecov codecov bot commented Mar 31, 2019

Codecov Report

Merging #15764 into feature will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff             @@
##           feature   #15764      +/-   ##
===========================================
+ Coverage    95.04%   95.05%   +<.01%     
===========================================
  Files          250      251       +1     
  Lines         6665     6675      +10     
  Branches      1947     1935      -12     
===========================================
+ Hits          6335     6345      +10     
  Misses         329      329              
  Partials         1        1
Impacted Files Coverage Δ
components/_util/colors.ts 100% <100%> (ø)
components/tag/index.tsx 100% <100%> (ø) ⬆️
components/badge/index.tsx 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c91d7d1...b1d29a2. Read the comment docs.

@netlify
Copy link

@netlify netlify bot commented Mar 31, 2019

Deploy preview for ant-design ready!

Built with commit b1d29a2

https://deploy-preview-15764--ant-design.netlify.com

import Wave from '../_util/wave';

export { CheckableTagProps } from './CheckableTag';

export interface TagProps extends React.HTMLAttributes<HTMLDivElement> {
prefixCls?: string;
className?: string;
color?: string;
color?: PresetColorType | string;
Copy link
Contributor

@ztplz ztplz Mar 31, 2019

其实就是string 你这么写PresetColorType已经没用了

@ztplz
Copy link
Contributor

@ztplz ztplz commented Mar 31, 2019

怪不得我总觉得哪里不对劲 你改的tag的代码 但是你标题是badge?

@zombieJ
Copy link
Member Author

@zombieJ zombieJ commented Mar 31, 2019

@ztplz 是 Badge。Tag 里也有颜色。这边抽出来统一放 _util/colors 里了。

afc163
afc163 approved these changes Mar 31, 2019
@zombieJ zombieJ merged commit 75cd91a into feature Mar 31, 2019
30 checks passed
@delete-merged-branch delete-merged-branch bot deleted the badge-color branch Mar 31, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants