Full width styling for quick actions

Summary: - Used absolute positioning to render full-width quick actions

Reviewed By: fkgozali

Differential Revision: D3302467

fbshipit-source-id: cdcac88b20eff7a71be1ab8bb39e6888216dad84
This commit is contained in:
Fred Liu 2016-05-17 01:35:47 -07:00 committed by Facebook Github Bot 3
parent a52e684121
commit 12fcacb58f
3 changed files with 9 additions and 14 deletions

View File

@ -78,8 +78,8 @@ const styles = StyleSheet.create({
width: 76,
},
image: {
height: 30,
width: 30,
height: 33,
width: 33,
},
text: {
color: '#ffffff',

View File

@ -61,7 +61,6 @@ const SwipeableQuickActions = React.createClass({
const styles = StyleSheet.create({
background: {
alignSelf: 'flex-end',
flex: 1,
flexDirection: 'row',
justifyContent: 'flex-end',

View File

@ -122,13 +122,7 @@ const SwipeableRow = React.createClass({
},
render(): ReactElement {
const slideoutStyle = [
styles.slideOutContainer,
{
right: -this.state.scrollViewWidth,
width: this.state.scrollViewWidth,
},
];
const slideoutStyle = [styles.slideOutContainer];
if (Platform.OS === 'ios') {
slideoutStyle.push({opacity: this.state.isSwipeableViewRendered ? 1 : 0});
}
@ -244,8 +238,7 @@ const SwipeableRow = React.createClass({
_onLayoutChange(event: Object): void {
const width = event.nativeEvent.layout.width;
if (width !== this.state.scrollViewWidth) {
if (width && width !== this.state.scrollViewWidth) {
this.setState({
scrollViewWidth: width,
});
@ -259,9 +252,12 @@ const styles = StyleSheet.create({
flexDirection: 'row',
},
slideOutContainer: {
bottom: 0,
flex: 1,
flexDirection: 'column',
alignItems: 'flex-end',
left: 0,
position: 'absolute',
right: 0,
top: 0,
},
});