-
Notifications
You must be signed in to change notification settings - Fork 31
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: Set selected theme via query string param #2204
feat: Set selected theme via query string param #2204
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2204 +/- ##
==========================================
+ Coverage 46.73% 46.74% +0.01%
==========================================
Files 693 693
Lines 38594 38602 +8
Branches 9652 9838 +186
==========================================
+ Hits 18038 18046 +8
Misses 20545 20545
Partials 11 11
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
@@ -43,6 +43,7 @@ export type ThemeIconsRequiringManualColorChanges = | |||
|
|||
export const DEFAULT_DARK_THEME_KEY = 'default-dark' satisfies BaseThemeKey; | |||
export const DEFAULT_LIGHT_THEME_KEY = 'default-light' satisfies BaseThemeKey; | |||
export const THEME_KEY_OVERRIDE_QUERY_PARAM = 'themeKey'; |
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.
Should we bother with the Key
part of this param? May as well just call it theme
.
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.
Didn't see a response to this - why not just call it theme
?
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.
ah, didn't see this comment. I have renamed it.
() => | ||
themeKeyOverride ?? | ||
getThemePreloadData()?.themeKey ?? | ||
DEFAULT_DARK_THEME_KEY |
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.
May as well wrap this all in a function, getDefaultTheme
or getDefaultSelectedTheme
. Then this just becomes.
... useState<string>(getDefaultSelectedTheme)
Allow setting selected theme via a
themeKey
query string param.Can test by passing
themeKey=default-light
andthemeKey=default-dark
as query string params.resolves #2203