Prevent SwipeableRow bleed

Summary: Default image icon size for Quick Actions could cause slideout view to bleed over the slideable view. All styling has been removed and must now be passed in, thus allowing every caller to control size for best fit.

Reviewed By: furdei

Differential Revision: D3315696

fbshipit-source-id: 8f8b3d2cf7a005d42a18d434d9e0080c64597be0
This commit is contained in:
Fred Liu 2016-05-18 16:28:32 -07:00 committed by Facebook Github Bot 6
parent dc6a44713d
commit 514677525a

View File

@ -25,7 +25,6 @@
const Image = require('Image');
const React = require('React');
const StyleSheet = require('StyleSheet');
const Text = require('Text');
const TouchableHighlight = require('TouchableHighlight');
const View = require('View');
@ -54,13 +53,13 @@ const SwipeableQuickActionButton = React.createClass({
onPress={this.props.onPress}
testID={this.props.testID}
underlayColor="transparent">
<View style={[styles.button, this.props.style]}>
<View style={this.props.style}>
<Image
accessibilityLabel={this.props.accessibilityLabel}
source={this.props.imageSource}
style={[styles.image, this.props.imageStyle]}
style={this.props.imageStyle}
/>
<Text style={[styles.text, this.props.textStyle]}>
<Text style={this.props.textStyle}>
{this.props.text}
</Text>
</View>
@ -69,22 +68,4 @@ const SwipeableQuickActionButton = React.createClass({
},
});
const styles = StyleSheet.create({
button: {
alignItems: 'center',
flex: 1,
flexDirection: 'column',
width: 76,
},
image: {
height: 33,
width: 33,
},
text: {
color: '#ffffff',
fontSize: 12,
textAlign: 'center', // For Android to align properly
},
});
module.exports = SwipeableQuickActionButton;