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

fix(DarkThemeToggle): should toggle the theme with usePreferences is false (#417) #424

Merged
merged 1 commit into from
Nov 5, 2022

Conversation

XavierChevalier
Copy link

Description

The DarkThemeToggle component's button is now working when usePreferences=true.

Fixes #417

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

  • it should toggle the theme with usePreferences is false

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules
  • I have checked my code and corrected any misspellings

@Bloodysunset
Copy link

Upon review, it seems that the dark theme components were a bit sloppy and overly complicated.

This seems to fix the problem and make it easier to read and understand what is going on in the ThemeContext. Thank you!

@codecov
Copy link

codecov bot commented Nov 5, 2022

Codecov Report

Base: 98.48% // Head: 98.55% // Increases project coverage by +0.06% 🎉

Coverage data is based on head (3370088) compared to base (6ea90f1).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #424      +/-   ##
==========================================
+ Coverage   98.48%   98.55%   +0.06%     
==========================================
  Files         102      102              
  Lines        4300     4280      -20     
  Branches      388      387       -1     
==========================================
- Hits         4235     4218      -17     
+ Misses         65       62       -3     
Impacted Files Coverage Δ
src/lib/components/Flowbite/ThemeContext.tsx 92.30% <100.00%> (+1.71%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

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

@rluders
Copy link
Collaborator

rluders commented Nov 5, 2022

Thanks folks.

@rluders rluders merged commit 37244ff into themesberg:main Nov 5, 2022
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.

DarkThemeToggle component doesn't work when usePreferences is set to false
3 participants