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: Improve Empty component #15444

Merged
merged 9 commits into from Mar 18, 2019
Merged

feat: Improve Empty component #15444

merged 9 commits into from Mar 18, 2019

Conversation

DiamondYuan
Copy link
Contributor

@DiamondYuan DiamondYuan commented Mar 15, 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?

  1. Describe the source of requirement, like related issue link.

#15442

💡 Solution

  1. How to fix the problem, and list final API implementation and usage sample if that is an new feature.

  2. GIF or snapshot should be provided if includes UI/interactive modification.

📝 Changelog description

Describe changes from userside, and list all potential break changes or other risks.

  1. English description
    empty component support imageSize prop
  2. Chinese description (optional)
    empty 组件支持设定图片尺寸

☑️ 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

@netlify
Copy link

netlify bot commented Mar 15, 2019

Deploy preview for ant-design ready!

Built with commit 77370c4

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

@DiamondYuan DiamondYuan requested a review from afc163 March 15, 2019 18:47
@netlify
Copy link

netlify bot commented Mar 15, 2019

Deploy preview for ant-design ready!

Built with commit 6257fe3

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

@netlify
Copy link

netlify bot commented Mar 15, 2019

Deploy preview for ant-design ready!

Built with commit da7b25c

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

@DiamondYuan
Copy link
Contributor Author

DiamondYuan commented Mar 16, 2019

还缺文档

@codecov
Copy link

codecov bot commented Mar 16, 2019

Codecov Report

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

Impacted file tree graph

@@             Coverage Diff             @@
##           feature   #15444      +/-   ##
===========================================
+ Coverage     94.1%   94.11%   +<.01%     
===========================================
  Files          250      250              
  Lines         6635     6643       +8     
  Branches      1938     1943       +5     
===========================================
+ Hits          6244     6252       +8     
  Misses         390      390              
  Partials         1        1
Impacted Files Coverage Δ
components/config-provider/renderEmpty.tsx 86.66% <100%> (ø) ⬆️
components/empty/index.tsx 96% <100%> (+1.88%) ⬆️

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 68c6982...da7b25c. Read the comment docs.

@DiamondYuan DiamondYuan changed the title feat: empty support imageSize prop feat: Improve Empty component Mar 16, 2019
afc163
afc163 previously approved these changes Mar 16, 2019

## en-US

Customize image, description and extra content.
Customize image source,image size, description and extra content.
Copy link
Contributor

Choose a reason for hiding this comment

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

- source,image size
+ source, image size

absence of a space

@afc163 afc163 merged commit 972840e into feature Mar 18, 2019
@delete-merged-branch delete-merged-branch bot deleted the feat-empty branch March 18, 2019 04:01
@zombieJ
Copy link
Member

zombieJ commented Mar 18, 2019

抱歉看到的有点晚,感觉这些可不可以合到 image 属性里?

  • image="http://..."
  • image={{ simple: true }}
  • image={{ src: 'xxxxxx', style: {{ height: 300 }} }}

image="simple"imageSize 感觉有些散

@afc163
Copy link
Member

afc163 commented Mar 18, 2019

image={{ src: 'xxxxxx', style: {{ height: 300 }} }}

这个还是推荐这样的语法会比较好:image={<image src="xxx" />}

@afc163
Copy link
Member

afc163 commented Mar 18, 2019

或者

<Empty image={Empty.PRESETTED_IMAGE} />

@zombieJ
Copy link
Member

zombieJ commented Mar 18, 2019

这个还是推荐这样的语法会比较好:image={<image src="xxx" />}
或者
<Empty image={Empty.PRESETTED_IMAGE} />

👍 可以的
直接判断是不是 ReactNode 并提供一个内置的 image 感觉刚刚好。

@DiamondYuan ,意下如何?

@DiamondYuan
Copy link
Contributor Author

这个还是推荐这样的语法会比较好:image={<image src="xxx" />}
或者
<Empty image={Empty.PRESETTED_IMAGE} />

👍 可以的
直接判断是不是 ReactNode 并提供一个内置的 image 感觉刚刚好。

@DiamondYuan ,意下如何?

我觉得这样好。等有空了提交一下。

@afc163
Copy link
Member

afc163 commented Mar 18, 2019

那么是 PRESETTED_IMAGE_1 PRESETTED_IMAGE_2 么?

还是 PRESETTED_IMAGES[0]PRESETTED_IMAGES[1]

@zombieJ
Copy link
Member

zombieJ commented Mar 18, 2019

  • PRESETTED_IMAGE_DEFAULT
  • PRESETTED_IMAGE_SIMPLE

这种?

@afc163
Copy link
Member

afc163 commented Mar 18, 2019

可以

@DiamondYuan
Copy link
Contributor Author

  • PRESETTED_IMAGE_DEFAULT

PRESENTED_IMAGE_DEFAULT

PRESENTED_IMAGE_SIMPLE

@DiamondYuan
Copy link
Contributor Author

#15487

转移阵地 Transfer position

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.

None yet

5 participants