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 коммит произвёл Facebook Github Bot 3
Родитель a52e684121
Коммит 12fcacb58f
3 изменённых файлов: 9 добавлений и 14 удалений

Просмотреть файл

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

Просмотреть файл

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

Просмотреть файл

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