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(toast): add global publisher #177

Merged
merged 1 commit into from
May 27, 2023
Merged

Conversation

mamadoudicko
Copy link
Contributor

Description

This PR enhances the toast system by refactoring it and introduces the use of context to incorporate a global notification publisher.

Checklist before requesting a review

Please delete options that are not relevant.

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented hard-to-understand areas
  • Any dependent changes have been merged

Screenshots (if appropriate):

Screenshot 2023-05-27 at 12 06 50 Screenshot 2023-05-27 at 12 06 43 Screenshot 2023-05-27 at 12 06 28

@vercel
Copy link

vercel bot commented May 27, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
quiver ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 27, 2023 10:18am

Copy link
Collaborator

@StanGirard StanGirard left a comment

Choose a reason for hiding this comment

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

Awesome job. A single use toast 😍

@StanGirard StanGirard merged commit e388990 into main May 27, 2023
2 checks passed
Copy link
Contributor

@adityanandanx adityanandanx left a comment

Choose a reason for hiding this comment

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

Awesome PR!
I would have never thought of being so modular. I have a lot to learn from you. :)

Comment on lines +9 to +19
const toggleToast = (value: boolean, index: number) => {
setToasts((toasts) =>
toasts.map((toast, i) => {
if (i === index) {
toast.open = value;
}
return toast;
})
);
};

Copy link
Contributor

Choose a reason for hiding this comment

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

Can you update toggleToast function to use the id of the toasts instead of index?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oow ! Thanks Man 😄
Fixed it here: #178

StanGirard pushed a commit that referenced this pull request Sep 12, 2023
@StanGirard StanGirard deleted the feat/update-toast-config branch January 20, 2024 06:57
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.

None yet

3 participants