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

Add additional toast options to ToastMessage #19

Open
BatyaFeldman opened this issue May 28, 2024 · 1 comment
Open

Add additional toast options to ToastMessage #19

BatyaFeldman opened this issue May 28, 2024 · 1 comment

Comments

@BatyaFeldman
Copy link

BatyaFeldman commented May 28, 2024

Thanks for this super handy library!
Expanding the ToastMessage schema to accommodate additional options would enhance its compatibility with Sonner, react-toastify, and other toast libraries. Currently, any configuration beyond type, description, and message requires handling in the client, limiting customization when integrating the toaster at the root level.

Enabling ToastMessage to accept more options would provide finer control with client-side toast libraries by allowing us to do something like:

jsonWithSuccess(
      {data}, 
      {
         message: "Success",
         description, "Operation Successful",
         duration: 10000
         icon: ....
         onAutoClose: ....
     }
)
@AlemTuzlak
Copy link
Contributor

I've added an optional duration, although I guess that doesn't fully solve this issue, some things can't be fully serialized through the network boundary like functions so onAutoClose could never work as you can't send functions through the network

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

When branches are created from issues, their pull requests are automatically linked.

2 participants