Merge branch 'develop' of ssh://git.mnml.gg:40022/~/mnml into develop

This commit is contained in:
Mashy
2019-11-12 16:42:47 +10:00
7 changed files with 79 additions and 12 deletions
+35 -8
View File
@@ -14,6 +14,7 @@ const addState = connect(
account,
instances,
invite,
pvp,
} = state;
function sendInstanceState(id) {
@@ -32,15 +33,21 @@ const addState = connect(
ws.sendInstanceInvite();
}
function sendInstanceLeave() {
ws.sendInstanceLeave();
}
return {
account,
instances,
invite,
pvp,
sendInstanceState,
sendInstanceQueue,
sendInstancePractice,
sendInstanceInvite,
sendInstanceLeave,
};
},
@@ -67,11 +74,13 @@ function Play(args) {
account,
instances,
invite,
pvp,
sendInstanceState,
sendInstanceQueue,
sendInstancePractice,
sendInstanceInvite,
sendInstanceLeave,
setNav,
} = args;
@@ -125,6 +134,31 @@ function Play(args) {
);
};
const pvpBtn = () => {
if (pvp) return (
<figure>
<button
class="ready"
onClick={() => sendInstanceLeave()}
>
Cancel
</button>
<figcaption>Finding Opponent</figcaption>
</figure>
);
return (
<figure>
<button
class="ready"
onClick={() => sendInstanceQueue()}>
PVP
</button>
<figcaption>Matchmaking</figcaption>
</figure>
);
}
const subscription = account.subscribed
? <button
class="yellow-btn"
@@ -142,14 +176,7 @@ function Play(args) {
if (!instances.length) {
return (
<div class='list play'>
<figure>
<button
class="ready"
onClick={() => sendInstanceQueue()}>
PVP
</button>
<figcaption>Matchmaking</figcaption>
</figure>
{pvpBtn()}
{inviteBtn()}
<figure>
<button