diff options
author | Victor Chabbert <chabbertvi@eisti.eu> | 2017-01-22 12:46:01 +0100 |
---|---|---|
committer | Victor Chabbert <chabbertvi@eisti.eu> | 2017-01-22 12:46:01 +0100 |
commit | 3f2c73cccc554c87bfe39ab706bf01690fb28baf (patch) | |
tree | 2e20d1de318acbda019242a6336495c526ce110f /frontend/src/containers | |
parent | Ans /user/queue/lobby/joined message on game creation (diff) | |
download | seven-wonders-3f2c73cccc554c87bfe39ab706bf01690fb28baf.tar.gz seven-wonders-3f2c73cccc554c87bfe39ab706bf01690fb28baf.tar.bz2 seven-wonders-3f2c73cccc554c87bfe39ab706bf01690fb28baf.zip |
Handle game browser
Diffstat (limited to 'frontend/src/containers')
-rw-r--r-- | frontend/src/containers/app.js | 32 |
1 files changed, 5 insertions, 27 deletions
diff --git a/frontend/src/containers/app.js b/frontend/src/containers/app.js index d2245152..adfc557f 100644 --- a/frontend/src/containers/app.js +++ b/frontend/src/containers/app.js @@ -4,29 +4,13 @@ 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() @@ -53,31 +37,25 @@ class App extends Component { onChange={(e) => this._gameName = e.target.value} onClick={this.createGame} > - </InlineForm> <Space auto /> - <Text><b>Username:</b> Cesar92</Text> + <Text><b>Username:</b> {this.props.username}</Text> <Space x={1} /> - <Button - onClick={this.toggleModal('usernameModal')} - children="Change"/> </Flex> <GameBrowser /> - <Modal toggleModal={this.toggleModal} modalOpen={this.state.usernameModal} /> </div> ) } } const mapStateToProps = (state) => ({ - + username: state.user.get('displayName') }) -import { initializeWs } from "./actions"; -import { createGame } from '../GameBrowser/actions' + +import { actions } from '../redux/game' const mapDispatchToProps = { - initializeWs, - createGame + createGame: actions.createGame } export default connect(mapStateToProps, mapDispatchToProps)(App) |