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}
/>
Take me somewhere
)
}
}
const mapStateToProps = (state) => ({
})
import { actions } from '../redux/user'
const mapDispatchToProps = {
chooseUsername: actions.chooseUsername
}
export default connect(mapStateToProps, mapDispatchToProps)(HomePage)