info fixes
This commit is contained in:
parent
2f8ff69aee
commit
5632713144
@ -10,6 +10,7 @@ function Info(args) {
|
|||||||
info,
|
info,
|
||||||
sendUnequip,
|
sendUnequip,
|
||||||
instance,
|
instance,
|
||||||
|
setInfo,
|
||||||
} = args;
|
} = args;
|
||||||
|
|
||||||
function infoVar([type, value]) {
|
function infoVar([type, value]) {
|
||||||
@ -87,10 +88,17 @@ function Info(args) {
|
|||||||
function infoCrypElement(cryp) {
|
function infoCrypElement(cryp) {
|
||||||
// onClick={() => setInfo('skill', { skill: s, cryp })}
|
// onClick={() => setInfo('skill', { skill: s, cryp })}
|
||||||
const skills = range(0, 4).map(i => {
|
const skills = range(0, 4).map(i => {
|
||||||
|
const skill = cryp.skills[i];
|
||||||
|
|
||||||
|
function skillClick() {
|
||||||
|
if (!skill) return false;
|
||||||
|
return setInfo('skill', { skill: skill.skill, cryp });
|
||||||
|
}
|
||||||
|
|
||||||
const s = cryp.skills[i]
|
const s = cryp.skills[i]
|
||||||
? cryp.skills[i].skill
|
? cryp.skills[i].skill
|
||||||
: (<span> </span>);
|
: (<span> </span>);
|
||||||
return <button key={i} className="cryp-skill-btn right" >{s}</button>;
|
return <button key={i} className="cryp-skill-btn" onClick={skillClick} >{s}</button>;
|
||||||
});
|
});
|
||||||
|
|
||||||
const stats = Object.values(STATS).map((s, j) => (
|
const stats = Object.values(STATS).map((s, j) => (
|
||||||
@ -100,12 +108,18 @@ function Info(args) {
|
|||||||
</figure>
|
</figure>
|
||||||
));
|
));
|
||||||
|
|
||||||
const specs = cryp.specs.map((s, i) => (
|
const specs = cryp.specs.map((s, i) => {
|
||||||
<figure key={i}>
|
function specClick() {
|
||||||
{SPECS[s].svg(`stat-icon ${SPECS[s].colour}`)}
|
setInfo('spec', { spec: s, cryp });
|
||||||
<figcaption>{SPECS[s].caption}</figcaption>
|
}
|
||||||
</figure>
|
|
||||||
));
|
return (
|
||||||
|
<figure key={i} onClick={specClick} >
|
||||||
|
{SPECS[s].svg(`stat-icon ${SPECS[s].colour}`)}
|
||||||
|
<figcaption>{SPECS[s].caption}</figcaption>
|
||||||
|
</figure>
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
@ -1,7 +1,6 @@
|
|||||||
const { connect } = require('preact-redux');
|
const { connect } = require('preact-redux');
|
||||||
|
|
||||||
// const actions = require('../actions');
|
const actions = require('../actions');
|
||||||
|
|
||||||
const Info = require('./info.component');
|
const Info = require('./info.component');
|
||||||
|
|
||||||
const addState = connect(
|
const addState = connect(
|
||||||
@ -23,13 +22,24 @@ const addState = connect(
|
|||||||
sendUnequip,
|
sendUnequip,
|
||||||
instance,
|
instance,
|
||||||
};
|
};
|
||||||
}
|
},
|
||||||
/*
|
|
||||||
function receiveDispatch(dispatch) {
|
|
||||||
|
|
||||||
return { };
|
function receiveDispatch(dispatch) {
|
||||||
|
function setInfo(item, value) {
|
||||||
|
dispatch(actions.setInfo([item, value]));
|
||||||
|
}
|
||||||
|
|
||||||
|
function setActiveVar(value) {
|
||||||
|
dispatch(actions.setActiveVar(value));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return {
|
||||||
|
setInfo,
|
||||||
|
setActiveVar,
|
||||||
|
};
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
);
|
);
|
||||||
|
|
||||||
module.exports = addState(Info);
|
module.exports = addState(Info);
|
||||||
|
|||||||
@ -25,7 +25,7 @@ function Cryp(props) {
|
|||||||
|
|
||||||
function skillClick() {
|
function skillClick() {
|
||||||
if (!skill) return false;
|
if (!skill) return false;
|
||||||
setInfo('skill', { skill, cryp });
|
setInfo('skill', { skill: skill.skill, cryp });
|
||||||
return setActiveCryp(cryp);
|
return setActiveCryp(cryp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user