Skip to content

Commit

Permalink
FIx props flow
Browse files Browse the repository at this point in the history
  • Loading branch information
Nhacsam committed Nov 1, 2017
1 parent b6cf798 commit 0766d13
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/ImageHeaderScrollView.js
Expand Up @@ -5,8 +5,8 @@ import { Animated, ScrollView, StyleSheet, View } from 'react-native';
import _ from 'lodash';

export type Props = {
children: React$Element<any>,
childrenStyle: any,
children?: ?React$Element<any>,
childrenStyle?: ?any,
overlayColor: string,
fadeOutForeground: boolean,
foregroundParallaxRatio: number,
Expand All @@ -17,7 +17,7 @@ export type Props = {
renderFixedForeground: () => React$Element<any>,
renderForeground: () => React$Element<any>,
renderHeader: () => React$Element<any>,
renderTouchableFixedForeground: () => React$Element<any>,
renderTouchableFixedForeground?: ?() => React$Element<any>,
};

export type DefaultProps = {
Expand Down Expand Up @@ -172,10 +172,6 @@ class ImageHeaderScrollView extends Component<Props, State> {
}

renderTouchableFixedForeground() {
if (!this.props.renderTouchableFixedForeground) {
return <View />;
}

const height = this.interpolateOnImageHeight([this.props.maxHeight, this.props.minHeight]);

const headerScale = this.state.scrollY.interpolate({
Expand All @@ -189,6 +185,10 @@ class ImageHeaderScrollView extends Component<Props, State> {
transform: [{ scale: headerScale }],
};

if (!this.props.renderTouchableFixedForeground) {
return <View />;
}

return (
<Animated.View style={[styles.header, styles.touchableFixedForeground, headerTransformStyle]}>
{this.props.renderTouchableFixedForeground()}
Expand Down

0 comments on commit 0766d13

Please sign in to comment.