-
Notifications
You must be signed in to change notification settings - Fork 21
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
UIE-120 Replace colors with useThemeFromContext in ErrorView and dependants. #4611
Conversation
src/components/ErrorView.js
Outdated
@@ -15,7 +14,6 @@ export const styles = { | |||
}, | |||
jsonFrame: { | |||
padding: '0.5rem', | |||
backgroundColor: colors.light(), |
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.
Since useThemeFromContext is a hook, it needs to be used in a component. Is there any better way of moving backgroundColor out of style and into inline.
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.
my thought would be to change styles here to be a function that accepts the colors object as an argument and returns the desired style props object..
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.
Oooh, I like that. Let me see if I can put something together.
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.
Oh nice, this was my only feedback and it looks like you're already on top of it
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.
No objection to the change itself. The repeated inline use of the same background color raised a little flag
src/components/ErrorView.js
Outdated
@@ -45,7 +46,7 @@ const ErrorView = ({ error }) => { | |||
return h(Fragment, [ | |||
json.message && div({ style: { marginBottom: '1rem' } }, [json.message]), | |||
div({ style: { fontWeight: 600, marginBottom: '0.5rem' } }, ['Full error:']), | |||
div({ style: styles.jsonFrame }, [JSON.stringify(json, null, 2)]), | |||
div({ style: { ...styles.jsonFrame, backgroundColor: colors.light() } }, [JSON.stringify(json, null, 2)]), |
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.
Is this backgroundColor a change or just a refactoring of where it comes from?
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.
and I guess, is there a reason for attaching it directly to the component instead of making it part of a style (or indeed, the jsonFrame
style given the updates below too)?
Quality Gate passedKudos, no new issues were introduced! 0 New issues |
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.
looks great.
Quality Gate passedIssues Measures |
Jira Ticket: UIE-120
Summary of changes:
What
Why
Testing strategy