{"size": 1266, "ext": "js", "max_stars_repo_path": "app/modals/LoginModal.js", "max_stars_repo_name": "himadri-repo/rosaleenapp", "max_stars_repo_stars_event_min_datetime": "2018-08-06T12:44:27.000Z", "max_stars_repo_stars_event_max_datetime": "2018-08-06T12:44:27.000Z", "max_issues_repo_path": "app/modals/LoginModal.js", "max_issues_repo_name": "himadri-repo/rosaleenapp", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "app/modals/LoginModal.js", "max_forks_repo_name": "himadri-repo/rosaleenapp", "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": 22.6071428571, "max_line_length": 65, "alphanum_fraction": 0.5939968404}
//jshint ignore:start
import React, { Component } from 'react';
import {
    Modal
} from 'react-native';
import Login from '../components/Login'
//redux
import {connect} from 'react-redux';
//import {bindActionCreators} from 'redux';


export class LoginModal extends React.Component {
    constructor(props) {
      super(props);

      this.state = {modalVisible: false};

      //alert(this.state.modalVisible);
    }

    componentWillReceiveProps(newProps) {
        //alert(newProps.modalVisible);
        this.setState({modalVisible: newProps.modalVisible});
    }
      
    render() {
        return (
        <Modal
            animationType="slide"
            transparent={false}
            visible={this.state.modalVisible}
            onRequestClose={() => {
                //alert('Hi')
                this.setState({modalVisible: false})
            }}>
            <Login onAuth={this.props.onAuth}/>
        </Modal>
        );
    }
}

function mapStateToProps(state, ownProps) {
    return {
        ...state
    };
}

// function mapDispatchToProps(dispatch, ownProps) {
//     return {
//         someactions: bindActionCreators(userActions, dispatch)
//     }
// }

export default connect(mapStateToProps)(LoginModal);

//jshint ignore:end