diff --git a/client/src/components/controls.jsx b/client/src/components/controls.jsx index 8df3d524..e7b4e639 100644 --- a/client/src/components/controls.jsx +++ b/client/src/components/controls.jsx @@ -38,7 +38,7 @@ function Controls(args) { if (game) return ; if (instance) return ; - if (nav === 'play' || nav === 'shop' || !nav) return + if (nav === 'play' || nav === 'shop' || nav === 'reshape' || !nav) return if (nav === 'team' || nav === 'account') return return false; diff --git a/client/src/components/play.jsx b/client/src/components/play.jsx index ec1dd4c1..6d846016 100644 --- a/client/src/components/play.jsx +++ b/client/src/components/play.jsx @@ -1,9 +1,61 @@ // const { connect } = require('preact-redux'); const preact = require('preact'); +const { connect } = require('preact-redux'); + +const actions = require('./../actions'); const VERSION = process.env.npm_package_version; -function Play() { +const addState = connect( + function receiveState(state) { + const { + ws, + account, + } = state; + + return { + account, + }; + }, + + function receiveDispatch(dispatch) { + function setMtxActive(mtx) { + dispatch(actions.setConstructRename(null)); + dispatch(actions.setMtxActive(mtx)); + return true; + } + + function setNav(place) { + return dispatch(actions.setNav(place)); + } + + return { + setMtxActive, + setNav, + }; + } +); + + +function Play(args) { + const { + account, + setNav, + } = args; + + const subscription = account.subscribed + ? + : ; + return (
@@ -23,7 +75,18 @@ function Play() {

-

The buttons on the right are the controls to play the game.

+

ยค {account.balance}

+
+ {subscription} + +
+
+

Click LEARN to practice the game without time controls.
Select INVITE then click COPY LINK to create a game invitation for a friend.
@@ -35,4 +98,4 @@ function Play() { ); } -module.exports = Play; +module.exports = addState(Play); diff --git a/client/src/components/reshape.jsx b/client/src/components/reshape.jsx index 30e56aa7..d45bd4d4 100644 --- a/client/src/components/reshape.jsx +++ b/client/src/components/reshape.jsx @@ -4,8 +4,6 @@ const { connect } = require('preact-redux'); const actions = require('./../actions'); -const VERSION = process.env.npm_package_version; - const addState = connect( function receiveState(state) { const {