-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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
Accept number for size prop in ActivityIndicator #8846
Conversation
By analyzing the blame information on this pull request, we identified @janicduplessis and @javache to be potential reviewers. |
Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla - and if you have received this in error or have any questions, please drop us a line at cla@fb.com. Thanks! |
size="large" | ||
color="#aa3300" | ||
size='large' | ||
color='#aa3300' | ||
/> |
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.
jsx-quotes: Unexpected usage of singlequote.
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks! |
7b5970f
to
0b4d00f
Compare
} | ||
}, | ||
{ | ||
title: 'Custom size (size: 30, scale transform: 1.5)', | ||
render() { | ||
return ( | ||
<ActivityIndicator | ||
style={[styles.centering, {transform: [{scale: 1.5}]}]} |
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.
number This type is incompatible with string
styleAttr="Normal" | ||
indeterminate | ||
/> | ||
{ReturnedActivityIndicator} |
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 don't need to conditionally set the RCTActivityIndicator. just setting the right sizeStyle variable should be enough
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.
thanks @chirag04 !
0b4d00f
to
63af220
Compare
@@ -56,7 +56,7 @@ const ToggleAnimatingActivityIndicator = React.createClass({ | |||
<ActivityIndicator | |||
animating={this.state.animating} | |||
style={[styles.centering, {height: 80}]} | |||
size="large" | |||
size='large' |
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.
jsx-quotes: Unexpected usage of singlequote.
63af220
to
587b07a
Compare
587b07a
to
1d7c3be
Compare
1d7c3be
to
7df46a9
Compare
return ( | ||
<ActivityIndicator | ||
style={styles.centering} | ||
size={48} |
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.
number This type is incompatible with string
7df46a9
to
a4a0d8d
Compare
a4a0d8d
to
de373a3
Compare
c94edb1
to
825343c
Compare
825343c
to
a0e189a
Compare
Previously, size can only accept either 'small' or 'large'. And to obtain a custom size, scale transformation is used. This is to let users to possibly pass number value to define ActivityIndicator's size.
a0e189a
to
6e91039
Compare
var size = props[propName]; | ||
|
||
if (size !== undefined && size !== null && typeof size !== 'number' && size !== 'small' && size !== 'large') { | ||
var locationName = ReactPropTypeLocationNames[location]; |
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-unused-vars: 'locationName' is defined but never used
motivation
Previously, size can only accept either 'small' or 'large'. And to obtain a custom size, scale transformation is used. This is to let users to possibly pass number value directly to define ActivityIndicator's size.
Test plan
I have also modified the current example to reflect the new size prop in action.