diff --git a/client/src/components/game.jsx b/client/src/components/game.jsx
index 495fd940..9e02b17d 100644
--- a/client/src/components/game.jsx
+++ b/client/src/components/game.jsx
@@ -1,5 +1,96 @@
const preact = require('preact');
+function PlayerCrypCard(cryp) {
+ return (
+
+
+
+
+
{cryp.name}
+
Level {cryp.lvl}
+
+
+
+
+
+
+
+
+
{cryp.hp.value} / {cryp.stam.value} HP
+
+
+
{cryp.xp} / {Math.pow(2,cryp.lvl+1)} XP
+
+
+
+
+
+ );
+}
+
+function PlayerTeam(team) {
+ const cryps = team.cryps.map(PlayerCrypCard);
+
+ return (
+
+ {cryps}
+
+ )
+}
+
+function OpponentCrypCard(cryp) {
+ return (
+
+
+
+
+
{cryp.name}
+
Level {cryp.lvl}
+
+
+
+
+
+
+
+
+
{cryp.hp.value} / {cryp.stam.value} HP
+
+
+
{cryp.xp} / {Math.pow(2,cryp.lvl+1)} XP
+
+
+
+
+ );
+}
+
+function OpponentTeam(team) {
+ const cryps = team.cryps.map(OpponentCrypCard);
+
+ return (
+
+ {cryps}
+
+ )
+}
+
+function GameState(game) {
+ return (
+
+ )
+}
+
function GamePanel({ game, sendGameSkill, sendGameTarget, account }) {
if (!game) return
...
;
@@ -7,52 +98,30 @@ function GamePanel({ game, sendGameSkill, sendGameTarget, account }) {
const playerTeam = game.teams.find(t => t.id === account.id);
- const targetBtn = playerTeam.incoming.map(i => (
-
- ));
-
- const playerCryps = playerTeam.cryps.map(c => (
-
-
{c.name}
-
-
- ));
+ const gameState = GameState(game);
+ // const targetBtn = playerTeam.incoming.map(i => (
+ //
+ // ));
return (
-
-
{game.phase}
-
-
them
-
{JSON.stringify(otherTeams)}
+
+
+
{otherTeams.map(OpponentTeam)}
+ {gameState}
+
{PlayerTeam(playerTeam)}
-
-
us
- {playerCryps}
- {targetBtn}
+
)
- // return (
- //
- //
{JSON.stringify(game.a)}
- //
{JSON.stringify(game.b)}
- //
- // {game.log.map((l, i) => (
{l}
))}
- //
- //
- // );
}
module.exports = GamePanel;
diff --git a/client/src/components/item.list.jsx b/client/src/components/item.list.jsx
index d0cd6199..b003b5b8 100644
--- a/client/src/components/item.list.jsx
+++ b/client/src/components/item.list.jsx
@@ -5,7 +5,7 @@ function ItemList({ items, setActiveItem }) {
if (!items) return
...
;
const itemPanels = items.map(item => (
-