-
Notifications
You must be signed in to change notification settings - Fork 180
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
fix(compass-global-writes): show error on all invalid statuses COMPASS-8451 #6472
Conversation
@@ -49,7 +55,7 @@ export const PluginTitle = ({ showWarning }: { showWarning: boolean }) => { | |||
}} | |||
> | |||
<Icon | |||
glyph="ImportantWithCircle" | |||
glyph={showWarning ? 'Warning' : 'ImportantWithCircle'} |
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.
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.
Done!
@@ -49,7 +55,7 @@ export const PluginTitle = ({ showWarning }: { showWarning: boolean }) => { | |||
}} | |||
> | |||
<Icon | |||
glyph="ImportantWithCircle" | |||
glyph={showWarning ? 'Warning' : 'ImportantWithCircle'} | |||
aria-label="warning" |
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.
Could we make this message and the color of the icon variable as well?
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.
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.
Code quality question, it seems weird that the properties of the Icon are so coupled to each other, should we just pull out a WarningIcon and ErrorIcon or something pre-parameterized? Does this pattern come up a lot in compass?
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.
You're right, with this many differences it makes sense to move the icons into their own function components so that the main render is more readable. And yes that's a common pattern, not only in compass. If your question is more towards reusable components in Compass, check the compass-components
package. But I wouldn't put these in there as the warning = ImportantWithcircle and error = Warning is a bit odd. I'd just keep them in the same file.
Reviewed with Paula this morning - we think this is LGTM once Paula's refactor PR is in. And that PR makes this one easier to merge so it's better to wait. |
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.
The last detail - the colors are the other way around 😅 Otherwise looks great!
Description
Checklist
Motivation and Context
Open Questions
Dependents
Types of changes