hoverInfo(e, 'constructSkills')} >
@@ -224,6 +236,7 @@ function InstanceConstructs(props) {
setItemUnequip,
setItemEquip,
sendUnequip,
+ navInstance,
} = props;
if (!player) return false;
@@ -242,6 +255,7 @@ function InstanceConstructs(props) {
itemInfo,
setVboxHighlight,
sendUnequip,
+ mobileVisible: navInstance === i + 1,
}));
const classes = `construct-list`;
diff --git a/client/src/components/instance.footer.jsx b/client/src/components/instance.footer.jsx
index ee8cf2c3..82e01681 100644
--- a/client/src/components/instance.footer.jsx
+++ b/client/src/components/instance.footer.jsx
@@ -5,32 +5,22 @@ const actions = require('../actions');
const addState = connect(
function receiveState(state) {
- const { ws, instance, player, nav, showNav } = state;
+ const { ws, instance, player, nav } = state;
function sendInstanceReady() {
return ws.sendInstanceReady(instance.id);
}
- return { player, instance, sendInstanceReady, nav, showNav };
+ return { player, instance, sendInstanceReady, nav };
},
function receiveDispatch(dispatch) {
- function setShowNav(v) {
- return dispatch(actions.setShowNav(v));
- }
-
- function setInfo(c) {
- return dispatch(actions.setInfo(c));
- }
-
function setNav(v) {
return dispatch(actions.setNav(v));
}
return {
- setInfo,
setNav,
- setShowNav,
};
}
);
@@ -39,30 +29,11 @@ function Instance(args) {
const {
instance,
player,
- nav,
- showNav,
-
- setInfo,
- setNav,
- setShowNav,
sendInstanceReady,
} = args;
- if (!instance || !player) {
- return (
-
- );
- }
-
- function hoverInfo(e, info) {
- e.stopPropagation();
- return setInfo(info);
- }
-
- const rdyClasses = `${player.ready ? 'ready ready-btn' : 'ready-btn'}`;
+ const rdyClasses = `ready-btn ready`;
const readyInfo = instance.phase === 'Lobby'
? 'lobbyReady'
: 'ready';
@@ -70,27 +41,11 @@ function Instance(args) {
const readyBtn = (
);
- function navClick() {
- if (nav === 'vbox') return setNav('constructs');
- return setNav('vbox');
- }
-
- const navBtn = instance.phase === 'InProgress'
- ? (
-
- )
- : null;
-
const zero = Date.parse(instance.phase_start);
const now = Date.now();
const end = Date.parse(instance.phase_end);
@@ -118,8 +73,6 @@ function Instance(args) {
return (
);
diff --git a/client/src/components/list.footer.jsx b/client/src/components/list.footer.jsx
deleted file mode 100644
index 65109d72..00000000
--- a/client/src/components/list.footer.jsx
+++ /dev/null
@@ -1,48 +0,0 @@
-const { connect } = require('preact-redux');
-const preact = require('preact');
-
-const actions = require('./../actions');
-
-const addState = connect(
- function receiveState(state) {
- const { showNav } = state;
- return { showNav };
- },
- function receiveDispatch(dispatch) {
- function navToTeam() {
- return dispatch(actions.setNav('team'));
- }
-
- function setShowNav(v) {
- return dispatch(actions.setShowNav(v));
- }
-
- return {
- navToTeam,
- setShowNav,
- };
- }
-);
-
-function ListFooter(args) {
- return false;
-
- // const {
- // showNav,
-
- // navToTeam,
- // setShowNav,
- // } = args;
-
- // return (
- //
- // );
-}
-
-module.exports = addState(ListFooter);
diff --git a/client/src/components/play.footer.jsx b/client/src/components/play.footer.jsx
new file mode 100644
index 00000000..f8a8479a
--- /dev/null
+++ b/client/src/components/play.footer.jsx
@@ -0,0 +1,139 @@
+const preact = require('preact');
+const { connect } = require('preact-redux');
+
+const { errorToast, infoToast } = require('../utils');
+
+const AccountBox = require('./account.box');
+
+const addState = connect(
+ function receiveState(state) {
+ const {
+ ws,
+ instances,
+ invite,
+ } = state;
+
+ function sendInstanceState(id) {
+ ws.sendInstanceState(id);
+ }
+
+ function sendInstancePractice() {
+ ws.sendInstancePractice();
+ }
+
+ function sendInstanceQueue() {
+ ws.sendInstanceQueue();
+ }
+
+ function sendInstanceInvite() {
+ ws.sendInstanceInvite();
+ }
+
+ return {
+ instances,
+ invite,
+
+ sendInstanceState,
+ sendInstanceQueue,
+ sendInstancePractice,
+ sendInstanceInvite,
+ };
+ }
+);
+
+function JoinButtons(args) {
+ const {
+ instances,
+ invite,
+
+ sendInstanceState,
+ sendInstanceQueue,
+ sendInstancePractice,
+ sendInstanceInvite,
+ } = args;
+
+ const discordBtn = (
+
+ );
+
+ if (instances.length) {
+ return (
+
+ );
+ }
+
+ const inviteBtn = () => {
+ if (!invite) {
+ return (
+
+ );
+ }
+
+ function copyClick(e) {
+ const link = `${document.location.origin}#join=${invite}`;
+ const textArea = document.createElement('textarea', { id: '#clipboard' });
+ textArea.value = link;
+ document.body.appendChild(textArea);
+ textArea.focus();
+ textArea.select();
+
+ try {
+ document.execCommand('copy');
+ infoToast('Invite link copied.');
+ } catch (err) {
+ console.error('link copy error', err);
+ errorToast('Invite link copy error.');
+ }
+
+ document.body.removeChild(textArea);
+ return true;
+ }
+
+ return (
+
+ );
+ };
+
+ return (
+
+ );
+}
+
+module.exports = addState(JoinButtons);
diff --git a/client/src/components/vbox.component.jsx b/client/src/components/vbox.component.jsx
index e659ee72..53c03819 100644
--- a/client/src/components/vbox.component.jsx
+++ b/client/src/components/vbox.component.jsx
@@ -17,6 +17,7 @@ const addState = connect(
vboxSelected,
itemInfo,
itemUnequip,
+ navInstance,
} = state;
function sendVboxDiscard() {
@@ -51,7 +52,8 @@ const addState = connect(
vboxSelected,
itemInfo,
itemUnequip,
- sendItemUnequip
+ sendItemUnequip,
+ navInstance,
};
},
@@ -90,6 +92,7 @@ const addState = connect(
function Vbox(args) {
const {
combiner,
+ navInstance,
// instance,
itemInfo,
player,
@@ -348,7 +351,7 @@ function Vbox(args) {
return setInfo(info);
}
- const classes = 'vbox';
+ const classes = `vbox ${navInstance === 0 ? 'visible' : ''}`;
return (
{vboxElement()}
diff --git a/client/src/components/welcome.about.jsx b/client/src/components/welcome.about.jsx
deleted file mode 100644
index 0f33b942..00000000
--- a/client/src/components/welcome.about.jsx
+++ /dev/null
@@ -1,69 +0,0 @@
-// eslint-disable-next-line
-const preact = require('preact');
-const { Component } = require('preact')
-const { connect } = require('preact-redux');
-const linkState = require('linkstate').default;
-
-const { postData, errorToast, infoToast } = require('../utils');
-
-const addState = connect(
- (state) => {
- const {
- ws
- } = state;
-
- function submitRegister(name, password, code) {
- postData('/account/register', { name, password, code })
- .then(res => res.json())
- .then(data => {
- if (data.error) return errorToast(data.error);
- infoToast(data.message);
- ws.connect();
- })
- .catch(error => errorToast(error));
- }
-
- return {
- submitRegister,
- }
- },
-);
-
-function Register(args) {
- const {
- submitRegister,
- navRegister,
- } = args;
-
- return (
-
-
- mnml is made deep in the southern hemisphere by ntr & mashy.
-
-
- if you like this game please support the development by buying credits or subscribing.
-
-
- this site has no trackers or ads.
-
-
- you can reach us for feedback and support with the discord and email buttons below.
-
-
- the access code grep842 is currently active.
-
-
-
-
- );
-}
-
-module.exports = addState(Register);
diff --git a/client/src/components/welcome.jsx b/client/src/components/welcome.jsx
index 70bde16d..6146b7a0 100644
--- a/client/src/components/welcome.jsx
+++ b/client/src/components/welcome.jsx
@@ -19,7 +19,7 @@ function Welcome() {
};
return (
-