Open bakikucukcakiroglu opened 4 months ago
It's looking like this would be the place to implement the thing
I've been struggling with the same thing here. I would love to have the same action buttons in my promise messages, but it lacks a lot of flexibility.
Just found this:
Just found this:
Actually I was aware of that. 'If a user tries to add a custom component to implement description and buttons, they lose the consistent styling provided by the library(also code becomes cumbersome).'
I think implementing description and buttons for promised toasts is a better approach since it also make the developers use the same structure for showing a toast regardless of it is promised or not.
Just found this:
Actually I was aware of that. 'If a user tries to add a custom component to implement description and buttons, they lose the consistent styling provided by the library(also code becomes cumbersome).'
I think implementing description and buttons for promised toasts is a better approach since it also make the developers use the same structure for showing a toast regardless of it is promised or not.
Agreed, the whole point should be to reduce code and take it out of our components
I was just trying to figure this out myself. I was wondering if there is way to add a description and action to loading state?
Just showing the label: 'Loading...' is not sufficient at times. For example: for my usecase, loading state can take minutes, in that case I would want the user to be able to say 'notify me when this completes' or something
Is there a better way to achieve this? Apologies, I am not advance in coding
Feature Request: Enhanced Configuration for toast.promise States
Problem Statement: Currently,
toast.promise
supports basic customization of messages for different states (loading, success, error), but lacks support for detailed configurations like different actions and descriptions for each state. If a user tries to add a custom component to implement description and buttons, they lose the consistent styling provided by the library(also code becomes cumbersome).Using data and error parameters to show a toast description, supplying an action based on the result of the promise would be really elegant. You can make user go to the output's page on success while open logs on error.
Note: Please let me know if there is an easy way of doing that but I'm missing.
Example Usage: