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

feat: dark/light mode #419

Conversation

SagnikPradhan
Copy link
Contributor

Should close #360 and hopefully #334

Copy link
Member

@Xetera Xetera left a 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

@SagnikPradhan SagnikPradhan marked this pull request as draft October 3, 2021 04:26
@SagnikPradhan SagnikPradhan marked this pull request as ready for review October 3, 2021 04:55
@SagnikPradhan
Copy link
Contributor Author

Not sure what to do about the eslint error. I guess everything else should be fixed now.

useEffect(() => {
if (typeof window === "undefined") return

const mediaQueries = queries.map((query) => window.matchMedia(query))
Copy link
Collaborator

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aaaah. Good Idea.

@SagnikPradhan
Copy link
Contributor Author

Not sure what is happening, tried a couple more ways, still shows the same error.

@veksen veksen force-pushed the feat/system-theme-preference branch from ec8bb07 to ee9b3c5 Compare October 19, 2021 18:40
@netlify
Copy link

netlify bot commented Oct 19, 2021

✔️ 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

@veksen veksen force-pushed the feat/system-theme-preference branch from ee9b3c5 to e87dd88 Compare October 19, 2021 18:46
@veksen
Copy link
Collaborator

veksen commented Oct 19, 2021

Everything seems to work fine for me, and seems to resolve the issue

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

Did you find issues with the current preview?

@veksen veksen merged commit 74ba5c4 into the-programmers-hangout:master Oct 19, 2021
@SagnikPradhan SagnikPradhan deleted the feat/system-theme-preference branch October 20, 2021 14:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature] Use system preferences for dark mode
3 participants