{"size": 1402, "ext": "js", "max_stars_repo_path": "app/components/CustomCarousel.js", "max_stars_repo_name": "maki-q/groupflix", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "app/components/CustomCarousel.js", "max_issues_repo_name": "maki-q/groupflix", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "app/components/CustomCarousel.js", "max_forks_repo_name": "maki-q/groupflix", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 28.612244898, "max_line_length": 233, "alphanum_fraction": 0.6291012839}
import React from 'react';
import Carousel from 'react-native-snap-carousel';
import { View, Dimensions, Text, StyleSheet } from 'react-native';
import { MovieCard } from './MovieCard';

export class CustomCarousel extends React.Component {

  constructor(props) {
    super(props);
    this._renderItem = this._renderItem.bind(this)
    this.state = {
      index: 1
    }
  }

  _renderItem({ item }) {
    return <MovieCard data={item} selectVideo={this.props.selectVideo} watched={this.props.watched} your={this.props.your} most={this.props.most} friendsBucket={this.props.friendsBucket} selectedFriends={this.props.selectedFriends}/>
  }

  render() {
    return (
      <View style={styles.container}>
        <Text style={{color: 'white', padding: 10, paddingLeft: 55, fontSize: 18}}>{this.props.title}</Text>
        <Carousel
          ref={(c) => this.carousel = c}
          data={this.props.data}
          renderItem={this._renderItem}
          sliderWidth={Dimensions.get('window').width}
          itemWidth={275}
          containerCustomStyle={styles.carouselContainer}
          inactiveSlideShift={0}
          onSnapToItem={(index) => this.setState({ index })}
          useScrollView={true}
          loop
        />
      </View>
    );
  }
}

const styles = StyleSheet.create({
  container: {
    marginBottom: 50
  },
  itemLabel: {
    color: 'white',
    fontSize: 24
  }
});