- {playerTeam.id}
- {PlayerTeam(playerTeam, setActiveSkill)}
+
+ Back
+
-
- Round X
-
-
-
- {otherTeams.id}
- {otherTeams.map(OpponentTeam)}
+
+
+ {playerTeam.id}
+ {PlayerTeam(playerTeam, setActiveSkill)}
+
+
+ {otherTeams.id}
+ {otherTeams.map(OpponentTeam)}
+
+
+ {logs}
+
);
diff --git a/html-client/src/components/game.container.js b/html-client/src/components/game.container.js
index 17a41dba..64149b37 100644
--- a/html-client/src/components/game.container.js
+++ b/html-client/src/components/game.container.js
@@ -2,7 +2,7 @@ const { connect } = require('preact-redux');
const actions = require('../actions');
-const Game = require('./game');
+const Game = require('./game.component');
const addState = connect(
function receiveState(state) {
@@ -10,7 +10,7 @@ const addState = connect(
function selectSkillTarget(targetCrypId) {
if (activeSkill) {
- return ws.sendGameSkill(game.id, activeSkill.crypId, targetCrypId, activeSkill.skill.skill);
+ return ws.sendGameSkill(game.id, activeSkill.crypId, targetCrypId, activeSkill.skill);
}
return false;
}
@@ -39,8 +39,11 @@ const addState = connect(
dispatch(actions.setActiveIncoming(skillId));
}
+ function quit() {
+ dispatch(actions.setGame(null));
+ }
- return { setActiveSkill, setActiveIncoming };
+ return { setActiveSkill, setActiveIncoming, quit };
}
);
diff --git a/html-client/src/components/game.join.button.jsx b/html-client/src/components/game.join.button.jsx
deleted file mode 100644
index 35c56555..00000000
--- a/html-client/src/components/game.join.button.jsx
+++ /dev/null
@@ -1,42 +0,0 @@
-const preact = require('preact');
-const { connect } = require('preact-redux');
-
-const addState = connect(
- (state) => {
- const { ws, cryps } = state;
- function sendGameJoin(gameId) {
- return ws.sendGameJoin(gameId, [cryps[0].id]);
- }
-
- return { account: state.account, sendGameJoin };
- },
-);
-
-function GameJoinButton({ account, sendGameJoin }) {
- let gameId = '';
-
- if (!account) return
...
;
-
- return (
-
-
- (gameId = e.target.value)}
- />
-
-
- sendGameJoin(gameId)}>
- Join Game
-
-
-
- );
-}
-
-module.exports = addState(GameJoinButton);
diff --git a/html-client/src/components/instance.cryps.component.jsx b/html-client/src/components/instance.cryps.component.jsx
deleted file mode 100644
index 5cda62a4..00000000
--- a/html-client/src/components/instance.cryps.component.jsx
+++ /dev/null
@@ -1,22 +0,0 @@
-const preact = require('preact');
-// const key = require('keymaster');
-
-function Vbox(args) {
- const {
- instance,
- combiner,
- sendVboxAccept,
- sendVboxDiscard,
- sendVboxReclaim,
- sendVboxCombine,
- } = args;
-
- const { cryps } = instance;
-
- return (
-
-
- );
-}
-
-module.exports = Vbox;
\ No newline at end of file
diff --git a/html-client/src/components/item.list.container.js b/html-client/src/components/item.list.container.js
deleted file mode 100644
index bfa8731d..00000000
--- a/html-client/src/components/item.list.container.js
+++ /dev/null
@@ -1,20 +0,0 @@
-const { connect } = require('preact-redux');
-const actions = require('../actions');
-
-const ItemList = require('./item.list');
-
-const addState = connect(
- function receiveState(state) {
- const { items } = state;
- return { items };
- },
- function receiveDispatch(dispatch) {
- function setActiveItem(id) {
- dispatch(actions.setActiveItem(id))
- }
-
- return { setActiveItem };
- }
-);
-
-module.exports = addState(ItemList);
diff --git a/html-client/src/components/item.list.jsx b/html-client/src/components/item.list.jsx
deleted file mode 100644
index b003b5b8..00000000
--- a/html-client/src/components/item.list.jsx
+++ /dev/null
@@ -1,37 +0,0 @@
-// eslint-disable-next-line
-const preact = require('preact');
-
-function ItemList({ items, setActiveItem }) {
- if (!items) return
...
;
- const itemPanels = items.map(item => (
-
-
-
-
setActiveItem(item.id)}>
- Use
-
-
- ));
- return (
-
- {itemPanels}
-
- );
-}
-
-module.exports = ItemList;
diff --git a/html-client/src/components/logs.jsx b/html-client/src/components/logs.jsx
deleted file mode 100644
index 77b4b3dd..00000000
--- a/html-client/src/components/logs.jsx
+++ /dev/null
@@ -1,19 +0,0 @@
-const preact = require('preact');
-const { connect } = require('preact-redux');
-
-// const Logs = require('./logs');
-
-const addState = connect(
- function receiveState(state) {
- const { game } = state;
- return { game };
- }
-);
-
-function Logs(props) {
- const { game } = props;
- const logs = game.log.reverse().map((l, i) => (
{l}
));
- return (
{logs}
);
-}
-
-module.exports = addState(Logs);
diff --git a/html-client/src/components/navbar.jsx b/html-client/src/components/navbar.jsx
deleted file mode 100644
index d45dc8e8..00000000
--- a/html-client/src/components/navbar.jsx
+++ /dev/null
@@ -1,47 +0,0 @@
-const preact = require('preact');
-
-// components all the way down
-const Icon = name => (
-
- {name}
-
-
-);
-
-// the css attribute name `class` is reserved in js
-// so in react you have to call it `className`
-function Navbar() {
- const NAMES = ['Mashy', 'ntr'];
-
- return (
-
-
-
-
- {NAMES.map(Icon)}
-
- );
- // map is a function that is called on every element of an array
- // so in this ^^ case it calls Icon('Mashy') which returns some jsx
- // that gets put into the dom
-}
-
-module.exports = Navbar;