summaryrefslogtreecommitdiff
path: root/frontend/src/components/game-browser
diff options
context:
space:
mode:
authorJoffrey BION <joffrey.bion@gmail.com>2019-05-02 21:59:19 +0200
committerJoffrey BION <joffrey.bion@gmail.com>2019-05-02 22:10:01 +0200
commit391d33e6c6d52b5595fd2f9d881c8e4ef9b11312 (patch)
treed4d9bb91ebf343d2f2848f2d2cfc2752d75ac8d7 /frontend/src/components/game-browser
parentAllow no frontend tests (diff)
downloadseven-wonders-391d33e6c6d52b5595fd2f9d881c8e4ef9b11312.tar.gz
seven-wonders-391d33e6c6d52b5595fd2f9d881c8e4ef9b11312.tar.bz2
seven-wonders-391d33e6c6d52b5595fd2f9d881c8e4ef9b11312.zip
Upgrade Blueprintjs to v3
Diffstat (limited to 'frontend/src/components/game-browser')
-rw-r--r--frontend/src/components/game-browser/GameList.css2
-rw-r--r--frontend/src/components/game-browser/GameList.jsx10
-rw-r--r--frontend/src/components/game-browser/PlayerCount.css2
-rw-r--r--frontend/src/components/game-browser/PlayerCount.jsx4
4 files changed, 9 insertions, 9 deletions
diff --git a/frontend/src/components/game-browser/GameList.css b/frontend/src/components/game-browser/GameList.css
index 6b29741f..a04e126c 100644
--- a/frontend/src/components/game-browser/GameList.css
+++ b/frontend/src/components/game-browser/GameList.css
@@ -1,3 +1,3 @@
-table.pt-html-table td {
+tr.gameListRow td {
vertical-align: middle;
}
diff --git a/frontend/src/components/game-browser/GameList.jsx b/frontend/src/components/game-browser/GameList.jsx
index b46cd14c..b797a358 100644
--- a/frontend/src/components/game-browser/GameList.jsx
+++ b/frontend/src/components/game-browser/GameList.jsx
@@ -1,4 +1,5 @@
// @flow
+import { Button, Classes } from '@blueprintjs/core'
import type { List } from 'immutable';
import React from 'react';
import { connect } from 'react-redux';
@@ -6,7 +7,6 @@ import type { ApiLobby } from '../../api/model';
import type { GlobalState } from '../../reducers';
import { actions } from '../../redux/actions/lobby';
import { getAllGames } from '../../redux/games';
-import { IconButton } from '../shared/IconButton';
import './GameList.css';
import { GameStatus } from './GameStatus';
import { PlayerCount } from './PlayerCount';
@@ -17,7 +17,7 @@ type GameListProps = {
};
const GameListPresenter = ({ games, joinGame }: GameListProps) => (
- <table className='pt-html-table'>
+ <table className={Classes.HTML_TABLE}>
<thead>
<GameListHeaderRow />
</thead>
@@ -37,13 +37,13 @@ const GameListHeaderRow = () => (
);
const GameListItemRow = ({game, joinGame}) => (
- <tr>
+ <tr className="gameListRow">
<td>{game.name}</td>
<td>
<GameStatus state={game.state} />
</td>
<td>
- <PlayerCount nbPlayers={game.players.size} />
+ <PlayerCount nbPlayers={game.players.length} />
</td>
<td>
<JoinButton game={game} joinGame={joinGame}/>
@@ -54,7 +54,7 @@ const GameListItemRow = ({game, joinGame}) => (
const JoinButton = ({game, joinGame}) => {
const disabled = game.state !== 'LOBBY';
const onClick = () => joinGame(game.id);
- return <IconButton minimal disabled={disabled} icon='arrow-right' title='Join Game' onClick={onClick}/>;
+ return <Button minimal disabled={disabled} icon='arrow-right' title='Join Game' onClick={onClick}/>;
};
const mapStateToProps = (state: GlobalState) => ({
diff --git a/frontend/src/components/game-browser/PlayerCount.css b/frontend/src/components/game-browser/PlayerCount.css
index ca1a3723..d2f18e50 100644
--- a/frontend/src/components/game-browser/PlayerCount.css
+++ b/frontend/src/components/game-browser/PlayerCount.css
@@ -1,3 +1,3 @@
-svg.pt-icon, .playerCount {
+.playerCountIcon, .playerCount {
vertical-align: middle;
}
diff --git a/frontend/src/components/game-browser/PlayerCount.jsx b/frontend/src/components/game-browser/PlayerCount.jsx
index aa9d1d2f..9a5306d6 100644
--- a/frontend/src/components/game-browser/PlayerCount.jsx
+++ b/frontend/src/components/game-browser/PlayerCount.jsx
@@ -8,6 +8,6 @@ type PlayerCountProps = {
}
export const PlayerCount = ({nbPlayers}: PlayerCountProps) => <div title='Number of players'>
- <Icon icon="people" title={false} />
- <span className='playerCount'> {nbPlayers}</span>
+ <Icon className="playerCountIcon" icon="people" title={false} />
+ <span className="playerCount"> {nbPlayers}</span>
</div>;
bgstack15