// 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} ¤{price} ); }; const availableMtx = (item, i) => ( Enable {item.variant} mtxBuy(item)} disabled={account.balance < item.credits}>¤{item.credits} ); const subscription = account.subscribed ? Subscribed : setNav('shop')} class="yellow-btn" role="link"> Subscribe ; return ( setMtxActive(null)}> Use credits to modify your construct names and appearance. Purchase image sets to unlock different types of avatars. You can reroll any avatar to a new avatar from owned sets. Reroll avatars by clicking the owned set and then the construct you wish to reroll. Press escape to clear any active mtx. You can switch out your active constructs in the account settings. Accounts start with 4 constructs by default. ¤ {account.balance} {subscription} setNav('shop')} class="yellow-btn" role="link"> Get Credits {shop.owned.map(useMtx)} {shop.available.map(availableMtx)} ); } module.exports = addState(Reshape);
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.