<commit_before>import React, { PropTypes } from 'react'
import { View, ScrollView, Switch, Picker, Text, TouchableOpacity, Image } from 'react-native'
import { connect } from 'react-redux'
import LoginActions, { isLoggedIn } from '../Redux/LoginRedux'
import TemperatureActions from '../Redux/TemperatureRedux'
import MapActions from '../Redux/MapRedux'
import { Actions as NavigationActions } from 'react-native-router-flux'
import { Colors, Images, Metrics } from '../Themes'
import RoundedButton from '../Components/RoundedButton'
import FullButton from '../Components/FullButton'
import MapButtonGroup from '../Components/MapButtonGroup'
import { CheckBox, Card, Button, List, ListItem, ButtonGroup } from 'react-native-elements'
import CustomActionSheet from 'react-native-custom-action-sheet'
import SettingsList from 'react-native-settings-list';

import Icon from 'react-native-vector-icons/FontAwesome'

// Styles
import styles from './Styles/SettingsScreenStyle'

class MaxDurationScreen extends React.Component {

  // constructor (props: Object) {
  //   super(props)
  //   this.state = {
  //     modalVisible: false
  //   }
  // }

  render () {
    return (
      <View style={styles.mainContainer}>
        <Image source={Images.background} style={styles.backgroundImage} resizeMode='stretch' />
        <ScrollView style={styles.container}>
              <Picker
                selectedValue={this.props.map.duration}
                onValueChange={this.props.setMaxDuration}
                style={{backgroundColor: 'white'}}
                >
                <Picker.Item label="30min" value={30} />
                <Picker.Item label="60min" value={60} />
                <Picker.Item label="90min" value={90} />
                <Picker.Item label="120min" value={120} />
                <Picker.Item label="150min" value={150} />
              </Picker>
        </ScrollView>
      </View>
    )
  }
}

const mapStateToProps = (state) => {
  return {
    map: state.map,
    duration: state.duration,
    traffic: state.traffic,
    mileType: state.mileType,
    mapType: state.mapType
  }
}

const mapDispatchToProps = (dispatch) => {
  return {
    setMaxDuration: (duration) => dispatch(MapActions.setMaxDuration(duration))
  }
}

export default connect(mapStateToProps, mapDispatchToProps)(MaxDurationScreen)<commit_msg>Refactor Max duration screen to use .map<commit_after>import React, { PropTypes } from 'react'
import { View, ScrollView, Switch, Picker, Text, TouchableOpacity, Image } from 'react-native'
import { connect } from 'react-redux'
import LoginActions, { isLoggedIn } from '../Redux/LoginRedux'
import TemperatureActions from '../Redux/TemperatureRedux'
import MapActions from '../Redux/MapRedux'
import { Actions as NavigationActions } from 'react-native-router-flux'
import { Colors, Images, Metrics } from '../Themes'
import RoundedButton from '../Components/RoundedButton'
import FullButton from '../Components/FullButton'
import MapButtonGroup from '../Components/MapButtonGroup'
import { CheckBox, Card, Button, List, ListItem, ButtonGroup } from 'react-native-elements'
import CustomActionSheet from 'react-native-custom-action-sheet'
import SettingsList from 'react-native-settings-list';

import Icon from 'react-native-vector-icons/FontAwesome'

// Styles
import styles from './Styles/SettingsScreenStyle'

class MaxDurationScreen extends React.Component {
  render () {
    const { duration, setMaxDuration } = this.props

    return (
      <View style={styles.mainContainer}>
        <Image source={Images.background} style={styles.backgroundImage} resizeMode='stretch' />
        <ScrollView style={styles.container}>
              <Picker
                selectedValue={duration}
                onValueChange={setMaxDuration}
                style={{backgroundColor: 'white'}}
                >
                {[30, 60, 90, 120, 150].map((time, index) => <Picker.Item label={time + "min"} value={time} key={index} />)}
              </Picker>
        </ScrollView>
      </View>
    )
  }
}

const mapStateToProps = (state) => {
  return {
    duration: state.map.duration,
  }
}

const mapDispatchToProps = (dispatch) => {
  return {
    setMaxDuration: (duration) => dispatch(MapActions.setMaxDuration(duration))
  }
}

export default connect(mapStateToProps, mapDispatchToProps)(MaxDurationScreen)
{'fraction_non_alphanumeric': 0.12634716808071544, 'fraction_numerical': 0.008254987388213713, 'mean_word_length': 3.306021717670286, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 30, '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': '1682196', 'n_tokens_mistral': 1265, 'n_tokens_neox': 1211, 'n_words': 292}