Return of the cryp stats

This commit is contained in:
Mashy
2019-05-11 16:05:24 +10:00
parent b940e63a5c
commit cc04738902
4 changed files with 45 additions and 18 deletions
+1 -1
View File
@@ -88,8 +88,8 @@ function InstanceComponent(args) {
<div>&nbsp;</div>
</div>
{actionBtn}
{timer}
</div>
{timer}
<VboxContainer />
<InstanceCrypsContainer />
<InfoContainer />
+10 -1
View File
@@ -3,7 +3,7 @@ const preact = require('preact');
const range = require('lodash/range');
const shapes = require('./shapes');
const { SPECS, crypAvatar } = require('../utils');
const { SPECS, STATS, crypAvatar } = require('../utils');
const actions = require('../actions');
const addState = connect(
@@ -119,6 +119,12 @@ function Cryp(props) {
);
});
const stats = Object.values(STATS).map((s, j) => (
<figure key={j} alt={s.stat} className={s.stat}>
{s.svg(`stat-icon ${s.colour}`)}
<figcaption>{cryp[s.stat].value}</figcaption>
</figure>
));
// const cTotal = cryp.colours.red + cryp.colours.blue + cryp.colours.green;
// const colours = mapValues(cryp.colours, c => {
// if (cTotal === 0) return 245;
@@ -147,6 +153,9 @@ function Cryp(props) {
<div className="specs">
{specs}
</div>
<div className="stats">
{stats}
</div>
</div>
);
}