diff --git a/client/assets/styles/instance.mobile.css b/client/assets/styles/instance.mobile.less
similarity index 84%
rename from client/assets/styles/instance.mobile.css
rename to client/assets/styles/instance.mobile.less
index acc33451..07c76286 100644
--- a/client/assets/styles/instance.mobile.css
+++ b/client/assets/styles/instance.mobile.less
@@ -1,3 +1,5 @@
+@import 'colours.less';
+
@media (max-width: 800px) {
.instance {
font-size: 8pt;
@@ -7,14 +9,14 @@
grid-template-areas:
"vbox"
"constructs";
+
+ .info {
+ display: none;
+ }
}
.instance .nav-btn { display: initial; }
- /* Default view */
- .instance .equip { display: none; }
- .instance .info { display: none; }
- .instance .construct-list { display: none; }
.vbox {
grid-area: vbox;
margin-bottom: 0;
@@ -27,6 +29,9 @@
"inventory"
"combiner";
+ &:not(.visible) {
+ display: none;
+ }
}
.vbox-arrow {
@@ -45,24 +50,13 @@
margin: 0;
}
- /* constructs toggled on */
- .instance.constructs-visible .vbox {
- display: none;
- }
-
- .instance.constructs-visible .equip {
- display: initial;
- grid-area: vbox;
- margin: 0;
- }
-
- .instance.constructs-visible .highlight {
- display: initial;
- }
-
- .instance.constructs-visible .construct-list {
+ .construct-list {
display: grid;
grid-auto-rows: 1fr;
+
+ .instance-construct:not(.visible) {
+ display: none;
+ };
}
.vbox-inventory {
diff --git a/client/index.js b/client/index.js
index ae5df689..8ad272c9 100644
--- a/client/index.js
+++ b/client/index.js
@@ -9,7 +9,7 @@ require('./assets/styles/vbox.less');
require('./assets/styles/game.less');
require('./assets/styles/player.less');
require('./assets/styles/styles.mobile.css');
-require('./assets/styles/instance.mobile.css');
+require('./assets/styles/instance.mobile.less');
// kick it off
require('./src/app');
diff --git a/client/package.json b/client/package.json
index 51074c78..c0350a08 100644
--- a/client/package.json
+++ b/client/package.json
@@ -19,6 +19,7 @@
"async": "^2.6.2",
"borc": "^2.0.3",
"docco": "^0.7.0",
+ "hammerjs": "^2.0.8",
"izitoast": "^1.4.0",
"keymaster": "^1.6.2",
"linkstate": "^1.1.1",
diff --git a/client/src/actions.jsx b/client/src/actions.jsx
index ccfadcaa..282d2474 100644
--- a/client/src/actions.jsx
+++ b/client/src/actions.jsx
@@ -27,6 +27,7 @@ export const setItemInfo = value => ({ type: 'SET_ITEM_INFO', value });
export const setItemUnequip = value => ({ type: 'SET_ITEM_UNEQUIP', value });
export const setMtxActive = value => ({ type: 'SET_MTX_ACTIVE', value });
export const setNav = value => ({ type: 'SET_NAV', value });
+export const setNavInstance = value => ({ type: 'SET_NAV_INSTANCE', value });
export const setPing = value => ({ type: 'SET_PING', value });
export const setPlayer = value => ({ type: 'SET_PLAYER', value });
export const setReclaiming = value => ({ type: 'SET_RECLAIMING', value });
diff --git a/client/src/components/instance.component.jsx b/client/src/components/instance.component.jsx
index 12f78532..864bf9e2 100644
--- a/client/src/components/instance.component.jsx
+++ b/client/src/components/instance.component.jsx
@@ -1,6 +1,9 @@
+const { Component } = require('preact');
const preact = require('preact');
const { connect } = require('preact-redux');
+const Hammer = require('hammerjs');
+
const Vbox = require('./vbox.component');
const InfoContainer = require('./info.container');
const InstanceConstructsContainer = require('./instance.constructs');
@@ -11,8 +14,14 @@ const actions = require('../actions');
const addState = connect(
function receiveState(state) {
- const { instance, nav } = state;
- return { instance, nav };
+ const { instance,
+ nav,
+ navInstance,
+ } = state;
+ return { instance,
+ nav,
+ navInstance,
+ };
},
function receiveDispatch(dispatch) {
@@ -20,6 +29,11 @@ const addState = connect(
return dispatch(actions.setInfo(c));
}
+ function setNavInstance(c) {
+ return dispatch(actions.setNavInstance(c));
+ }
+
+
function clearItems() {
dispatch(actions.setCombiner([]));
dispatch(actions.setReclaiming(false));
@@ -33,38 +47,68 @@ const addState = connect(
return {
setInfo,
clearItems,
+ setNavInstance,
};
}
);
-function Instance(args) {
- const {
- instance,
- setInfo,
- clearItems,
+class Instance extends Component {
+ render(args) {
+ const {
+ instance,
+ setInfo,
+ clearItems,
+ } = args;
- nav,
- } = args;
+ if (!instance) return false;
- if (!instance) return false;
+ if (instance.phase !== 'InProgress') {
+ return