spawn button

This commit is contained in:
ntr 2018-10-08 17:26:23 +11:00
parent 840d571b89
commit c950a0a866

View File

@ -1,23 +1,43 @@
const preact = require('preact'); const preact = require('preact');
function CrypPanel({ cryps, sendCombatPve }) { function CrypPanel({ cryps, sendCombatPve }) {
if (!cryps) return <div>not ready</div>; if (!cryps) return <div>not ready</div>;
const crypPanels = cryps.map(cryp => ( const crypPanels = cryps.map(cryp => (
<div key={cryp.id} className="tile is-parent is-vertical box">
<div className="title">{cryp.name}</div> <div key={cryp.id} className="tile is-parent is-vertical box">
<button <div className="tile is-vertical is-child">
className="button is-success" <div className="columns" >
type="submit" <div className="column is-10">
onClick={() => sendCombatPve(cryp.id)}> <p className="title">{cryp.name}</p>
Start PVE <p className="subtitle">Level {cryp.lvl}</p>
</button> </div>
</div> <div className="column">
)); <figure className="image">
return ( <svg width="40" height="40" data-jdenticon-value={cryp.name} />
<div> </figure>
{crypPanels} </div>
</div>
); </div>
} <div className="has-text-centered">{cryp.hp.value} / {cryp.stam.value} HP </div>
<progress className="progress is-success" value={cryp.hp.value} max={cryp.stam.value}></progress>
module.exports = CrypPanel; </div>
<button
className="button is-success"
type="submit"
onClick={() => sendCombatPve(cryp.id)}>
Start PVE
</button>
</div>
));
return (
<div>
<a className="button is-large is-fullwidth">
<span>Spawn 👾</span>
<span className="icon is-medium"><i className="fab fa-plus"></i></span>
</a>
{crypPanels}
</div>
);
}
module.exports = CrypPanel;