-
-
Notifications
You must be signed in to change notification settings - Fork 475
feat(/lib/components/flowbite): remove usePreferences
#582
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(/lib/components/flowbite): remove usePreferences
#582
Conversation
…rk = false Found an issue where userpreferences when set to true overrides dark = false in theme props which is a confusing developer experience fix themesberg#581
Fixes bug with dark = false not working. Removed usePreferences because of potential legal issues due to GDPR BREAKING CHANGE: ThemeProps no longer includes usePreferences fix themesberg#565, fix themesberg#581
Refactored useThemeMode to fetch context state
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #582 +/- ##
=======================================
Coverage ? 99.31%
=======================================
Files ? 131
Lines ? 6387
Branches ? 477
=======================================
Hits ? 6343
Misses ? 44
Partials ? 0
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. |
|
That is a confusing DX for sure. Never mind, I see this has actually been discussed already elsewhere, see #565 |
dark mode before usePreferences
dark mode before usePreferencesusePreferences
# Conflicts: # src/docs/pages/ThemePage.tsx # src/lib/components/Flowbite/ThemeContext.tsx
improve readability and fix merge conflicts. Update documentation for ThemePage themesberg#565
Since we're no longer using localStorage no need to hard check for false
|
LGTM, can you double check this @rluders |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Let's merge it. :)
Found an issue where
usePreferenceswhen set to true overrides dark = false in theme props which is a confusing developer experiencefix #581, fix #565
Description
Removed
usePreferencesand use oflocalStorageinuseThemeModehook for managing dark theme state in theThemeContextFixes #581, #565
Type of change
Bug fix and refactor
Breaking changes
usePreferencesfromThemePropuseThemeModehookHow Has This Been Tested?
yarn startsrc/index.tsxset darkThemePropasdark: falseChecklist: