render()

in src/components/baseScreen.tsx [38:104]


  render() {
    const createButtonView = (buttonProps) => {
      if (buttonProps) {
        const onPress = () => {
          if (buttonProps.onPress) {
            buttonProps.onPress();
          }
        };

        return (
          <View style={styles.buttonView}>
            <TouchableOpacity style={styles.button} onPress={onPress}>
              <Text style={styles.buttonText}>{buttonProps.text}</Text>
            </TouchableOpacity>
          </View>
        );
      }
    };

    const bottomButtonView = createButtonView(this.props.options.bottomContainer.bottomButton);
    const topButtonView = createButtonView(this.props.options.bottomContainer.topButton);
    let codePushComponent;
    const self = this;
    if (this.props.options.codepush) {
      codePushComponent = (
        <CodePush
          ref={(codepush) => {
            self.codepush = codepush;
          }}
        />
      );
    }

    return (
      <View style={{ flex: 1, ...ifIphoneX({ paddingTop: 30 }, { paddingTop: 0 }) }}>
        <View style={styles.headerContainer}>
          <View style={{ flex: 1 }} />
          <View style={styles.headerTextContainer}>
            <Text style={styles.headerText}>{this.props.options.title}</Text>
          </View>
        </View>
        <View
          style={{
            height: this.props.options.topContainer.height,
            backgroundColor: this.props.options.topContainer.backgroundColor
          }}
        >
          <Image style={styles.topImage} source={this.props.options.topContainer.imageSource} />
        </View>
        <View
          style={{
            flex: 1,
            backgroundColor: this.props.options.bottomContainer.backgroundColor
          }}
        >
          <Text style={[styles.descriptionText, styles.mainText]}>{this.props.options.bottomContainer.description}</Text>
          <View style={{ flex: 2 }}>
            <View style={{ flex: 1 }} />
            {codePushComponent}
            {topButtonView}
            {bottomButtonView}
            <View style={{ height: 40 }} />
          </View>
        </View>
      </View>
    );
  }