<commit_before>import React, { Component } from 'react'
import { Text, View, ActivityIndicator, StyleSheet, Button, Platform, StatusBar, FlatList } from 'react-native'
import { connect } from 'react-redux'
import TeamCell from './TeamCell'
import NBA from '../../utils/nba'


class StandingsScreen extends Component<Props> {

  constructor() {
    super()

    this.nba = new NBA()
    this.state = {
      loading: true,
      east: [],
      west: []
    }
  }

  componentDidMount() {
    this.getLeagueStandings()
  }

  getLeagueStandings = () => {
    this.nba.getLeagueStandings()
    .then((data) => {
      this.setState({
        east: data.league.standard.conference.east,
        west: data.league.standard.conference.west,
        loading: false
      })
    })
  }

  render() {
    return (
      <View style={{ flex: 1, justifyContent: 'center', alignItems: 'center', backgroundColor: '#242424' }}>
        <StatusBar
          barStyle="light-content"
        />
        <View style={styles.statusBar} />
        {
          this.state.loading &&
          <View style={{ flex: 1, justifyContent: 'center', alignItems: 'center'}}>
            <ActivityIndicator
              size="large"
              color="#F7971E"
            />
          </View>
        }
        {
          (!this.state.loading && this.state.east && this.state.west) &&

          <View style={{ flex: 1, justifyContent: 'center', alignItems: 'center', flexDirection: 'row' }}>
            <View style={styles.conferenceStandings}>
              <View style={styles.conferenceButtons}>
                <Button title="East" style={styles.eastButton} />
                <Button title="West" style={styles.westButton} />
              </View>
              <View style={styles.header}>
                <View style={{ flex: 1, marginLeft: 10 }}>
                  <Text style={{ textAlign: 'center', color: '#D3D3D3' }}> Rank </Text>
                </View>
                <View style={{ flex: 1 }}>
                  <Text style={{ textAlign: 'center', color: '#D3D3D3' }}> Wins </Text>
                </View>
                <View style={{ flex: 1 }}>
                  <Text style={{ textAlign: 'center', color: '#D3D3D3' }}> Loss </Text>
                </View>
                <View style={{ flex: 1 }}>
                  <Text style={{ textAlign: 'center', color: '#D3D3D3' }}> GB </Text>
                </View>
                <View style={{ flex: 1 }}>
                  <Text style={{ textAlign: 'center', color: '#D3D3D3' }}> Streak </Text>
                </View>
              </View>
              <FlatList
                data={this.state.east}
                keyExtractor={team => team.teamId}
                renderItem={(team) => (
                  <TeamCell
                    team={team}
                  />
                )}
              />
            </View>
          </View>
        }
      </View>
    )
  }
}

const styles = StyleSheet.create({
  statusBar: {
    height: (Platform.OS === 'ios') ? 45 : 0,
    backgroundColor: '#F7971E'
  },
  conferenceButtons: {
    flexDirection: 'row',
    justifyContent: 'center',
    alignItems: 'center',
    backgroundColor: 'blue',
  },
  eastButton: {
    flex: 1,
  },
  westButton: {
    flex: 1
  },
  conferenceStandings: {
    flex: 1,
  },
  header: {
    flexDirection: 'row'
  }
})

function mapStateToProps(state) {
  return {
    season: state.date.season
  }
}

function mapDispatchToProps(dispatch) {
  return {

  }
}

export default connect(
  mapStateToProps,
  mapDispatchToProps
)(StandingsScreen)<commit_msg>add buttons for switching between conferences<commit_after>import React, { Component } from 'react'
import { Text, View, ActivityIndicator, StyleSheet, Button, Platform, StatusBar, FlatList } from 'react-native'
import { connect } from 'react-redux'
import TeamCell from './TeamCell'
import NBA from '../../utils/nba'


class StandingsScreen extends Component<Props> {

  constructor() {
    super()

    this.nba = new NBA()
    this.state = {
      loading: true,
      conference: null,
      east: [],
      west: []
    }
  }

  componentDidMount() {
    this.getLeagueStandings()
  }

  getLeagueStandings = () => {
    this.nba.getLeagueStandings()
    .then((data) => {
      this.setState({
        east: data.league.standard.conference.east,
        west: data.league.standard.conference.west,
        loading: false
      })
    })
  }

  _selectConference(conference) {
    this.setState({
      conference: conference
    })
  }

  render() {
    return (
      <View style={{ flex: 1, justifyContent: 'center', alignItems: 'center', backgroundColor: '#242424' }}>
        <StatusBar
          barStyle="light-content"
        />
        <View style={styles.statusBar} />
        {
          this.state.loading &&
          <View style={{ flex: 1, justifyContent: 'center', alignItems: 'center'}}>
            <ActivityIndicator
              size="large"
              color="#F7971E"
            />
          </View>
        }
        {
          (!this.state.loading && this.state.east && this.state.west) &&

          <View style={{ flex: 1, justifyContent: 'center', alignItems: 'center', flexDirection: 'row' }}>
            <View style={styles.conferenceStandings}>
              <View style={styles.conferenceButtons}>
                <View style={styles.eastButton}>
                  <Button
                    title="East"
                    color="#D3D3D3"
                    onPress={() => { this._selectConference('east') }}
                  />
                </View>
                <View style={styles.westButton}>
                  <Button
                    title="West"
                    color="#D3D3D3"
                    onPress={() => { this._selectConference('west') }}
                  />
                </View>
              </View>
              <View style={styles.header}>
                <View style={{ flex: 1, marginLeft: 10 }}>
                  <Text style={{ textAlign: 'center', color: '#D3D3D3' }}> Rank </Text>
                </View>
                <View style={{ flex: 1 }}>
                  <Text style={{ textAlign: 'center', color: '#D3D3D3' }}> Wins </Text>
                </View>
                <View style={{ flex: 1 }}>
                  <Text style={{ textAlign: 'center', color: '#D3D3D3' }}> Loss </Text>
                </View>
                <View style={{ flex: 1 }}>
                  <Text style={{ textAlign: 'center', color: '#D3D3D3' }}> GB </Text>
                </View>
                <View style={{ flex: 1 }}>
                  <Text style={{ textAlign: 'center', color: '#D3D3D3' }}> Streak </Text>
                </View>
              </View>
              <FlatList
                data={this.state.conference === 'east' ? this.state.east : this.state.west}
                keyExtractor={team => team.teamId}
                renderItem={(team) => (
                  <TeamCell
                    team={team}
                  />
                )}
              />
            </View>
          </View>
        }
      </View>
    )
  }
}

const styles = StyleSheet.create({
  statusBar: {
    height: (Platform.OS === 'ios') ? 45 : 0,
    backgroundColor: '#F7971E'
  },
  conferenceButtons: {
    flexDirection: 'row',
    justifyContent: 'center',
    alignItems: 'center',
    marginBottom: 10
  },
  eastButton: {
    flex: 1,
    backgroundColor: '#1F1F1F',
  },
  westButton: {
    flex: 1,
    backgroundColor: '#1F1F1F'
  },
  conferenceStandings: {
    flex: 1,
  },
  header: {
    flexDirection: 'row'
  }
})

function mapStateToProps(state) {
  return {
    season: state.date.season
  }
}

function mapDispatchToProps(dispatch) {
  return {

  }
}

export default connect(
  mapStateToProps,
  mapDispatchToProps
)(StandingsScreen)
{'fraction_non_alphanumeric': 0.14774177085991325, 'fraction_numerical': 0.013268690992600153, 'mean_word_length': 1.7096439681991014, 'pattern_counts': {'":': 0, '<': 87, '<?xml version=': 0, '>': 97, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6980152', 'n_tokens_mistral': 2390, 'n_tokens_neox': 2293, 'n_words': 493}