mnml/client/src/components/inventory.jsx
2019-07-07 23:31:12 +10:00

61 lines
1.5 KiB
JavaScript

const { connect } = require('preact-redux');
const preact = require('preact');
const actions = require('./../actions');
const addState = connect(
function receiveState(state) {
const {
// ws,
account,
} = state;
return {
account,
};
},
function receiveDispatch(dispatch) {
function setMtxActive(mtx) {
dispatch(actions.setMtxActive(mtx));
}
return {
setMtxActive,
};
}
);
function Inventory(args) {
const {
account,
setMtxActive,
} = args;
return (
<div class="inventory">
<h1>¤ {account.credits}</h1>
<div class='list'>
<figure onClick={() => setMtxActive('Reimage')} >
<figcaption>Reimage</figcaption>
<button>¤1</button>
</figure>
<figure onClick={() => setMtxActive('Rename')} >
<figcaption>Rename</figcaption>
<button>¤1</button>
</figure>
<figure>
<figcaption>Invader Architecture</figcaption>
<button></button>
</figure>
<figure>
<figcaption>Molecular Architecture</figcaption>
<button></button>
</figure>
</div>
</div>
);
}
module.exports = addState(Inventory);