{"size": 1266, "ext": "js", "max_stars_repo_path": "safir/src/components/CarListItem.js", "max_stars_repo_name": "tebyaniyan/safir", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "safir/src/components/CarListItem.js", "max_issues_repo_name": "tebyaniyan/safir", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "safir/src/components/CarListItem.js", "max_forks_repo_name": "tebyaniyan/safir", "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": 24.3461538462, "max_line_length": 113, "alphanum_fraction": 0.5679304897}
import React, {Component} from 'react';
import navigation from '../model/navigation'

import {
    TouchableOpacity,
    Text,
    StyleSheet
} from 'react-native';

class CarListItem extends Component {

    goToCarPage () {
        navigation.main.navigate('Car', { id: this.props.id, title: this.props.title })
    }

    render() {
        return (
            <TouchableOpacity activeOpacity={0.8} style={styles.container} onPress={this.goToCarPage.bind(this)}>
                <Text style={styles.number}>{this.props.number}</Text>
                <Text style={styles.title}>{this.props.title}</Text>
            </TouchableOpacity>
        );
    }
}

const styles = StyleSheet.create({
    container: {
        backgroundColor: 'white',
        width: '94%',
        height: 60,
        marginLeft: '3%',
        marginTop: 13,
        borderRightWidth: 5,
        borderRightColor: '#555',
        justifyContent: 'space-between',
        alignItems: 'center',
        paddingLeft: 20,
        paddingRight: 20,
        flexDirection: 'row',
    },
    title: {
        fontFamily: 'iransans',
        fontSize: 16,
        color: '#208993'
    },
    number: {
        fontFamily: 'iransans',
        color: '#ed5900'
    }
});

export default CarListItem;