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

Deprecate isDarkMode in favor of useThemeStore #847

Merged
merged 12 commits into from
Feb 2, 2024

Conversation

srukelman
Copy link
Contributor

@srukelman srukelman commented Dec 25, 2023

Summary

Refactored implementations of isDarkMode() (from helpers) in favor of useThemeStore

Closes #812 #854

Copy link
Member

@MinhxNguyen7 MinhxNguyen7 left a comment

Choose a reason for hiding this comment

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

This mostly looks good other than a different change that slipped into the commit. Also, instead of deprecating isDarkMode() and, therefore, leaving it there, just delete it since nothing uses it.

Because I'm a pedant, I'll say that the the better implementation of appTheme == "dark" would be appTheme.isDark() so that "dark" and "light" aren't magic values. Intellisense tells you, but you ideally shouldn't need Intellisence. I know you didn't write the interface to begin with, so I won't make you do the search-and-replace (but it should be pretty easy). I say it for the sake of future code.

Also, for the future, please fix the merge conflicts so that there is at least one deployment so the reviewer doesn't need to spin up a local instance.

@KevinWu098 KevinWu098 mentioned this pull request Jan 16, 2024
Copy link
Member

@MinhxNguyen7 MinhxNguyen7 left a comment

Choose a reason for hiding this comment

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

Sorry for holding your PR up in review. Everything looks good except for the logic I mentioned. I can't let that slide.

apps/antalmanac/src/stores/SettingsStore.ts Outdated Show resolved Hide resolved
@KevinWu098 KevinWu098 linked an issue Jan 24, 2024 that may be closed by this pull request
Copy link
Member

@MinhxNguyen7 MinhxNguyen7 left a comment

Choose a reason for hiding this comment

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

LGTM!

@MinhxNguyen7 MinhxNguyen7 merged commit f54addd into main Feb 2, 2024
6 checks passed
@EricPedley EricPedley deleted the deprecate-dark-mode branch February 6, 2024 05:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

refactor: themeStore isDarkMode() should be deprecated in favor of ThemeStore
2 participants