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

onNotificationRemoval not getting called #29

Closed
GabrielBB opened this issue Sep 13, 2019 · 4 comments
Closed

onNotificationRemoval not getting called #29

GabrielBB opened this issue Sep 13, 2019 · 4 comments

Comments

@GabrielBB
Copy link

I want to call my function when user clicks the notification. I tried onNotificationRemoval but is not working. Please, if you know some way i can achieve this, let me know asap :/

store.addNotification({
         title: message.firstName + " is inviting you to play",
         message: "Click here to accept",
         type: "default",
         insert: "top",
         width: 400,
         container: "top-right",
         animationIn: ["animated", "fadeIn"],
         animationOut: ["animated", "fadeOut"],
         onNotificationRemoval: () => this.onAcceptInvitation(message)
       });

image

@GabrielBB
Copy link
Author

GabrielBB commented Sep 13, 2019

I could use the container property and use my own component with an onClick event, but then i would have to make that blue pretty design myself, it would make no sense for me to use this library in that case

@teodosii
Copy link
Owner

It does get called, but not in the way you did it. onNotificationRemoval is a prop, not an option you supply to addNotification. And for using custom content, you don't need to make your own design, you just need to use existing classes for styling.

You can workaround a solution for this temporary, but as you shown in this example, it would be useful to have onNotificationRemoval as an option tied to the notification. Will do it in 2.1.0 together with the other issue in progress

teodosii added a commit that referenced this issue Sep 23, 2019
@teodosii
Copy link
Owner

Fixed in 2.1.0 - see changelog/readme

@GabrielBB
Copy link
Author

@teodosii Great! Thanks

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

No branches or pull requests

2 participants