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

Feature/dark-app-logo #4786

Merged
merged 3 commits into from
Nov 1, 2021
Merged

Feature/dark-app-logo #4786

merged 3 commits into from
Nov 1, 2021

Conversation

matthewbcool
Copy link
Contributor

@matthewbcool matthewbcool commented Oct 26, 2021

Gives hubs cloud users the option of uploading an app-logo image for use in their own dark mode. The theme MUST have a "darkModeDefault": true in the top level of the object for this to function properly. This value effectively sets that theme to the default dark theme. We use this theme if the user has not specified a theme and prefers a dark color scheme.

Image from Gyazo

@matthewbcool
Copy link
Contributor Author

resolves #4155, #2773, #3786, #3557

import { getColorSchemePref } from "./get-color-scheme-pref";

function getCurrentTheme() {
if (!Array.isArray(themes)) return;
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm concerned about us missing a check for invalid themes json uploaded to APP_CONFIGS and also about the possibility of missing a default theme. I don't think you need to address these concerns in this PR but wanted to put it on your radar.

import { themes } from "../react-components/styles/theme";
import { getColorSchemePref } from "./get-color-scheme-pref";

function getCurrentTheme() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Would it be a good idea to reuse this function in theme.js (and possibly also move it to that file)?

@@ -0,0 +1,7 @@
import { themes } from "../react-components/styles/theme";

export function getColorSchemePref() {
Copy link
Contributor

Choose a reason for hiding this comment

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

If this is the only use of this function, I would suggest we move it inline to the call site.

@matthewbcool matthewbcool merged commit 5369ce2 into master Nov 1, 2021
@matthewbcool matthewbcool deleted the feature/dark-logo branch November 1, 2021 16:34
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.

2 participants