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

Update AccentColorSelector logic #223

Merged
merged 2 commits into from
Apr 21, 2024
Merged

Update AccentColorSelector logic #223

merged 2 commits into from
Apr 21, 2024

Conversation

AVGVSTVS96
Copy link
Owner

@AVGVSTVS96 AVGVSTVS96 commented Apr 20, 2024

  • Set accent color theme in ReactLayout to prevent FOUC
  • Update AccentColorSelector script
    • Add handleStorageChange function to set localstorage value after it sets theme state
    • Add event listener to localstorage and set theme when it changes and if its not already been set by handleThemeChange function
    • Extract typeof window !== 'undefined' && window.localStorage to a variable called localStorageAccessible to make code clearer and cleaner

Add `handleStorageChange` function to set localstorage value after it sets theme state

Add event listener to localstorage and set theme when it changes and if its not already been set by `handleThemeChange` function

Extract `typeof window !== 'undefined' && window.localStorage` to a variable called `localStorageAccessible` to make code clearer and cleaner
Copy link

codesandbox bot commented Apr 20, 2024

Review or Edit in CodeSandbox

Open the branch in Web EditorVS CodeInsiders

Open Preview

@AVGVSTVS96 AVGVSTVS96 added the enhancement New feature or request label Apr 20, 2024
@AVGVSTVS96 AVGVSTVS96 merged commit 0afbabc into master Apr 21, 2024
1 check passed
@AVGVSTVS96 AVGVSTVS96 deleted the themeBehavior branch April 21, 2024 00:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant