{"size": 1063, "ext": "js", "max_stars_repo_path": "src/Components/User.js", "max_stars_repo_name": "multiplio/cast-website", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/Components/User.js", "max_issues_repo_name": "multiplio/cast-website", "max_issues_repo_issues_event_min_datetime": "2019-04-30T15:22:52.000Z", "max_issues_repo_issues_event_max_datetime": "2019-11-06T21:34:32.000Z", "max_forks_repo_path": "src/Components/User.js", "max_forks_repo_name": "multiplio/cast-website", "max_forks_repo_forks_event_min_datetime": "2018-11-08T23:16:50.000Z", "max_forks_repo_forks_event_max_datetime": "2018-11-08T23:16:50.000Z"}
{"max_stars_count": null, "max_issues_count": 12, "max_forks_count": 1, "avg_line_length": 24.1590909091, "max_line_length": 71, "alphanum_fraction": 0.5747883349}
import React, { Component } from 'react'
import PropTypes from 'prop-types'
import { StyleSheet, css } from 'aphrodite'
import { observer, inject } from 'mobx-react'
import { Redirect } from 'react-router-dom'

import pallete from '../Styles/pallete'

class User extends Component {
  render () {
    return (
      <div>
        {this.props.user.loaded === true
          ?
          this.props.user.displayName !== null
            ?
            <div className={css(this.props.styles, styles.container)}>
              User: {this.props.user.displayName}
              ProfileImage: {this.props.user.pictureLink}
              <img alt="profile" src={ this.props.user.pictureLink } />
            </div>
            :
            <Redirect to="/login"/>
          :
          null
        }
      </div>
    )
  }
}
User.propTypes = {
  user: PropTypes.object,
  styles: PropTypes.object,
}
export default inject('user')(observer(User))

const styles = StyleSheet.create({
  container: {
    border: '2px solid ' + pallete.blue,
    display: 'inline',
  },
})

