{"size": 698, "ext": "js", "max_stars_repo_path": "bachelor-thesis/mobile/app/components/CameraView.android.js", "max_stars_repo_name": "jsimck/uni", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "bachelor-thesis/mobile/app/components/CameraView.android.js", "max_issues_repo_name": "jsimck/uni", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "bachelor-thesis/mobile/app/components/CameraView.android.js", "max_forks_repo_name": "jsimck/uni", "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": 22.5161290323, "max_line_length": 74, "alphanum_fraction": 0.5945558739}
import React, { Component, StyleSheet, View } from 'react-native'
import BarcodeScanner from 'react-native-barcodescanner'

class CameraView extends Component
{
    render() {
        return (
            <BarcodeScanner
                style={styles.preview}
                onBarCodeRead={(event) => this.props.onBarCodeRead(event)}
                cameraType="back">
            </BarcodeScanner>
        );
    }
}

const styles = StyleSheet.create({
    preview: {
        flex: 1,
        flexDirection: 'row',
        alignSelf: 'stretch',
        alignItems: 'center'
    }
});

CameraView.propTypes = {
    // Functions
    onBarCodeRead: React.PropTypes.func
};

export default CameraView