react-navigation#ScrollView JavaScript Examples

The following examples show how to use react-navigation#ScrollView. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: shop.js    From haven with MIT License 4 votes vote down vote up
render() {
    const {
      featuredListing = {},
      trendingListing = {},
      bestsellersListing = {},
      gamingListing = {},
      munchiesListing = {},
      devicesListing = {},
      navigation,
    } = this.props;
    const { promoData, refreshing, showCovid, showEULA } = this.state;
    const featuredListings = _.take((featuredListing.data || []).filter(this.filterBlocked), 6);
    const trendingListings = _.take((trendingListing.data || []).filter(this.filterBlocked), 3);
    const bestsellersListings = _.take((bestsellersListing.data || []).filter(this.filterBlocked), 9);
    const gamingListings = _.take((gamingListing.data || []).filter(this.filterBlocked), 9);
    const munchiesListings = _.take((munchiesListing.data || []).filter(this.filterBlocked), 9);
    const devicesListings = _.take((devicesListing.data || []).filter(this.filterBlocked), 9);

    const { showQRButton } = this.state;
    return (
      <View style={screenWrapper.wrapper}>
        <NavigationEvents onDidFocus={this.handleFocus} />
        <SearchHeader
          onRight={this.handleGoToSettings}
          onClick={this.handleTapSearch}
          navigation={navigation}
          showQRButton={showQRButton}
        />
        <ScrollView
          scrollEventThrottle={400}
          refreshControl={
            <RefreshControl
              refreshing={(featuredListing.loading || trendingListing.loading) && refreshing}
              onRefresh={this.onRefresh}
            />
          }
        >
          {Platform.OS === 'android' && false && (
            <Button
              title="Essential supplies needed (COVID-19)"
              textStyle={styles.buttonText}
              wrapperStyle={styles.buttonWrapper}
              onPress={this.handleShowCovid}
            />
          )}
          <MainSlider items={promoData} />
          <CategoryList />
          <Section title="Trending">
            <ProductGrid
              compact
              products={trendingListings}
              keyPrefix="trending"
              toListingDetails={this.toListingDetails('Latest')}
            />
          </Section>
          <Section title="Featured stores">
            <ShopGrid
              shops={this.getFeaturedStores()}
              onPress={this.toExternalStore}
              count={4}
            />
          </Section>
          <Section title="Featured listings">
            <ProductGrid
              compact
              products={featuredListings}
              keyPrefix="featured"
              toListingDetails={this.toListingDetails('Hot')}
            />
          </Section>
          <Section title="Best Sellers">
            <ProductGrid
              compact
              products={bestsellersListings}
              keyPrefix="bestsellers"
              toListingDetails={this.toListingDetails('Bestsellers')}
            />
          </Section>
          <Section title="Gaming">
            <ProductGrid
              compact
              products={gamingListings}
              keyPrefix="gaming"
              toListingDetails={this.toListingDetails('Gaming')}
            />
          </Section>
          <Section title="Munchies">
            <ProductGrid
              compact
              products={munchiesListings}
              keyPrefix="munchies"
              toListingDetails={this.toListingDetails('Munchies')}
            />
          </Section>
          <Section title="Devices">
            <ProductGrid
              compact
              products={devicesListings}
              keyPrefix="devices"
              toListingDetails={this.toListingDetails('Devices')}
            />
          </Section>

          <FlatList
            data={PREVIEWING_CATEGORIES}
            keyExtractor={this.keyExtractor}
            renderItem={this.renderCategoryPreview}
          />
        </ScrollView>
        <CovidModal
          show={showCovid}
          onClose={this.handleCloseCovid}
          onCreateListing={this.handleCreateListing}
          navigation={navigation}
        />
        <EULAModal
          show={showEULA}
          onClose={this.handleCloseEULA}
          navigation={navigation}
        />
      </View>
    );
  }