// const { connect } = require('preact-redux'); const preact = require('preact'); const { connect } = require('preact-redux'); const actions = require('./../actions'); const addState = connect( function receiveState(state) { const { ws, account, shop, } = state; function mtxBuy(mtx) { return ws.sendMtxBuy(mtx.variant); } return { account, shop, mtxBuy, }; }, 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 Reshape(args) { const { account, shop, mtxBuy, setMtxActive, setNav, } = args; if (!shop) return false; const useMtx = (item, i) => { const price = item === 'Rename' ? 5 : 1; return (
{ e.stopPropagation(); setMtxActive(item); }}>
{item}
); }; const availableMtx = (item, i) => (
Enable {item.variant}
); const subscription = account.subscribed ? : ; return (
setMtxActive(null)}>

Use credits to modify your construct names and appearance.

You can switch out your active constructs in the account settings.
Accounts start with 4 constructs by default.

¤ {account.balance}

{subscription}
{shop.owned.map(useMtx)} {shop.available.map(availableMtx)}
); } module.exports = addState(Reshape);