game btns

This commit is contained in:
ntr 2019-10-18 15:43:08 +11:00
parent ddca205f0c
commit 4b216775cd
2 changed files with 14 additions and 3 deletions

View File

@ -45,7 +45,14 @@ const addState = connect(
dispatch(actions.setInstance(null));
}
return { quit };
function setChatShow(v) {
dispatch(actions.setChatShow(v));
}
return {
setChatShow,
quit,
};
}
);
@ -57,6 +64,7 @@ function GameCtrlBtns(args) {
getInstanceState,
sendGameSkillClear,
sendReady,
setChatShow,
quit,
} = args;
@ -73,7 +81,7 @@ function GameCtrlBtns(args) {
return (
<div class="game-ctrl-btns">
<button disabled={true} >Chat</button>
<button disabled={!account.subscribed} onClick={() => setChatShow(!chatShow)}>Chat</button>
<button disabled={animating} onClick={sendGameSkillClear}>Clear</button>
{finished ? quitBtn : readyBtn}
</div>

View File

@ -9,6 +9,7 @@ const addState = connect(
ws,
chatShow,
instance,
account,
} = state;
function sendReady() {
@ -23,6 +24,7 @@ const addState = connect(
return {
instance,
chatShow,
account,
sendAbandon,
sendReady,
@ -44,6 +46,7 @@ function InstanceCtrlBtns(args) {
const {
instance,
chatShow,
account,
sendAbandon,
sendReady,
@ -63,7 +66,7 @@ function InstanceCtrlBtns(args) {
return (
<div class="instance-ctrl-btns">
<button onClick={() => setChatShow(!chatShow)}>Chat</button>
<button disabled={!account.subscribed} onClick={() => setChatShow(!chatShow)}>Chat</button>
<button disabled={finished} class="ready" onClick={() => sendReady()}>Ready</button>
</div>
);