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: support imageRender #248

Merged
merged 1 commit into from
Jun 12, 2023
Merged

Conversation

linxianxi
Copy link
Contributor

@linxianxi linxianxi commented Jun 7, 2023

ant-design/ant-design#27273
ant-design/ant-design#40279

使用 PreviewGroup 的情况下,现在的做法是使用 PreviewGroup 的 imgRender,暴露出 current。看下是否可行

<Image.PreviewGroup preview={{ imgRender: (originalNode, current) => ... }}>
   <Image preview={{ imgRender: ... }} />   // 无效
   <Image />
</Image.PreviewGroup>

@vercel
Copy link

vercel bot commented Jun 7, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
image ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 10, 2023 8:04am

@codecov
Copy link

codecov bot commented Jun 7, 2023

Codecov Report

Merging #248 (a57f75a) into master (8dc4d53) will increase coverage by 0.57%.
The diff coverage is 100.00%.

❗ Current head a57f75a differs from pull request most recent head c966d5b. Consider uploading reports for the commit c966d5b to get more accurate results

@@            Coverage Diff             @@
##           master     #248      +/-   ##
==========================================
+ Coverage   97.72%   98.30%   +0.57%     
==========================================
  Files           7        7              
  Lines         352      354       +2     
  Branches      108      111       +3     
==========================================
+ Hits          344      348       +4     
+ Misses          7        6       -1     
+ Partials        1        0       -1     
Impacted Files Coverage Δ
src/Image.tsx 96.38% <100.00%> (-0.05%) ⬇️
src/Operations.tsx 100.00% <100.00%> (+7.40%) ⬆️
src/Preview.tsx 100.00% <100.00%> (ø)
src/PreviewGroup.tsx 100.00% <100.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@linxianxi
Copy link
Contributor Author

这个我加个 example

@linxianxi
Copy link
Contributor Author

@afc163 这个再看下

README.md Outdated Show resolved Hide resolved
src/PreviewGroup.tsx Outdated Show resolved Hide resolved
src/Preview.tsx Outdated Show resolved Hide resolved
src/Preview.tsx Outdated Show resolved Hide resolved
@linxianxi linxianxi changed the title feat: support imgRender feat: support imageRender Jun 8, 2023
@linxianxi
Copy link
Contributor Author

现在 Image 和 Image.PreviewGroup 的 onVIsibleChange 第三个参数 current 都有,toolbarRender 的 current、total 都有,imageRender 的 current 都有。都从 0 开始。

README.md Outdated Show resolved Hide resolved
@linxianxi linxianxi requested a review from afc163 June 9, 2023 01:58
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.

2 participants