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

feat: add avatar gap api #24357

Merged
merged 6 commits into from
May 25, 2020
Merged

feat: add avatar gap api #24357

merged 6 commits into from
May 25, 2020

Conversation

xrkffgg
Copy link
Member

@xrkffgg xrkffgg commented May 21, 2020

[中文版模板 / Chinese template]

🤔 This is a ...

  • New feature
  • Bug fix
  • Site / documentation update
  • Demo update
  • Component style update
  • TypeScript definition update
  • Bundle size optimization
  • Perfermance optimization
  • Refactoring
  • Code style optimization
  • Test Case
  • Branch merge
  • Other (about what?)

🔗 Related issue link

💡 Background and solution

#24330 (comment)

Demo show

2020-05-21 18 03 29

📝 Changelog

Language Changelog
🇺🇸 English Avatar add new api gap to set the unit distance between left and right sides.
🇨🇳 Chinese Avatar 新增 gap 来设置字符类型距离左右两侧边界单位像素。

☑️ Self Check before Merge

⚠️ Please check all items below before review. ⚠️

  • 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

View rendered components/avatar/demo/dynamic.md
View rendered components/avatar/index.en-US.md
View rendered components/avatar/index.zh-CN.md

@xrkffgg xrkffgg requested a review from afc163 May 21, 2020 10:15
@ant-design-bot
Copy link
Contributor

ant-design-bot commented May 21, 2020

@yoyo837
Copy link
Contributor

yoyo837 commented May 21, 2020

哥,录gif软件是什么?

@xrkffgg
Copy link
Member Author

xrkffgg commented May 21, 2020

哥,录gif软件是什么?

Mac 我用 Gifox
Win 我用 ScreenToGif

@@ -439,6 +439,7 @@ exports[`renders ./components/avatar/demo/dynamic.md correctly 1`] = `
<div>
<span
class="ant-avatar ant-avatar-lg ant-avatar-circle"
gap="4"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

不应该有这个。

}

if (this.lastGap !== gap) {
this.lastGap = gap;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this.lastGap 没什么用。

@@ -22,3 +22,4 @@ title: Avatar
| srcSet | 设置图片类头像响应式资源地址 | string | - | |
| alt | 图像无法显示时的替代文本 | string | - | |
| onError | 图片加载失败的事件,返回 false 会关闭组件默认的 fallback 行为 | () => boolean | - | |
| gap | 字符类型距离左右两侧边界间隙 | number | 4 | 4.3.0 |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

单位像素

) {
return;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

当 childrenWidth 和 nodeWidth 都不变,只修改 gap 时候,不加这个 lastGap ,就直接 return 了
@afc163

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lastGap 没有用到吧,我就看到下面有个赋值。

@xrkffgg xrkffgg changed the title feat: add avatar gap api [WIP] feat: add avatar gap api May 23, 2020
@codecov
Copy link

codecov bot commented May 23, 2020

Codecov Report

Merging #24357 into feature will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff            @@
##           feature   #24357   +/-   ##
========================================
  Coverage    98.75%   98.75%           
========================================
  Files          364      364           
  Lines         7409     7411    +2     
  Branches      2007     2010    +3     
========================================
+ Hits          7317     7319    +2     
  Misses          92       92           
Impacted Files Coverage Δ
components/avatar/index.tsx 98.48% <100.00%> (+0.04%) ⬆️

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 03e6b33...568a6e2. Read the comment docs.

@xrkffgg xrkffgg changed the title [WIP] feat: add avatar gap api feat: add avatar gap api May 23, 2020
@xrkffgg xrkffgg requested a review from afc163 May 23, 2020 09:55
@afc163
Copy link
Member

afc163 commented May 25, 2020

/rebase

@afc163 afc163 merged commit 94edeaa into feature May 25, 2020
@afc163 afc163 deleted the add-avatar-sizePadding branch May 25, 2020 09:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants