{"size": 658, "ext": "js", "max_stars_repo_path": "src/components/Home.js", "max_stars_repo_name": "mildiemilk/test-bt", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/components/Home.js", "max_issues_repo_name": "mildiemilk/test-bt", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/components/Home.js", "max_forks_repo_name": "mildiemilk/test-bt", "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": 26.32, "max_line_length": 78, "alphanum_fraction": 0.6109422492}
import React from 'react'
import PropTypes from 'prop-types'
import { connect } from 'react-redux'
import { Redirect } from 'react-router-dom'
import { Link } from 'react-router-dom'
import { Message, Blue } from './Styled'

const Home = ({ user }) => {
  return (
    <div>
      {user.token
        ? <Message>{"You're logged in as "}<Blue>{user.email}</Blue></Message>
        : <Redirect to="/login" />}
      <Link to={{ pathname: '/ProfileCompany' }} className="ui button">
        Create Profile
      </Link>
    </div>
  )
}

Home.propTypes = {
  user: PropTypes.shape({}).isRequired,
}
export default connect(state => ({ user: state.user }))(Home)
