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

Implement DialogOverlay and new ToastProvider #101

Merged
merged 32 commits into from
Jan 20, 2025
Merged

Conversation

mkrause
Copy link
Collaborator

@mkrause mkrause commented Jan 10, 2025

This PR:

  • Implements the DialogOverlay component, which is similar to DialogModal but is a non-modal component. Can be used for dialogs where the background UI should still be interactive. For example, a slide overlay where the user can still open up other items on screen.
  • Overhauls the toast notification system, to resolve an issue where toast notifications would be rendered underneath any elements in the top layer (modals and popovers). I removed the react-toastify dependency (due to this issue) and replaced it with a custom toast notification system. ToastProvider will be automatically portaled to the top-most modal/popover.

TODO:

  • Track popovers and include these as createPortal() targets so that toast notifications don't render below popovers.
  • Investigate performance issue in ModalDialogProvider (React context provider with frequent setState).
  • Add more stories for DialogOverlay (including one with toast notifications).
  • Make sure toast notifications match the Figma. In particular, the copy button is currently inaccurate, must be moved to the footer as a text button. (EDIT: split out to Update toast notification design #111)
  • Reset subject in useWithSubject hooks after overlay has unmounted. (EDIT: split out to *withState() hooks should clear subject state when no longer used #112)

@mkrause mkrause marked this pull request as ready for review January 14, 2025 13:23
@mkrause mkrause changed the title Implement DialogOverlay Implement DialogOverlay and new ToastProvider Jan 14, 2025
@mkrause mkrause requested a review from nighto January 14, 2025 23:49
@mkrause mkrause self-assigned this Jan 15, 2025
Copy link
Collaborator

@nighto nighto left a comment

Choose a reason for hiding this comment

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

LGTM 🚀

@mkrause mkrause merged commit 61a9aa4 into master Jan 20, 2025
3 checks passed
@mkrause mkrause deleted the mkrause/250105-overlays branch January 20, 2025 22:22
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.

2 participants