summaryrefslogtreecommitdiff
path: root/frontend/src/components
diff options
context:
space:
mode:
authorVictor Chabbert <chabbertvi@eisti.eu>2017-05-20 15:14:13 +0200
committerVictor Chabbert <chabbertvi@eisti.eu>2017-05-20 15:14:13 +0200
commit240246ea132cc736c6eaa70ed79f2ec78d1d4636 (patch)
treea45a5c81de9f650fcd18190d90049f67c0f63b97 /frontend/src/components
parentUpgrade react-scripts to 1.0.1 (diff)
downloadseven-wonders-240246ea132cc736c6eaa70ed79f2ec78d1d4636.tar.gz
seven-wonders-240246ea132cc736c6eaa70ed79f2ec78d1d4636.tar.bz2
seven-wonders-240246ea132cc736c6eaa70ed79f2ec78d1d4636.zip
Add prettier and format js files
Diffstat (limited to 'frontend/src/components')
-rw-r--r--frontend/src/components/gameList.js28
-rw-r--r--frontend/src/components/modals/username.js14
-rw-r--r--frontend/src/components/playerList.js24
3 files changed, 35 insertions, 31 deletions
diff --git a/frontend/src/components/gameList.js b/frontend/src/components/gameList.js
index b4167927..e1d011e1 100644
--- a/frontend/src/components/gameList.js
+++ b/frontend/src/components/gameList.js
@@ -1,20 +1,22 @@
-import React from 'react'
-import { Flex } from 'reflexbox'
-import { Text, Space, Button } from 'rebass'
-import Immutable from 'seamless-immutable'
+import React from "react";
+import { Flex } from "reflexbox";
+import { Text, Space, Button } from "rebass";
+import Immutable from "seamless-immutable";
-const GameList = (props) => (
+const GameList = props => (
<div>
{Immutable.asMutable(props.games).map((game, index) => {
- const joinGame = () => props.joinGame(game.id)
+ const joinGame = () => props.joinGame(game.id);
- return (<Flex key={index}>
- <Text>{game.name}</Text>
- <Space auto />
- <Button onClick={joinGame}>Join</Button>
- </Flex>)
+ return (
+ <Flex key={index}>
+ <Text>{game.name}</Text>
+ <Space auto />
+ <Button onClick={joinGame}>Join</Button>
+ </Flex>
+ );
})}
</div>
-)
+);
-export default GameList
+export default GameList;
diff --git a/frontend/src/components/modals/username.js b/frontend/src/components/modals/username.js
index 61b52114..826bce85 100644
--- a/frontend/src/components/modals/username.js
+++ b/frontend/src/components/modals/username.js
@@ -1,4 +1,4 @@
-import React from 'react'
+import React from "react";
import {
Overlay,
Panel,
@@ -8,15 +8,15 @@ import {
Input,
Close,
Space
-} from 'rebass'
+} from "rebass";
const Modal = ({ modalOpen, toggleModal }) => (
- <Overlay open={modalOpen} onDismiss={toggleModal('usernameModal')}>
+ <Overlay open={modalOpen} onDismiss={toggleModal("usernameModal")}>
<Panel theme="info">
<PanelHeader>
What's your username ?
<Space auto />
- <Close onClick={toggleModal('usernameModal')} />
+ <Close onClick={toggleModal("usernameModal")} />
</PanelHeader>
<Input
label="Username"
@@ -29,12 +29,12 @@ const Modal = ({ modalOpen, toggleModal }) => (
<Space auto />
<Button
theme="success"
- onClick={toggleModal('usernameModal')}
+ onClick={toggleModal("usernameModal")}
children="Ok"
/>
</PanelFooter>
</Panel>
</Overlay>
-)
+);
-export default Modal
+export default Modal;
diff --git a/frontend/src/components/playerList.js b/frontend/src/components/playerList.js
index 70e8b1f6..b7f6e7c3 100644
--- a/frontend/src/components/playerList.js
+++ b/frontend/src/components/playerList.js
@@ -1,17 +1,19 @@
-import React from 'react'
-import { Flex } from 'reflexbox'
-import { Text } from 'rebass'
-import Immutable from 'seamless-immutable'
+import React from "react";
+import { Flex } from "reflexbox";
+import { Text } from "rebass";
+import Immutable from "seamless-immutable";
-const PlayerList = (props) => (
+const PlayerList = props => (
<div>
{Immutable.asMutable(props.players).map(player => {
- return (<Flex key={player.index}>
- <Text>{player.displayName}</Text>
- <Text>({player.username})</Text>
- </Flex>)
+ return (
+ <Flex key={player.index}>
+ <Text>{player.displayName}</Text>
+ <Text>({player.username})</Text>
+ </Flex>
+ );
})}
</div>
-)
+);
-export default PlayerList
+export default PlayerList;
bgstack15