import React, { Component } from 'react' import { connect } from 'react-redux' import { Banner, Heading, Space, Button, InlineForm, Text } from 'rebass' import { Flex } from 'reflexbox' import Modal from '../../components/modals/username' import GameBrowser from './gameBrowser' class App extends Component { state = { usernameModal: false, } componentDidMount() { } toggleModal = (key) => { return (e) => { const val = !this.state[key] this.setState({ [key]: val }) } } 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: Cesar92
) } } const mapStateToProps = (state) => ({ }) import { initializeWs } from "./actions"; import { createGame } from '../GameBrowser/actions' const mapDispatchToProps = { initializeWs, createGame } export default connect(mapStateToProps, mapDispatchToProps)(App)