devFind icon indicating copy to clipboard operation
devFind copied to clipboard

make light/dark mode theme persist on refresh

Open KeithBrosch opened this issue 8 months ago • 2 comments

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.

Screenshots

Note to reviewers

KeithBrosch avatar Jun 19 '24 22:06 KeithBrosch