-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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(react): adding ability to support theming of datahub, with two themes included OOB #2193
feat(react): adding ability to support theming of datahub, with two themes included OOB #2193
Conversation
@gabe-lyons : looks like there is a build issue |
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.
Slick! LGTM :)
@@ -43,6 +47,14 @@ const client = new ApolloClient({ | |||
}); | |||
|
|||
const App: React.VFC = () => { | |||
const [dynamicThemeConfig, setDynamicThemeConfig] = useState<Theme | null>(null); |
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.
Why not just set this to default?
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 see - is the idea that you can specify a "partial" theme that just overrides the default? This makes sense
const themeConfig = dynamicThemeConfig || defaultThemeConfig; | ||
Object.assign(overridesWithoutPrefix, themeConfig.styles); | ||
Object.keys(overridesWithoutPrefix).forEach((key) => { | ||
overridesWithoutPrefix[key.substring(1)] = overridesWithoutPrefix[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.
Why do we remove the "@" here... what if people don't use the @ when they specify styles?
)} | ||
</EntityRegistryContext.Provider> | ||
</Router> | ||
<ThemeProvider theme={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.
Awesome!
@@ -38,7 +38,7 @@ export const BrowseResults = ({ | |||
const entityRegistry = useEntityRegistry(); | |||
return ( | |||
<div> | |||
<Content style={{ backgroundColor: 'white', padding: '25px 100px' }}> | |||
<Content style={{ padding: '25px 100px' }}> |
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 extract inline styling?
padding: 40px 100px; | ||
`; | ||
|
||
const BodyContainer = styled.div` |
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.
this is great!
@@ -0,0 +1,32 @@ | |||
{ | |||
"styles": { | |||
"@border-radius-base": "4px", |
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.
If someone overrides as "border-radius-base", will this still work?
I still feel the @ convention is a bit confusing
"assets": { | ||
"logoUrl": "/assets/logo.png" | ||
}, | ||
"content": { |
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.
Really like that everything is in one place.
@@ -0,0 +1,32 @@ | |||
export type Theme = { | |||
styles: { | |||
'border-radius-base': string; |
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.
Why don't these require the @ guy?
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.
This is awesome!!!! Great work @gabe-lyons.
Light theme:

Dark theme:



Instructions on how to use in the readme
Checklist