render()

in js/common/ListContainer.js [87:159]


  render() {
    const segments = [];
    const content = React.Children.map(this.props.children, (child, idx) => {
      segments.push({
        title: child.props.title,
        hasUpdates: child.props.hasUpdates
      });
      return React.cloneElement(child, {
        ref: ref => {
          this._refs[idx] = ref;
        },
        // onScroll: (e) => this.handleScroll(idx, e),
        style: styles.listView,
        showsVerticalScrollIndicator: false,
        scrollEventThrottle: 16,
        // contentInset: {bottom: 141, top: 0},
        automaticallyAdjustContentInsets: false,
        // renderHeader: this.renderFakeHeader,
        scrollsToTop: idx === this.state.idx
      });
    });

    let { stickyHeader } = this.props;
    if (segments.length > 1) {
      stickyHeader = (
        <View>
          <F8SegmentedControl
            values={segments}
            selectedIndex={this.state.idx}
            onChange={this.handleSelectSegment}
            backgroundColor={this.props.headerBackgroundColor}
            textColor={this.props.segmentedTextColor}
            borderColor={this.props.segmentedBorderColor}
          />
          {stickyHeader}
        </View>
      );
    }

    let modalClose;
    if (this.props.modalClose) {
      modalClose = <ActionsOverlay onPress={this.props.modalClose} />;
    }

    return (
      <View style={styles.container}>
        <View style={styles.headerWrapper}>
          <F8Header
            title={this.props.title}
            type={this.props.headerType}
            navItem={this.props.navItem}
            leftItem={this.props.leftItem}
            rightItem={this.props.rightItem}
            extraItems={this.props.extraItems}
            backgroundColor={this.props.headerBackgroundColor}
            titleColor={this.props.headerTitleColor}
            itemsColor={this.props.headerItemsColor}
          >
            {this.props.headerContent}
          </F8Header>
          {stickyHeader}
        </View>
        <ViewPager
          count={segments.length}
          selectedIndex={this.state.idx}
          onSelectedIndexChange={this.handleSelectSegment}
        >
          {content}
        </ViewPager>
        {modalClose}
      </View>
    );
  }