import React, { Component } from 'react'
import { connect } from 'react-redux'
import {
Banner,
Heading,
Space,
InlineForm,
Text
} from 'rebass'
import { Flex } from 'reflexbox'
import GameBrowser from './gameBrowser'
class App extends Component {
createGame = (e) => {
e.preventDefault()
if (this._gameName !== undefined) {
this.props.createGame(this._gameName)
}
}
render() {
return (
Seven Wonders
this._gameName = e.target.value}
onClick={this.createGame}
>
Username: {this.props.username}
)
}
}
const mapStateToProps = (state) => ({
username: state.players.get('all').get(state.players.get('current')).get('username')
})
import { actions } from '../redux/games'
const mapDispatchToProps = {
createGame: actions.createGame
}
export default connect(mapStateToProps, mapDispatchToProps)(App)