mirror of
https://github.com/status-im/react-native.git
synced 2025-02-05 14:13:26 +00:00
Simplify SwipeableRow styling
Summary: - Removed some styling from `SwipeableRow` that wasn't doing much and made slide out view full height Reviewed By: fkgozali Differential Revision: D3322849 fbshipit-source-id: 811eee9032c142c61d303ae7e966d8ef7903adaf
This commit is contained in:
parent
62e588bece
commit
3ccfb58701
@ -74,6 +74,7 @@ const SwipeableRow = React.createClass({
|
|||||||
* component A to be transparent until component B is loaded.
|
* component A to be transparent until component B is loaded.
|
||||||
*/
|
*/
|
||||||
isSwipeableViewRendered: false,
|
isSwipeableViewRendered: false,
|
||||||
|
rowHeight: (null: ?number),
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -117,7 +118,10 @@ const SwipeableRow = React.createClass({
|
|||||||
let slideOutView;
|
let slideOutView;
|
||||||
if (this.state.isSwipeableViewRendered) {
|
if (this.state.isSwipeableViewRendered) {
|
||||||
slideOutView = (
|
slideOutView = (
|
||||||
<View style={styles.slideOutContainer}>
|
<View style={[
|
||||||
|
styles.slideOutContainer,
|
||||||
|
{height: this.state.rowHeight},
|
||||||
|
]}>
|
||||||
{this.props.slideoutView}
|
{this.props.slideoutView}
|
||||||
</View>
|
</View>
|
||||||
);
|
);
|
||||||
@ -139,8 +143,7 @@ const SwipeableRow = React.createClass({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<View
|
<View
|
||||||
{...this._panResponder.panHandlers}
|
{...this._panResponder.panHandlers}>
|
||||||
style={styles.container}>
|
|
||||||
{slideOutView}
|
{slideOutView}
|
||||||
{swipeableView}
|
{swipeableView}
|
||||||
</View>
|
</View>
|
||||||
@ -151,6 +154,7 @@ const SwipeableRow = React.createClass({
|
|||||||
if (!this.state.isSwipeableViewRendered) {
|
if (!this.state.isSwipeableViewRendered) {
|
||||||
this.setState({
|
this.setState({
|
||||||
isSwipeableViewRendered: true,
|
isSwipeableViewRendered: true,
|
||||||
|
rowHeight: event.nativeEvent.layout.height,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -225,13 +229,8 @@ const SwipeableRow = React.createClass({
|
|||||||
});
|
});
|
||||||
|
|
||||||
const styles = StyleSheet.create({
|
const styles = StyleSheet.create({
|
||||||
container: {
|
|
||||||
flex: 1,
|
|
||||||
flexDirection: 'row',
|
|
||||||
},
|
|
||||||
slideOutContainer: {
|
slideOutContainer: {
|
||||||
bottom: 0,
|
bottom: 0,
|
||||||
flex: 1,
|
|
||||||
left: 0,
|
left: 0,
|
||||||
position: 'absolute',
|
position: 'absolute',
|
||||||
right: 0,
|
right: 0,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user