Tiny refactoring

This commit is contained in:
Timur Gibadullin 2017-09-15 11:37:15 +03:00
parent 54ed60f74f
commit c3a11701aa

View File

@ -174,15 +174,12 @@ export default class SortableList extends Component {
const {contentContainerStyle, horizontal, style} = this.props;
const {animated, contentHeight, contentWidth, scrollEnabled} = this.state;
const containerStyle = StyleSheet.flatten([style, {opacity: Number(animated)}])
const innerContainerStyle = [styles.rowsContainer];
const innerContainerStyle = [
styles.rowsContainer,
horizontal ? {width: contentWidth} : {height: contentHeight},
];
let {refreshControl} = this.props;
if (horizontal) {
innerContainerStyle.push({width: contentWidth});
} else {
innerContainerStyle.push({height: contentHeight});
}
if (refreshControl && refreshControl.type === RefreshControl) {
refreshControl = React.cloneElement(this.props.refreshControl, {
enabled: scrollEnabled, // fix for Android