devFind
devFind copied to clipboard
make light/dark mode theme persist on refresh
Description
Fixed the onClick behavior of the Dark/Light Mode toggle so that the theme persists on refresh.
Related Issues
[#1057]
Changes Proposed
Fixed the behavior of toggleTheme()
within Sidebar.jsx
to make use of our useTheme
hook, and removed redundant lines of code within toggleTheme
.
Now that we're properly using useTheme
, we don't need to explicitly write things like:
htmlElement.classList.remove('dark');
setTheme('light');
because these changes happen dynamically for us already in other parts of the code.
Checklist
- [x] I have read and followed the Contribution Guidelines.
- [x] All new and existing tests passed.
- [x] I have updated the documentation to reflect the changes I've made.
- [x] My code follows the code style of this project.
- [x] The title of my pull request is a short description of the requested changes.