Merge pull request #235 from sjmueller/master

Rename start & end properties to fix conflict with RN 51
This commit is contained in:
Gant Laborde 2017-12-20 09:53:11 -05:00 committed by GitHub
commit 9e0e1785cf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 12 additions and 12 deletions

View File

@ -24,14 +24,14 @@
self.gradientLayer.colors = colors;
}
- (void)setStart:(CGPoint)start
- (void)setStartPoint:(CGPoint)startPoint
{
self.gradientLayer.startPoint = start;
self.gradientLayer.startPoint = startPoint;
}
- (void)setEnd:(CGPoint)end
- (void)setEndPoint:(CGPoint)endPoint
{
self.gradientLayer.endPoint = end;
self.gradientLayer.endPoint = endPoint;
}
- (void)setLocations:(NSArray *)locations

View File

@ -19,8 +19,8 @@ RCT_EXPORT_MODULE();
}
RCT_EXPORT_VIEW_PROPERTY(colors, NSArray);
RCT_EXPORT_VIEW_PROPERTY(start, CGPoint);
RCT_EXPORT_VIEW_PROPERTY(end, CGPoint);
RCT_EXPORT_VIEW_PROPERTY(startPoint, CGPoint);
RCT_EXPORT_VIEW_PROPERTY(endPoint, CGPoint);
RCT_EXPORT_VIEW_PROPERTY(locations, NSArray);
@end

View File

@ -13,8 +13,8 @@ public class LinearGradientManager extends SimpleViewManager<LinearGradientView>
public static final String REACT_CLASS = "BVLinearGradient";
public static final String PROP_COLORS = "colors";
public static final String PROP_LOCATIONS = "locations";
public static final String PROP_START_POS = "start";
public static final String PROP_END_POS = "end";
public static final String PROP_START_POS = "startPoint";
public static final String PROP_END_POS = "endPoint";
public static final String PROP_BORDER_RADII = "borderRadii";
@Override

View File

@ -89,8 +89,8 @@ export default class LinearGradient extends Component {
<NativeLinearGradient
style={{position: 'absolute', top: 0, left: 0, bottom: 0, right: 0}}
colors={colors.map(processColor)}
start={convertPoint('start', start)}
end={convertPoint('end', end)}
startPoint={convertPoint('start', start)}
endPoint={convertPoint('end', end)}
locations={locations ? locations.slice(0, colors.length) : null}
borderRadii={borderRadiiPerCorner}
/>

View File

@ -72,8 +72,8 @@ export default class LinearGradient extends Component {
<NativeLinearGradient
ref={(component) => { this.gradientRef = component; }}
{...otherProps}
start={convertPoint('start', start)}
end={convertPoint('end', end)}
startPoint={convertPoint('start', start)}
endPoint={convertPoint('end', end)}
colors={colors.map(processColor)}
locations={locations ? locations.slice(0, colors.length) : null}
/>