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

[BUG] useNotificationsProvider mui anchor position hard coded #5847

Closed
JoeGaffney opened this issue Apr 14, 2024 · 6 comments · Fixed by #5876 or #5910
Closed

[BUG] useNotificationsProvider mui anchor position hard coded #5847

JoeGaffney opened this issue Apr 14, 2024 · 6 comments · Fixed by #5876 or #5910
Assignees
Labels
bug Something isn't working good first issue Good for newcomers
Milestone

Comments

@JoeGaffney
Copy link

Describe the bug

Anchor position hard coded in mui useNotificationsProvider

    enqueueSnackbar(
      <Box>
        <Typography variant="subtitle2" component="h6">
          {description}
        </Typography>
        <Typography variant="caption" component="p">
          {message}
        </Typography>
      </Box>,
      {
        key,
        variant: type,
        anchorOrigin: {
          vertical: "top",
          horizontal: "right",
        },
        disableWindowBlurListener: true,
      },
    );

image

Ideally should not be hardcode and take from the provider global settings.

Steps To Reproduce

  1. set snackbar Provider anchorOrigin
    <RefineSnackbarProvider
    maxSnack={5}
    anchorOrigin={{ horizontal: "center", vertical: "bottom" }}
    preventDuplicate={true}
    >

Expected behavior

Respect the provider props don't hard code later on the call

Packages

@refinedev/mui

Additional Context

No response

@JoeGaffney JoeGaffney added the bug Something isn't working label Apr 14, 2024
@aliemir
Copy link
Member

aliemir commented Apr 15, 2024

Hey @JoeGaffney, thanks for reporting! I think the step to take here is to move these anchorOrigin, preventDuplicate and disableWindowBlurListener values to RefineSnackbarProvider as default values. This way we can allow customization of those. (autoHideDuration is related with undoableTimeout therefore needs to be there 😅)

Do you want to work on this? We'll be happy to see a PR from you! 🚀

@JoeGaffney
Copy link
Author

Hey @aliemir I'm not sure exactly when I can submit a PR as have a lot of current commitments. If it's still open in a month or so I could do a PR?

Atm I have just made my own notification provider and removed them, so its not a blocker type thing and can be worked around

@aliemir
Copy link
Member

aliemir commented Apr 15, 2024

No problem @JoeGaffney! Let's keep this one open without any assignees in case anyone wants to work on it! 🚀

@aliemir aliemir added the good first issue Good for newcomers label Apr 15, 2024
@omeraplak omeraplak added this to the May Release milestone Apr 17, 2024
@Yash-271120
Copy link
Contributor

@aliemir Hi!
I would like to take up the issue. I am new to refine open source community. This is something I can start with

@aliemir
Copy link
Member

aliemir commented Apr 19, 2024

Hey @Yash-271120, assigning the issue to you! We'll be looking forward for your PR. Don't forget to read our Contributing Guide before you get started 🚀

@Yash-271120
Copy link
Contributor

@aliemir Hey, Good evening!
I have made a PR with respect to this bug and also have made necessary changes to the tests.

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