summaryrefslogtreecommitdiff
path: root/frontend/src/containers
diff options
context:
space:
mode:
authorJoffrey BION <joffrey.bion@gmail.com>2017-05-21 20:20:45 +0200
committerJoffrey BION <joffrey.bion@gmail.com>2017-05-22 00:23:02 +0200
commitc03e68041e0f444e18a895058afbdf0d68759517 (patch)
tree6e31f9726d36e746f43c7856cebff8c861577e31 /frontend/src/containers
parentClean name in websocket.js (diff)
downloadseven-wonders-c03e68041e0f444e18a895058afbdf0d68759517.tar.gz
seven-wonders-c03e68041e0f444e18a895058afbdf0d68759517.tar.bz2
seven-wonders-c03e68041e0f444e18a895058afbdf0d68759517.zip
Update prettier config and reformat
Here's the discussion summary: - single quote, because that's what I'm used to in the JS world - trailing comma, to avoid unnecessary git changes - print-width 120, because 120 still doesn't require to scroll horizontally, and vertical space is precious
Diffstat (limited to 'frontend/src/containers')
-rw-r--r--frontend/src/containers/gameBrowser.js22
-rw-r--r--frontend/src/containers/home.js10
-rw-r--r--frontend/src/containers/lobby.js20
3 files changed, 26 insertions, 26 deletions
diff --git a/frontend/src/containers/gameBrowser.js b/frontend/src/containers/gameBrowser.js
index d9d3d363..643dbebc 100644
--- a/frontend/src/containers/gameBrowser.js
+++ b/frontend/src/containers/gameBrowser.js
@@ -1,11 +1,11 @@
-import React, { Component } from "react";
-import { connect } from "react-redux";
-import { Space, InlineForm, Text } from "rebass";
-import { Flex } from "reflexbox";
-import GameList from "../components/gameList";
+import React, { Component } from 'react';
+import { connect } from 'react-redux';
+import { Space, InlineForm, Text } from 'rebass';
+import { Flex } from 'reflexbox';
+import GameList from '../components/gameList';
-import { getCurrentPlayer } from "../redux/players";
-import { getAllGames, actions } from "../redux/games";
+import { getCurrentPlayer } from '../redux/players';
+import { getAllGames, actions } from '../redux/games';
class GameBrowser extends Component {
createGame = e => {
@@ -29,7 +29,7 @@ class GameBrowser extends Component {
<Space auto />
<Text>
<b>Username:</b>
- {" "}
+ {' '}
{this.props.currentPlayer && this.props.currentPlayer.displayName}
</Text>
<Space x={1} />
@@ -41,13 +41,13 @@ class GameBrowser extends Component {
}
const mapStateToProps = state => ({
- currentPlayer: getCurrentPlayer(state) || { displayName: "[ERROR]" },
- games: getAllGames(state)
+ currentPlayer: getCurrentPlayer(state) || { displayName: '[ERROR]' },
+ games: getAllGames(state),
});
const mapDispatchToProps = {
createGame: actions.requestCreateGame,
- joinGame: actions.requestJoinGame
+ joinGame: actions.requestJoinGame,
};
export default connect(mapStateToProps, mapDispatchToProps)(GameBrowser);
diff --git a/frontend/src/containers/home.js b/frontend/src/containers/home.js
index 40c2efb3..f60c1c52 100644
--- a/frontend/src/containers/home.js
+++ b/frontend/src/containers/home.js
@@ -1,7 +1,7 @@
-import React, { Component } from "react";
-import { connect } from "react-redux";
-import { Button, Container, Input } from "rebass";
-import { actions } from "../redux/players";
+import React, { Component } from 'react';
+import { connect } from 'react-redux';
+import { Button, Container, Input } from 'rebass';
+import { actions } from '../redux/players';
class HomePage extends Component {
play = e => {
@@ -32,7 +32,7 @@ class HomePage extends Component {
const mapStateToProps = state => ({});
const mapDispatchToProps = {
- chooseUsername: actions.chooseUsername
+ chooseUsername: actions.chooseUsername,
};
export default connect(mapStateToProps, mapDispatchToProps)(HomePage);
diff --git a/frontend/src/containers/lobby.js b/frontend/src/containers/lobby.js
index 8c3e5e4c..f3489db4 100644
--- a/frontend/src/containers/lobby.js
+++ b/frontend/src/containers/lobby.js
@@ -1,16 +1,16 @@
-import React, { Component } from "react";
-import { connect } from "react-redux";
-import Immutable from "seamless-immutable";
-import { Button } from "rebass";
-import PlayerList from "../components/playerList";
+import React, { Component } from 'react';
+import { connect } from 'react-redux';
+import Immutable from 'seamless-immutable';
+import { Button } from 'rebass';
+import PlayerList from '../components/playerList';
-import { getPlayers } from "../redux/players";
-import { getCurrentGame, actions } from "../redux/games";
+import { getPlayers } from '../redux/players';
+import { getCurrentGame, actions } from '../redux/games';
class Lobby extends Component {
getTitle() {
if (this.props.currentGame) {
- return this.props.currentGame.name + " — Lobby";
+ return this.props.currentGame.name + ' — Lobby';
} else {
return "What are you doing here? You haven't joined a game yet!";
}
@@ -31,12 +31,12 @@ const mapStateToProps = state => {
const game = getCurrentGame(state);
return {
currentGame: game,
- players: game ? getPlayers(state, game.players) : Immutable([])
+ players: game ? getPlayers(state, game.players) : Immutable([]),
};
};
const mapDispatchToProps = {
- startGame: actions.requestStartGame
+ startGame: actions.requestStartGame,
};
export default connect(mapStateToProps, mapDispatchToProps)(Lobby);
bgstack15