team update

This commit is contained in:
ntr
2019-07-30 13:25:06 +10:00
parent 3fcbedb5e3
commit 17c2c9708c
2 changed files with 3 additions and 20 deletions
+2 -19
View File
@@ -4,22 +4,6 @@ const toast = require('izitoast');
const actions = require('./../actions');
const balanceError = () =>
toast.error({
theme: 'dark',
color: 'black',
timeout: false,
drag: false,
position: 'center',
maxWidth: window.innerWidth / 2,
close: false,
buttons: [
['<button type="submit">OK</button>',
(instance, thisToast) => instance.hide({ transitionOut: 'fadeOut' }, thisToast)],
],
message: 'Insufficient Balance',
});
const addState = connect(
function receiveState(state) {
const {
@@ -40,8 +24,7 @@ const addState = connect(
},
function receiveDispatch(dispatch) {
function setMtxActive(mtx, balance) {
if (balance === 0) return balanceError();
function setMtxActive(mtx) {
dispatch(actions.setConstructRename(null));
dispatch(actions.setMtxActive(mtx));
return true;
@@ -64,7 +47,7 @@ function Inventory(args) {
if (!shop) return false;
const useMtx = (item, i) => (
<figure key={i} onClick={() => setMtxActive(item, account.balance)} >
<figure key={i} onClick={() => setMtxActive(item)} >
<figcaption>{item}</figcaption>
<button>¤1</button>
</figure>