-
Notifications
You must be signed in to change notification settings - Fork 267
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
refactor: dialog #945
refactor: dialog #945
Conversation
src/packages/dialog/DialogWrap.tsx
Outdated
import Mask from './Mask' | ||
import { OverlayProps, defaultOverlayProps } from '@/packages/overlay/overlay' | ||
import { ComponentDefaults } from '@/utils/typings' | ||
import Overlay from '@/packages/overlay' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
公共的 dialogWrap 需要考虑 taro 版本和 H5 版本的差异。这里引入的 overlay 是 H5的。还是建议分开处理
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
overlay 组件的有些问题,先改overlay,然后调整。
src/packages/dialog/doc.en-US.md
Outdated
| confirmText | Confirm the button copywriting| ReactNode | `Sure` | | ||
| cancelText | Cancellation of buttons | ReactNode | `Cancel` | | ||
| overlay | Whether to show a overlay | boolean | `true` | | ||
| hideConfirmButton| Whether to hide the OK button | boolean | `false` | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
文档中的类型建议加上 ``,例如 boolean 改为 boolean
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
src/packages/dialog/doc.md
Outdated
@@ -42,7 +42,7 @@ const App = () => { | |||
Dialog.alert({ | |||
title: '温馨提示', | |||
content: '支持函数调用和组件调用两种方式。', | |||
noCancelBtn: true | |||
hideCancelButton: true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
文档中的 demo 建议和 demo 保持一致,这样开发者读文档比较容易对应上
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
src/packages/dialog/DialogWrap.tsx
Outdated
onCancel, | ||
onClickOverlay, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
改成 onOverlayClick 和 closeOnOverLay 保持一致
src/packages/dialog/DialogWrap.tsx
Outdated
const wrapStyle = { | ||
...style, | ||
display: visible ? 'block' : 'none', | ||
const overlayStyles = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
就用了一次,应该不需要再声明一个常量
src/packages/dialog/config.ts
Outdated
onCancel?: () => void | ||
onClickSelf?: () => void | ||
beforeClose?: () => void | ||
beforeCancel?: () => void |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
类型不对吧,应该改成 () => boolean
@@ -16,7 +16,7 @@ interface DialogWrapProps extends OverlayProps { | |||
footer: React.ReactNode | |||
onCancel: () => void | |||
onClose: () => void | |||
onClickOverlay: (e: MouseEvent) => boolean | void | |||
onOverlayClick: (e: MouseEvent) => boolean | void |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个类型要改成 boolean | void
🤔 这个变动的性质是?
🔗 相关 Issue
💡 需求背景和解决方案
☑️ 请求合并前的自查清单