diff --git a/webapp/src/components/Checkers.jsx b/webapp/src/components/Checkers.jsx
index 7f7f220..7d0817c 100644
--- a/webapp/src/components/Checkers.jsx
+++ b/webapp/src/components/Checkers.jsx
@@ -110,11 +110,9 @@ export function Board() {
}
function WhiteTile({ id, stone }) {
-
return (
-
handleClick(id)}
+
console.log('click', id)}
>
{stone}
@@ -123,8 +121,4 @@ function WhiteTile({ id, stone }) {
function BlackTile() {
return
-}
-
-function handleClick(i) {
- console.log("click", i)
}
\ No newline at end of file
diff --git a/webapp/src/container/games/view/ActiveGames.jsx b/webapp/src/container/games/view/ActiveGames.jsx
deleted file mode 100644
index c91ff68..0000000
--- a/webapp/src/container/games/view/ActiveGames.jsx
+++ /dev/null
@@ -1,7 +0,0 @@
-import React from 'react';
-
-export default function ActiveGames() {
- return (
-
View: ActiveGame
- )
-}
\ No newline at end of file
diff --git a/webapp/src/container/games/view/GameProposals.jsx b/webapp/src/container/games/view/GameProposals.jsx
deleted file mode 100644
index f487eb1..0000000
--- a/webapp/src/container/games/view/GameProposals.jsx
+++ /dev/null
@@ -1,7 +0,0 @@
-import React from 'react';
-
-export default function GameProposals() {
- return (
-
View: GameProposals
- )
-}
\ No newline at end of file
diff --git a/webapp/src/container/games/view/GameSelector.css b/webapp/src/container/games/view/GameSelector.css
new file mode 100644
index 0000000..1722aa6
--- /dev/null
+++ b/webapp/src/container/games/view/GameSelector.css
@@ -0,0 +1,48 @@
+.GameSelector {
+ flex: 1 1 auto;
+ overflow-y: scroll;
+}
+
+.Selectable {
+ border: 1px solid black;
+ margin-bottom: 5px;
+}
+
+.Selectable q {
+ color: gray;
+}
+
+.Selectable i {
+ font-size: 70%;
+ margin-left: 5px;
+ margin-right: 5px;
+}
+
+.Selectable:hover {
+ background-color: #d3d3d360;
+}
+
+/* .Games .li button.action {
+ display: none;
+}
+
+.Games .li:hover button.action {
+ display: initial;
+} */
+
+.Separator {
+ /* width: 20%; */
+ /* height: 20px; */
+ border-bottom: 1px dotted black;
+ text-align: center;
+ font-size: 50%;
+ padding-left: 50%;
+ margin-bottom: 7px;
+}
+
+.Selectable .Title {
+ display: flex;
+ flex-direction: row;
+ align-items: center;
+ justify-content: center;
+}
diff --git a/webapp/src/container/games/view/GameSelector.jsx b/webapp/src/container/games/view/GameSelector.jsx
new file mode 100644
index 0000000..5578e7c
--- /dev/null
+++ b/webapp/src/container/games/view/GameSelector.jsx
@@ -0,0 +1,52 @@
+import './GameSelector.css';
+import React, { useContext } from 'react';
+import { GamesContext } from '../../../context/games';
+
+import { Color, Player } from '../../../components/Checkers';
+import Loading from '../../../components/Loading';
+
+export default function GameSelector({ yours, opponents, onClick }) {
+
+ const games = useContext(GamesContext);
+ if (games.list === null)
+ return
+
+ const yoursList = games.list.filter(game => game.status === yours)
+ .map(game =>
)
+
+ const opponentsList = games.list.filter(game => game.status === opponents)
+ .map(game =>
)
+
+ return (
+
+ {yoursList}
+ {opponentsList.length > 0 && }
+ {opponentsList}
+
+ )
+}
+
+function Selectable({ game, onClick }) {
+ const myColor = game.myColor;
+ const opponentColor = Color.opposite(myColor);
+ const opponentName = game.opponentName;
+
+ return (
+
onClick(game.uuid)}>
+
+
{game.message}
+
+ )
+};
+
+function Separator({ counter }) {
+ return (
+
+ waiting for opponent ({counter})
+
+ )
+}
\ No newline at end of file
diff --git a/webapp/src/container/games/view/GamesArchive.jsx b/webapp/src/container/games/view/GamesArchive.jsx
deleted file mode 100644
index 302ae09..0000000
--- a/webapp/src/container/games/view/GamesArchive.jsx
+++ /dev/null
@@ -1,7 +0,0 @@
-import React from 'react';
-
-export default function GamesArchive() {
- return (
-
View: GameArchive
- )
-}
\ No newline at end of file