diff options
author | Joffrey BION <joffrey.bion@gmail.com> | 2018-06-08 23:34:06 +0200 |
---|---|---|
committer | Joffrey BION <joffrey.bion@gmail.com> | 2018-06-09 12:49:52 +0200 |
commit | 9298af15fdd228c51b1e5765c68c5062687ba96e (patch) | |
tree | 61329a8f0fc31cce85ea804e7c4667762287ddf9 /frontend/src/scenes/GameBrowser/index.js | |
parent | Cleanup the mess (diff) | |
download | seven-wonders-9298af15fdd228c51b1e5765c68c5062687ba96e.tar.gz seven-wonders-9298af15fdd228c51b1e5765c68c5062687ba96e.tar.bz2 seven-wonders-9298af15fdd228c51b1e5765c68c5062687ba96e.zip |
Remove rebass dependency
Diffstat (limited to 'frontend/src/scenes/GameBrowser/index.js')
-rw-r--r-- | frontend/src/scenes/GameBrowser/index.js | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/frontend/src/scenes/GameBrowser/index.js b/frontend/src/scenes/GameBrowser/index.js index 7bb8b59d..5a94e290 100644 --- a/frontend/src/scenes/GameBrowser/index.js +++ b/frontend/src/scenes/GameBrowser/index.js @@ -1,8 +1,8 @@ // @flow +import { Button, Classes, InputGroup, Intent, Text } from '@blueprintjs/core'; import type { List } from 'immutable'; import React, { Component } from 'react'; import { connect } from 'react-redux'; -import { InlineForm, Space, Text } from 'rebass'; import { Flex } from 'reflexbox'; import { GameList } from '../../components/gameList'; import type { Game } from '../../models/games'; @@ -38,20 +38,17 @@ class GameBrowserPresenter extends Component<GameBrowserProps> { return ( <div> <Flex align="center" p={1}> - <InlineForm - buttonLabel="Create Game" - label="Game name" - name="game_name" - onChange={(e: SyntheticInputEvent<*>) => (this._gameName = e.target.value)} - onClick={this.createGame} + <InputGroup + placeholder="Game name" + name="game_name" + onChange={(e: SyntheticInputEvent<*>) => (this._gameName = e.target.value)} + rightElement={<CreateGameButton onClick={this.createGame}/>} /> - <Space auto /> <Text> <b>Username:</b> {' '} {this.props.currentPlayer && this.props.currentPlayer.displayName} </Text> - <Space x={1} /> </Flex> <GameList games={this.props.games} joinGame={this.props.joinGame} /> </div> @@ -59,6 +56,10 @@ class GameBrowserPresenter extends Component<GameBrowserProps> { } } +const CreateGameButton = ({onClick}) => ( + <Button className={Classes.MINIMAL} onClick={onClick} intent={Intent.PRIMARY}>Create Game</Button> +); + const mapStateToProps = state => ({ currentPlayer: getCurrentPlayer(state.get('players')), games: getAllGames(state.get('games')), |