-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
refactor: Add "style" to StandardProps and implement in all components #219
Conversation
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.
A few comments, mostly the same issue really.
} | ||
|
||
return {width: '100%'} | ||
return {...style, width: '100%'} |
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 default should be reversed, {width: '100%', ...style}
, so width can be overridden if provided.
|
||
interface Props extends StandardProps { | ||
/** Icon to display */ | ||
glyph: IconFont | string | ||
/** Optional color string, can use InfluxColors enum or pass in your own value */ | ||
color?: InfluxColors | 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.
This might be a breaking change, we'll need to keep a tab on this when updating the libraries. Maybe also call it out specifically in the patch notes.
} | ||
|
||
return {width: '100%'} | ||
return {...style, width: '100%'} |
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 default should be reversed, {width: '100%', ...style}
, so width can be overridden if provided.
} | ||
|
||
return {width: '100%'} | ||
return {...style, width: '100%'} |
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 default should be reversed, {width: '100%', ...style}
, so width can be overridden if provided.
|
||
return {maxWidth: `${maxWidth}px`} | ||
return {...style, maxWidth: `${maxWidth}px`} |
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.
...style
should be the last item in the default return.
|
||
const borderWidth = `${this.strokeWidth}px` | ||
const width = `${diameterPixels}px` | ||
const height = `${diameterPixels}px` | ||
|
||
return {width, height, borderWidth} | ||
return {...style, width, height, borderWidth} |
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.
...style
should be the last item in the default.
|
||
return {width} | ||
return {...style, width} |
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.
...style
should be the last item in the default.
|
||
return { | ||
...style, |
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.
...style
should be the last item in the default.
|
||
return { | ||
...style, |
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.
...style
should be the last item in the default.
@@ -74,7 +74,7 @@ export class TextBlock extends Component<Props> { | |||
color = `${textColor}` | |||
} | |||
|
|||
return {backgroundColor, color} | |||
return {...style, backgroundColor, color} |
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.
...style
should be the last item in the default.
Closes #217
Closes #213
Changes
style
toStandardProps
style
prop was being passed into the outermost element (in most cases)className
prop was being passed through correctly inTextArea
TextBlock
andIcon
components to exposestyle
propChecklist
Check all that apply