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(notification): addNotice didn't use defaultConfig #1971

Merged

Conversation

lideming
Copy link
Contributor

@lideming lideming commented Dec 9, 2023

What kind of change does this PR introduce? (check at least one)

  • Bugfix

PR description

I was using config() with addNotice(), but the config didn't work.

File utils/notifiaction.ts:

import { Notification } from "@douyinfe/semi-ui";

Notification.config({
  top: "60px",
  right: "10px",
});

export const addNotice = Notification.addNotice.bind(Notification);

And in somewhere else:

// ...
addNotice({ type: "error", /* ... */ });
// ...
addNotice({ type: "info", /* ... */ });
// ...

I never expected addNotice not using the default config until I checked the source code in this repo.

Changelog

🇨🇳 Chinese

  • Fix: Notification.addNotice() 现在使用通过 Notification.config() 设置的全局配置

🇺🇸 English

  • Fix: Notification.addNotice() now uses the default config provided to Notification.config()

Checklist

  • Test or no need
  • Document or [no need]
  • [Changelog] or no need

Other

  • Skip Changelog

Additional information

Copy link

codesandbox-ci bot commented Dec 9, 2023

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 67da6f8:

Sandbox Source
pr-story Configuration
Semi Design: Simple Story Configuration

@DaiQiangReal DaiQiangReal merged commit d3a8f96 into DouyinFE:main Dec 19, 2023
1 check passed
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