-
Notifications
You must be signed in to change notification settings - Fork 67
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: dark/light mode #419
feat: dark/light mode #419
Conversation
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.
https://deploy-preview-419--tph.netlify.app/resources/ it doesn't seem like the theme is changing consistently after refreshing and clicking change theme.
Could you also remove the package-lock changes? We will probably migrate over to yarn eventually
Not sure what to do about the eslint error. I guess everything else should be fixed now. |
src/hooks/useMedia.tsx
Outdated
useEffect(() => { | ||
if (typeof window === "undefined") return | ||
|
||
const mediaQueries = queries.map((query) => window.matchMedia(query)) |
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.
I think it can be fixed the same way other hook does it:
const windowGlobal = typeof window !== "undefined" && window
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.
Aaaah. Good Idea.
Not sure what is happening, tried a couple more ways, still shows the same error. |
ec8bb07
to
ee9b3c5
Compare
✔️ Deploy Preview for tph ready! 🔨 Explore the source changes: e87dd88 🔍 Inspect the deploy log: https://app.netlify.com/sites/tph/deploys/616f1281069699000794b881 😎 Browse the preview: https://deploy-preview-419--tph.netlify.app |
+ read media query for theme preference + improved typing of useLocalStorage hook
fix: lint errors fix: lint error fix: lint error
ee9b3c5
to
e87dd88
Compare
Everything seems to work fine for me, and seems to resolve the issue
Did you find issues with the current preview? |
Should close #360 and hopefully #334