Skip to content

feat(toast.tsx): Stateless Toast #860

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

Merged
merged 3 commits into from
Jul 18, 2023

Conversation

nigellima
Copy link
Collaborator

Summarize the changes made and the motivation behind them.
This PR adds the ability to convert the Toast component into a stateless mode by providing onDismiss to Toast.Toggle.
It also changes the default hiding behaviour. Now the Toast is removed from the DOM when isRemoved = true. Finally, it adds by default role="alert" to the toast root

Reference related issues using # followed by the issue number.
Fix #848

If there are breaking API changes - like adding or removing props, or changing the structure of the theme - describe them, and provide steps to update existing code.

The theme property root.removed has been removed as it will not be needed anymore.

when onDismiss is given to Toast.Toggle the component will not update ay of its inner states leaving
the dismissal o dev's charge. It also removes the toast from the DOM when isRemoved is true

BREAKING CHANGE: Removing "removed" theme support

Fix themesberg#848
@vercel
Copy link

vercel bot commented Jul 16, 2023

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

Name Status Preview Comments Updated (UTC)
flowbite-react ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 16, 2023 7:19pm

@codecov
Copy link

codecov bot commented Jul 16, 2023

Codecov Report

Patch coverage: 99.78% and project coverage change: -0.02 ⚠️

Comparison is base (7461173) 99.54% compared to head (ba25701) 99.53%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #860      +/-   ##
==========================================
- Coverage   99.54%   99.53%   -0.02%     
==========================================
  Files         163      166       +3     
  Lines        6621     6858     +237     
  Branches      401      416      +15     
==========================================
+ Hits         6591     6826     +235     
- Misses         30       32       +2     
Impacted Files Coverage Δ
src/components/Toast/theme.ts 100.00% <ø> (ø)
src/components/Dropdown/Dropdown.tsx 99.22% <99.41%> (-0.78%) ⬇️
src/components/Button/Button.tsx 100.00% <100.00%> (ø)
src/components/Button/ButtonBase.tsx 100.00% <100.00%> (ø)
src/components/Button/theme.ts 100.00% <100.00%> (ø)
src/components/Card/Card.tsx 100.00% <100.00%> (ø)
src/components/Carousel/Carousel.tsx 99.02% <100.00%> (+0.06%) ⬆️
src/components/DarkThemeToggle/DarkThemeToggle.tsx 100.00% <100.00%> (ø)
src/components/Dropdown/DropdownItem.tsx 100.00% <100.00%> (ø)
src/components/Dropdown/theme.ts 100.00% <100.00%> (ø)
... and 11 more

... and 3 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@rluders rluders merged commit bd4ad89 into themesberg:main Jul 18, 2023
@nigellima nigellima deleted the feat/stateless-toast branch July 18, 2023 17:42
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.

Stateless Toast
2 participants