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

refactor: dialog #945

Merged
merged 26 commits into from
Apr 28, 2023
Merged

refactor: dialog #945

merged 26 commits into from
Apr 28, 2023

Conversation

xiaoyatong
Copy link
Collaborator

🤔 这个变动的性质是?

  • 新特性提交
  • 日常 bug 修复
  • 站点、文档改进
  • 演示代码改进
  • 组件样式/交互改进
  • TypeScript 定义更新
  • 包体积优化
  • 性能优化
  • 功能增强
  • 国际化改进
  • 重构
  • 代码风格优化
  • 测试用例
  • 分支合并
  • 其他改动(是关于什么的改动?)

🔗 相关 Issue

💡 需求背景和解决方案

☑️ 请求合并前的自查清单

⚠️ 请自检并全部勾选全部选项⚠️

  • 文档已补充或无须补充
  • 代码演示已提供或无须提供
  • TypeScript 定义已补充或无须补充
  • fock仓库代码是否为最新避免文件冲突
  • Files changed 没有 package.json lock 等无关文件

import Mask from './Mask'
import { OverlayProps, defaultOverlayProps } from '@/packages/overlay/overlay'
import { ComponentDefaults } from '@/utils/typings'
import Overlay from '@/packages/overlay'
Copy link
Collaborator

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的。还是建议分开处理

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

overlay 组件的有些问题,先改overlay,然后调整。

| 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` |
Copy link
Collaborator

Choose a reason for hiding this comment

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

文档中的类型建议加上 ``,例如 boolean 改为 boolean

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

ok

@@ -42,7 +42,7 @@ const App = () => {
Dialog.alert({
title: '温馨提示',
content: '支持函数调用和组件调用两种方式。',
noCancelBtn: true
hideCancelButton: true
Copy link
Collaborator

Choose a reason for hiding this comment

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

文档中的 demo 建议和 demo 保持一致,这样开发者读文档比较容易对应上

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

done

@xiaoyatong xiaoyatong linked an issue Apr 26, 2023 that may be closed by this pull request
onCancel,
onClickOverlay,
Copy link
Collaborator

Choose a reason for hiding this comment

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

改成 onOverlayClick 和 closeOnOverLay 保持一致

const wrapStyle = {
...style,
display: visible ? 'block' : 'none',
const overlayStyles = {
Copy link
Collaborator

Choose a reason for hiding this comment

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

就用了一次,应该不需要再声明一个常量

onCancel?: () => void
onClickSelf?: () => void
beforeClose?: () => void
beforeCancel?: () => void
Copy link
Collaborator

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
Copy link
Collaborator

Choose a reason for hiding this comment

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

这个类型要改成 boolean | void

@oasis-cloud oasis-cloud merged commit 4dd4177 into jdf2e:next Apr 28, 2023
@xiaoyatong xiaoyatong deleted the next-dialog branch September 8, 2023 02:17
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.

关于Dialog 对话框是不是可以新增关闭方法
2 participants