ant-design / ant-design-mobile

Essential UI blocks for building mobile web apps.
https://mobile.ant.design
MIT License
11.64k stars 2.4k forks source link

chore: type and code optimize #6378

Closed 1587315093 closed 1 year ago

1587315093 commented 1 year ago

onTap 由 image-viewer.tsx 入口的 props.onClose 传递进去赋值。

onTap 的类型为 onTap: () => void 而 props.onClose 为 onTap?: () => void 是可选的

为了兼容必传类型的 onTap ,image-viewer 传递是 写法是传递了个函数,然后在里面执行 props.onClose?.(),感觉可以修改一下类型和传递源一致

codecov[bot] commented 1 year ago

Codecov Report

Patch coverage: 76.74% and project coverage change: +0.14% :tada:

Comparison is base (c1d4a90) 91.56% compared to head (3219a63) 91.70%. Report is 1 commits behind head on master.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #6378 +/- ## ========================================== + Coverage 91.56% 91.70% +0.14% ========================================== Files 306 306 Lines 6592 6610 +18 Branches 1628 1634 +6 ========================================== + Hits 6036 6062 +26 + Misses 521 512 -9 - Partials 35 36 +1 ``` | [Files Changed](https://app.codecov.io/gh/ant-design/ant-design-mobile/pull/6378?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ant-design) | Coverage Δ | | |---|---|---| | [src/components/image-viewer/slide.tsx](https://app.codecov.io/gh/ant-design/ant-design-mobile/pull/6378?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ant-design#diff-c3JjL2NvbXBvbmVudHMvaW1hZ2Utdmlld2VyL3NsaWRlLnRzeA==) | `69.62% <73.68%> (+11.22%)` | :arrow_up: | | [src/components/image-viewer/image-viewer.tsx](https://app.codecov.io/gh/ant-design/ant-design-mobile/pull/6378?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ant-design#diff-c3JjL2NvbXBvbmVudHMvaW1hZ2Utdmlld2VyL2ltYWdlLXZpZXdlci50c3g=) | `100.00% <100.00%> (+4.65%)` | :arrow_up: | | [src/components/image-viewer/slides.tsx](https://app.codecov.io/gh/ant-design/ant-design-mobile/pull/6378?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ant-design#diff-c3JjL2NvbXBvbmVudHMvaW1hZ2Utdmlld2VyL3NsaWRlcy50c3g=) | `90.24% <100.00%> (-0.24%)` | :arrow_down: |

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

github-actions[bot] commented 1 year ago

PR preview has been successfully built and deployed to https://antd-mobile-preview-pr-6378.surge.sh

github-actions[bot] commented 1 year ago

Deploy PR preview failed.