import React, { Component } from 'react'
import { connect } from 'react-redux'
import { Heading, InlineForm } from 'rebass'
import { Link } from 'react-router'
class HomePage extends Component {
play = (e) => {
e.preventDefault()
if (this._username !== undefined) {
this.props.chooseUsername(this._username)
}
}
render() {
return (
Enter your username to start playing!
this._username = e.target.value}
onClick={this.play}
/>
/games
Take me somewhere
)
}
}
const mapStateToProps = (state) => ({
})
import { actions } from '../redux/players'
const mapDispatchToProps = {
chooseUsername: actions.chooseUsername
}
export default connect(mapStateToProps, mapDispatchToProps)(HomePage)