diff options
author | Joffrey BION <joffrey.bion@gmail.com> | 2019-05-02 21:59:19 +0200 |
---|---|---|
committer | Joffrey BION <joffrey.bion@gmail.com> | 2019-05-02 22:10:01 +0200 |
commit | 391d33e6c6d52b5595fd2f9d881c8e4ef9b11312 (patch) | |
tree | d4d9bb91ebf343d2f2848f2d2cfc2752d75ac8d7 | |
parent | Allow no frontend tests (diff) | |
download | seven-wonders-391d33e6c6d52b5595fd2f9d881c8e4ef9b11312.tar.gz seven-wonders-391d33e6c6d52b5595fd2f9d881c8e4ef9b11312.tar.bz2 seven-wonders-391d33e6c6d52b5595fd2f9d881c8e4ef9b11312.zip |
Upgrade Blueprintjs to v3
-rw-r--r-- | frontend/package.json | 4 | ||||
-rw-r--r-- | frontend/src/components/game-browser/GameList.css | 2 | ||||
-rw-r--r-- | frontend/src/components/game-browser/GameList.jsx | 10 | ||||
-rw-r--r-- | frontend/src/components/game-browser/PlayerCount.css | 2 | ||||
-rw-r--r-- | frontend/src/components/game-browser/PlayerCount.jsx | 4 | ||||
-rw-r--r-- | frontend/src/components/home/ChooseNameForm.jsx | 5 | ||||
-rw-r--r-- | frontend/src/components/lobby/PlayerList.jsx | 4 | ||||
-rw-r--r-- | frontend/src/components/shared/IconButton.jsx | 19 | ||||
-rw-r--r-- | frontend/yarn.lock | 104 |
9 files changed, 100 insertions, 54 deletions
diff --git a/frontend/package.json b/frontend/package.json index 31113835..60136c9b 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -11,8 +11,8 @@ "react-scripts": "3.0.0" }, "dependencies": { - "@blueprintjs/core": "^2.3.1", - "@blueprintjs/icons": "^2.2.1", + "@blueprintjs/core": "^3.15.1", + "@blueprintjs/icons": "^3.8.0", "history": "^4.7.2", "http-proxy-middleware": "^0.19.1", "immutable": "^3.8.1", 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>; diff --git a/frontend/src/components/home/ChooseNameForm.jsx b/frontend/src/components/home/ChooseNameForm.jsx index 13f6034b..71279e35 100644 --- a/frontend/src/components/home/ChooseNameForm.jsx +++ b/frontend/src/components/home/ChooseNameForm.jsx @@ -1,9 +1,8 @@ // @flow -import { Classes, InputGroup, Intent } from '@blueprintjs/core'; +import { Button, Classes, InputGroup, Intent } from '@blueprintjs/core'; import React, { Component } from 'react'; import { connect } from 'react-redux'; import { actions } from '../../redux/actions/user'; -import { IconButton } from '../shared/IconButton'; type ChooseNameFormPresenterProps = { chooseUsername: (username: string) => void, @@ -33,7 +32,7 @@ class ChooseNameFormPresenter extends Component<ChooseNameFormPresenterProps> { } renderSubmit = () => ( - <IconButton className={Classes.MINIMAL} onClick={this.play} intent={Intent.PRIMARY} icon="arrow-right" /> + <Button className={Classes.MINIMAL} onClick={this.play} intent={Intent.PRIMARY} icon="arrow-right" /> ); } diff --git a/frontend/src/components/lobby/PlayerList.jsx b/frontend/src/components/lobby/PlayerList.jsx index bd37f40d..80212a3e 100644 --- a/frontend/src/components/lobby/PlayerList.jsx +++ b/frontend/src/components/lobby/PlayerList.jsx @@ -1,5 +1,5 @@ //@flow -import { Icon } from '@blueprintjs/core' +import { Classes, Icon } from '@blueprintjs/core' import { List } from 'immutable'; import * as React from 'react'; import { Flex } from 'reflexbox'; @@ -25,7 +25,7 @@ const PlayerListItem = ({player, isOwner, isUser}) => ( ); export const PlayerList = ({players, owner, currentPlayer}: PlayerListProps) => ( - <table className='pt-html-table'> + <table className={Classes.HTML_TABLE}> <tbody> {players.map(player => <PlayerListItem key={player.username} player={player} diff --git a/frontend/src/components/shared/IconButton.jsx b/frontend/src/components/shared/IconButton.jsx deleted file mode 100644 index 3031720a..00000000 --- a/frontend/src/components/shared/IconButton.jsx +++ /dev/null @@ -1,19 +0,0 @@ -//@flow -import { Button, Icon } from '@blueprintjs/core'; -import type { IconName } from '@blueprintjs/icons'; -import * as React from 'react'; - -type IconButtonProps = { - icon: IconName, - title?: string | false | null, - [string]: any, -} - -export const IconButton = ({icon, title, ...props}: IconButtonProps) => { - if (title) { - // this works around https://github.com/palantir/blueprint/issues/2321 - const iconWithoutTitle = <Icon icon={icon} title={false} />; - return <Button {...props} icon={iconWithoutTitle} title={title} />; - } - return <Button {...props} icon={icon} />; -}; diff --git a/frontend/yarn.lock b/frontend/yarn.lock index d7010fe9..351520d0 100644 --- a/frontend/yarn.lock +++ b/frontend/yarn.lock @@ -970,7 +970,7 @@ dependencies: regenerator-runtime "^0.13.2" -"@babel/runtime@^7.0.0", "@babel/runtime@^7.3.4", "@babel/runtime@^7.4.2": +"@babel/runtime@^7.0.0", "@babel/runtime@^7.1.2", "@babel/runtime@^7.3.4", "@babel/runtime@^7.4.2": version "7.4.4" resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.4.4.tgz#dc2e34982eb236803aa27a07fea6857af1b9171d" dependencies: @@ -1036,22 +1036,24 @@ lodash "^4.17.11" to-fast-properties "^2.0.0" -"@blueprintjs/core@^2.3.1": - version "2.3.1" - resolved "https://registry.yarnpkg.com/@blueprintjs/core/-/core-2.3.1.tgz#c998f8d22b02bfc9990b66b201f1ea095fb15450" +"@blueprintjs/core@^3.15.1": + version "3.15.1" + resolved "https://registry.yarnpkg.com/@blueprintjs/core/-/core-3.15.1.tgz#9792e9fb7e2e066dd5339fadeaf2f85b1485832a" dependencies: - "@blueprintjs/icons" "^2.2.1" - "@types/dom4" "^2.0.0" + "@blueprintjs/icons" "^3.8.0" + "@types/dom4" "^2.0.1" classnames "^2.2" dom4 "^2.0.1" normalize.css "^8.0.0" popper.js "^1.14.1" - react-popper "^0.8.2" + react-popper "^1.0.0" + react-transition-group "^2.2.1" + resize-observer-polyfill "^1.5.0" tslib "^1.9.0" -"@blueprintjs/icons@^2.2.1": - version "2.2.1" - resolved "https://registry.yarnpkg.com/@blueprintjs/icons/-/icons-2.2.1.tgz#1b4275fc67467218a8ffec6403c87c7af24532a5" +"@blueprintjs/icons@^3.8.0": + version "3.8.0" + resolved "https://registry.yarnpkg.com/@blueprintjs/icons/-/icons-3.8.0.tgz#7c77c67e4a241740f803f05e4f6e3ce43c6d6560" dependencies: classnames "^2.2" tslib "^1.9.0" @@ -1372,9 +1374,9 @@ dependencies: "@babel/types" "^7.3.0" -"@types/dom4@^2.0.0": - version "2.0.0" - resolved "https://registry.yarnpkg.com/@types/dom4/-/dom4-2.0.0.tgz#00dc42fed6b36a7a6dabb8f7a9c9e678ee644e05" +"@types/dom4@^2.0.1": + version "2.0.1" + resolved "https://registry.yarnpkg.com/@types/dom4/-/dom4-2.0.1.tgz#506d5781b9bcab81bd9a878b198aec7dee2a6033" "@types/istanbul-lib-coverage@^2.0.0": version "2.0.1" @@ -2973,6 +2975,13 @@ create-hmac@^1.1.0, create-hmac@^1.1.2, create-hmac@^1.1.4: safe-buffer "^5.0.1" sha.js "^2.4.8" +create-react-context@<=0.2.2: + version "0.2.2" + resolved "https://registry.yarnpkg.com/create-react-context/-/create-react-context-0.2.2.tgz#9836542f9aaa22868cd7d4a6f82667df38019dca" + dependencies: + fbjs "^0.8.0" + gud "^1.0.0" + cross-env@^5.2.0: version "5.2.0" resolved "https://registry.yarnpkg.com/cross-env/-/cross-env-5.2.0.tgz#6ecd4c015d5773e614039ee529076669b9d126f2" @@ -3499,6 +3508,12 @@ dom-helpers@^3.3.1: version "3.3.1" resolved "https://registry.yarnpkg.com/dom-helpers/-/dom-helpers-3.3.1.tgz#fc1a4e15ffdf60ddde03a480a9c0fece821dd4a6" +dom-helpers@^3.4.0: + version "3.4.0" + resolved "https://registry.yarnpkg.com/dom-helpers/-/dom-helpers-3.4.0.tgz#e9b369700f959f62ecde5a6babde4bccd9169af8" + dependencies: + "@babel/runtime" "^7.1.2" + dom-serializer@0: version "0.1.0" resolved "https://registry.yarnpkg.com/dom-serializer/-/dom-serializer-0.1.0.tgz#073c697546ce0780ce23be4a28e293e40bc30c82" @@ -4267,6 +4282,18 @@ fb-watchman@^2.0.0: dependencies: bser "^2.0.0" +fbjs@^0.8.0: + version "0.8.17" + resolved "https://registry.yarnpkg.com/fbjs/-/fbjs-0.8.17.tgz#c4d598ead6949112653d6588b01a5cdcd9f90fdd" + dependencies: + core-js "^1.0.0" + isomorphic-fetch "^2.1.1" + loose-envify "^1.0.0" + object-assign "^4.1.0" + promise "^7.1.1" + setimmediate "^1.0.5" + ua-parser-js "^0.7.18" + fbjs@^0.8.16: version "0.8.16" resolved "https://registry.yarnpkg.com/fbjs/-/fbjs-0.8.16.tgz#5e67432f550dc41b572bf55847b8aca64e5337db" @@ -4769,6 +4796,10 @@ growly@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/growly/-/growly-1.3.0.tgz#f10748cbe76af964b7c96c93c6bcc28af120c081" +gud@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/gud/-/gud-1.0.0.tgz#a489581b17e6a70beca9abe3ae57de7a499852c0" + gzip-size@5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/gzip-size/-/gzip-size-5.0.0.tgz#a55ecd99222f4c48fd8c01c625ce3b349d0a0e80" @@ -7511,10 +7542,14 @@ pnp-webpack-plugin@1.2.1: dependencies: ts-pnp "^1.0.0" -popper.js@^1.12.9, popper.js@^1.14.1: +popper.js@^1.14.1: version "1.14.3" resolved "https://registry.yarnpkg.com/popper.js/-/popper.js-1.14.3.tgz#1438f98d046acf7b4d78cd502bf418ac64d4f095" +popper.js@^1.14.4: + version "1.15.0" + resolved "https://registry.yarnpkg.com/popper.js/-/popper.js-1.15.0.tgz#5560b99bbad7647e9faa475c6b8056621f5a4ff2" + portfinder@^1.0.9: version "1.0.13" resolved "https://registry.yarnpkg.com/portfinder/-/portfinder-1.0.13.tgz#bb32ecd87c27104ae6ee44b5a3ccbf0ebb1aede9" @@ -8458,12 +8493,16 @@ react-lifecycles-compat@^3.0.4: version "3.0.4" resolved "https://registry.yarnpkg.com/react-lifecycles-compat/-/react-lifecycles-compat-3.0.4.tgz#4f1a273afdfc8f3488a8c516bfda78f872352362" -react-popper@^0.8.2: - version "0.8.3" - resolved "https://registry.yarnpkg.com/react-popper/-/react-popper-0.8.3.tgz#0f73333137c9fb0af6ec4074d2d0585a0a0461e1" +react-popper@^1.0.0: + version "1.3.3" + resolved "https://registry.yarnpkg.com/react-popper/-/react-popper-1.3.3.tgz#2c6cef7515a991256b4f0536cd4bdcb58a7b6af6" dependencies: - popper.js "^1.12.9" - prop-types "^15.6.0" + "@babel/runtime" "^7.1.2" + create-react-context "<=0.2.2" + popper.js "^1.14.4" + prop-types "^15.6.1" + typed-styles "^0.0.7" + warning "^4.0.2" react-redux@^5.0.7: version "5.0.7" @@ -8576,6 +8615,15 @@ react-scripts@3.0.0: optionalDependencies: fsevents "2.0.6" +react-transition-group@^2.2.1: + version "2.9.0" + resolved "https://registry.yarnpkg.com/react-transition-group/-/react-transition-group-2.9.0.tgz#df9cdb025796211151a436c69a8f3b97b5b07c8d" + dependencies: + dom-helpers "^3.4.0" + loose-envify "^1.4.0" + prop-types "^15.6.2" + react-lifecycles-compat "^3.0.4" + react-transition-group@^2.6.0: version "2.6.0" resolved "https://registry.yarnpkg.com/react-transition-group/-/react-transition-group-2.6.0.tgz#3c41cbdd9c044c5f8604d4e8d319e860919c9fae" @@ -8938,6 +8986,10 @@ reserved-words@^0.1.1: version "0.1.2" resolved "https://registry.yarnpkg.com/reserved-words/-/reserved-words-0.1.2.tgz#00a0940f98cd501aeaaac316411d9adc52b31ab1" +resize-observer-polyfill@^1.5.0: + version "1.5.1" + resolved "https://registry.yarnpkg.com/resize-observer-polyfill/-/resize-observer-polyfill-1.5.1.tgz#0e9020dd3d21024458d4ebd27e23e40269810464" + resolve-cwd@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/resolve-cwd/-/resolve-cwd-2.0.0.tgz#00a9f7387556e27038eae232caa372a6a59b665a" @@ -9965,6 +10017,10 @@ type-is@~1.6.16: media-typer "0.3.0" mime-types "~2.1.18" +typed-styles@^0.0.7: + version "0.0.7" + resolved "https://registry.yarnpkg.com/typed-styles/-/typed-styles-0.0.7.tgz#93392a008794c4595119ff62dde6809dbc40a3d9" + typedarray@^0.0.6: version "0.0.6" resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" @@ -9980,6 +10036,10 @@ typescript@^2.5.1: version "2.8.3" resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.8.3.tgz#5d817f9b6f31bb871835f4edf0089f21abe6c170" +ua-parser-js@^0.7.18: + version "0.7.19" + resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-0.7.19.tgz#94151be4c0a7fb1d001af7022fdaca4642659e4b" + ua-parser-js@^0.7.9: version "0.7.14" resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-0.7.14.tgz#110d53fa4c3f326c121292bbeac904d2e03387ca" @@ -10297,6 +10357,12 @@ warning@^4.0.1: dependencies: loose-envify "^1.0.0" +warning@^4.0.2: + version "4.0.3" + resolved "https://registry.yarnpkg.com/warning/-/warning-4.0.3.tgz#16e9e077eb8a86d6af7d64aa1e05fd85b4678ca3" + dependencies: + loose-envify "^1.0.0" + watchpack@^1.5.0: version "1.6.0" resolved "https://registry.yarnpkg.com/watchpack/-/watchpack-1.6.0.tgz#4bc12c2ebe8aa277a71f1d3f14d685c7b446cd00" |