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

Fix issue 4593 #4807

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

Yuchaocheng
Copy link
Collaborator

@Yuchaocheng Yuchaocheng commented Mar 29, 2024

close #4593

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

这是您为 Fusion/Next 提的第一个 pr,感谢您为 Fusion 做出的贡献,我们会尽快进行处理。

@eternalsky eternalsky self-requested a review April 30, 2024 02:28
@Yuchaocheng Yuchaocheng force-pushed the fix-issue-4593 branch 2 times, most recently from 0114ee1 to 88d6f6d Compare May 13, 2024 02:38
components/message/__tests__/index-spec.tsx Outdated Show resolved Hide resolved
components/message/__tests__/index-spec.tsx Outdated Show resolved Hide resolved
components/message/__tests__/index-spec.tsx Outdated Show resolved Hide resolved
components/message/__tests__/index-spec.tsx Outdated Show resolved Hide resolved
components/message/__tests__/index-spec.tsx Outdated Show resolved Hide resolved

if (typeof config === 'string' || React.isValidElement(config)) {
newConfig.title = config;
} else if (obj.typeOf(config) === 'Object') {
newConfig = { ...config };
newConfig = { ...(config as MessageQuickProps) };
Copy link
Contributor

Choose a reason for hiding this comment

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

这里同上

components/message/__docs__/index.en-us.md Outdated Show resolved Hide resolved
components/message/types.ts Show resolved Hide resolved
@@ -18,6 +18,8 @@ const MessageProvider = ConfigProvider.config(Message, {
});

export default MessageProvider;
export type { MessageProps, MessageQuickProps } from './types';
export type ContextMessage = typeof toast;
Copy link
Contributor

Choose a reason for hiding this comment

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

这个类型的导出感觉没有必要,typeof 是很容易得的。

components/message/message.tsx Outdated Show resolved Hide resolved
},
afterClose,
});
delay(200).then(() => {
Copy link
Contributor

Choose a reason for hiding this comment

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

delay 在这里没有意义,get 本身就可以等待四秒

Copy link
Contributor

Choose a reason for hiding this comment

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

包括 cy.wrap 也是如此


setTimeout(() => {
assert(document.querySelector('.next-overlay-wrapper .next-message.next-message') !== null);
delay(500).then(() => {
Copy link
Contributor

Choose a reason for hiding this comment

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

此处同上,所有 delay 都没必要加入,不再赘述,如果哪里必须要加 delay,可以找我讨论


// eslint-disable-next-line @typescript-eslint/no-explicit-any
type AnyProps = any;
type ConfigMask = InstanceType<typeof NewMask> | null;
Copy link
Contributor

Choose a reason for hiding this comment

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

ConfigMask 里感觉不应该包含 null,null 应该是在下面和 ConfigMask 并列

components/message/toast.tsx Outdated Show resolved Hide resolved

```js
Copy link
Contributor

Choose a reason for hiding this comment

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

这部分没有了

animation: PropTypes.bool,
locale: PropTypes.object,
rtl: PropTypes.bool,
};
static config: (config: MessageConfig) => void;
Copy link
Contributor

Choose a reason for hiding this comment

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

这四个类方法还是看不懂,如果是外面赋值的,那应该都是放在 assignSubComponents 里的,如果不是,这里又指给了类型没有实现。另外 open 下面那三个确定一下是成员方法还是类方法?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

【Technical upgrade】Message
2 participants