diff --git a/webapp/src/components/Game/GameSelector/Selectable.css b/webapp/src/components/Game/GameSelector/Selectable.css index f1efadc..abc3ec4 100644 --- a/webapp/src/components/Game/GameSelector/Selectable.css +++ b/webapp/src/components/Game/GameSelector/Selectable.css @@ -9,6 +9,8 @@ .selectable i { font-size: 70%; + margin-left: 5px; + margin-right: 5px; } /* .Games .li button.action { diff --git a/webapp/src/components/Game/GameSelector/Selectable.jsx b/webapp/src/components/Game/GameSelector/Selectable.jsx index ba3c8a0..b2ed7cd 100644 --- a/webapp/src/components/Game/GameSelector/Selectable.jsx +++ b/webapp/src/components/Game/GameSelector/Selectable.jsx @@ -1,16 +1,21 @@ import './Selectable.css' import React from 'react'; -import { Stone, oppositeColor } from '../Stone'; +import { oppositeColor } from '../Stone'; +import Player from '../Player'; export default function Selectable({game}) { + const myColor = game.myColor + + const opponentColor = oppositeColor(myColor) + const opponentName = game.opponentName + return (
- {Stone(game.myColor)} + vs - {Stone(oppositeColor(game.myColor))} - {game.opponentName} +
{game.message}
diff --git a/webapp/src/components/Game/Player.css b/webapp/src/components/Game/Player.css new file mode 100644 index 0000000..e69de29 diff --git a/webapp/src/components/Game/Player.jsx b/webapp/src/components/Game/Player.jsx new file mode 100644 index 0000000..113879f --- /dev/null +++ b/webapp/src/components/Game/Player.jsx @@ -0,0 +1,13 @@ +import './Player.css' +import React from 'react' +import { Stone } from './Stone' + +export default function Player({ color, name }) { + + return ( + + + {name} + + ) +} diff --git a/webapp/src/components/Game/Stone.jsx b/webapp/src/components/Game/Stone.jsx index 0c7cfcc..60995fc 100644 --- a/webapp/src/components/Game/Stone.jsx +++ b/webapp/src/components/Game/Stone.jsx @@ -1,7 +1,7 @@ -import './Stone.css'; -import React from 'react'; +import './Stone.css' +import React from 'react' -export function Stone( color ) { +export function Stone({ color }) { switch (color) { case WHITE(): return WhiteStone()