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

feat(mui): configurable anchorOrigin for useNotificationProvider #5876

Merged

Conversation

Yash-271120
Copy link
Contributor

PR Checklist

Please check if your PR fulfills the following requirements:

Bugs / Features

What is the current behavior?

Anchor position,preventDuplicate,disableWindowBlurListener are hard coded in mui useNotificationsProvider

What is the new behavior?

these values can now be provided as per usage

fixes #5847

Notes for reviewers

@Yash-271120 Yash-271120 requested a review from a team as a code owner April 22, 2024 05:34
Copy link

changeset-bot bot commented Apr 22, 2024

🦋 Changeset detected

Latest commit: 3f640a0

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Member

@aliemir aliemir left a comment

Choose a reason for hiding this comment

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

Hey @Yash-271120, thank you for the PR. I think there are some misunderstandings about this issue. Let me try to clarify the changes needed.

  • You've made a change to the notificationProvider type in @refinedev/core. We don't need to have anything changed here.
  • useNotificationProvider of @refinedev/mui should not accept any more parameters. Only the props like anchorOrigin, disableWindowBlurListener etc. will be replaced by the context of RefineSnackbarProvider.
  • The issue requires changes to the <RefineSnackbarProvider /> component. We need to pass these default values as default props to the <RefineSnackbarProvider />. Then those will replace the hardcoded values of useNotificationProvider.

Let me know if you can update this PR to reflect the changes properly 🙏

@Yash-271120
Copy link
Contributor Author

@aliemir what if we remove the harcoded code for anchorOrigin, disableWindowBlurListener and let the default values of these props be handled by the snackbar from notistack itself?

@aliemir
Copy link
Member

aliemir commented Apr 25, 2024

@aliemir what if we remove the harcoded code for anchorOrigin, disableWindowBlurListener and let the default values of these props be handled by the snackbar from notistack itself?

That was actually what I was trying to say 😅 These values will be set as default props of <RefineSnackbarProvider /> and users can override them by passing explicit props.

Can you make the required changes in this PR? I'll mark this PR to be included in our May release if you can provide an update 🙏

Copy link

nx-cloud bot commented Apr 26, 2024

☁️ Nx Cloud Report

CI is running/has finished running commands for commit 3f640a0. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this CI Pipeline Execution


✅ Successfully ran 23 targets

Sent with 💌 from NxCloud.

@Yash-271120
Copy link
Contributor Author

Yash-271120 commented Apr 26, 2024

Hey @aliemir
Sorry I misunderstood previously. Getting back at react after long time. I have updated the PR:- reverted the previous changes and removed the hard coded values and also have updated the tests. Let me know if these require further changes.

@aliemir aliemir changed the title fix(mui): add default values to RefineSnackbarProvider feat(mui): configurable anchorOrigin for useNotificationProvider May 2, 2024
@aliemir aliemir changed the base branch from master to releases/may May 2, 2024 08:39
@aliemir aliemir added this to the May Release milestone May 2, 2024
@aliemir aliemir merged commit 4940b61 into refinedev:releases/may May 2, 2024
16 of 17 checks passed
@aliemir aliemir mentioned this pull request May 2, 2024
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.

[BUG] useNotificationsProvider mui anchor position hard coded
2 participants