{"size": 1286, "ext": "js", "max_stars_repo_path": "tester/src/components/TutorForm.js", "max_stars_repo_name": "YohanesDemissie/learn-react-native", "max_stars_repo_stars_event_min_datetime": "2018-06-12T06:21:20.000Z", "max_stars_repo_stars_event_max_datetime": "2018-06-12T06:21:20.000Z", "max_issues_repo_path": "tester/src/components/TutorForm.js", "max_issues_repo_name": "YohanesDemissie/learn-react-native", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "tester/src/components/TutorForm.js", "max_forks_repo_name": "YohanesDemissie/learn-react-native", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 1, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 27.3617021277, "max_line_length": 86, "alphanum_fraction": 0.5552099533}
import React, { Component } from 'react'
import { View } from 'react-native'
import { connect } from 'react-redux'
import { tutorUpdate } from '../actions'
import { CardSection, Input } from './common'

class TutorForm extends Component {
  render() {
    return (
      <View>
        <CardSection>
          <Input
            label="Name"
            placeholder="Jane"
            value={this.props.name}
            onChangeText={value => this.props.tutorUpdate({ prop: 'name', value })}
          />
        </CardSection>

        <CardSection>
          <Input
            label="Number"
            placeholder="555-555-5555"
            value={this.props.number}
            onChangeText={value => this.props.tutorUpdate({ prop: 'number', value })}
          />
        </CardSection>

        <CardSection>
          <Input
            label="Subject"
            placeholder="Algebra 201"
            value={this.props.subject}
            onChangeText={value => this.props.tutorUpdate({ prop: 'subject', value })}
          />
        </CardSection>
      </View>
    )
  }
}

const mapStateToProps = ( state ) => {
  const { name, number, subject } = state.tutorForm

  return { name, number, subject }
}
export default connect(mapStateToProps, { tutorUpdate })(TutorForm)