diff --git a/client/src/actions.jsx b/client/src/actions.jsx index 40a16475..9beb8700 100644 --- a/client/src/actions.jsx +++ b/client/src/actions.jsx @@ -29,7 +29,7 @@ export const SET_ACTIVE_SKILL = 'SET_ACTIVE_SKILL'; export const setActiveSkill = (crypId, skill) => ({ type: SET_ACTIVE_SKILL, value: crypId ? { crypId, skill } : null }); export const SET_INFO = 'SET_INFO'; -export const setInfo = (type, value) => ({ type: SET_INFO, value: type ? { type, value } : null }); +export const setInfo = value => ({ type: SET_INFO, value: Array.from(value) }); export const SET_RECLAIMING = 'SET_RECLAIMING'; export const setReclaiming = value => ({ type: SET_RECLAIMING, value }); diff --git a/client/src/components/info.component.jsx b/client/src/components/info.component.jsx index 532b8369..283f6766 100644 --- a/client/src/components/info.component.jsx +++ b/client/src/components/info.component.jsx @@ -8,22 +8,27 @@ function Info(args) { } = args; if (!info) return (
 
); - if (info.type === 'skill') { + console.log(info); + + const [type, value] = info; + + if (type === 'skill') { return (
-
{info.value.skill}
-
{SKILLS[info.value.skill].description}
-
{SKILLS[info.value.skill].upgrades}
+
{value.skill}
+
{SKILLS[value.skill].description}
+
{SKILLS[value.skill].upgrades}
-
); } - if (info.type === 'cryp') { + if (type === 'cryp') { + const cryp = value; const stats = [ { stat: 'hp', disp: 'Hp', colour: '#1FF01F' }, { stat: 'red_shield', disp: 'Red Shield', colour: '#a52a2a' }, @@ -33,32 +38,32 @@ function Info(args) { { stat: 'green_damage', disp: 'Green Damage', colour: '#1FF01F' }, { stat: 'speed', disp: 'Speed', colour: '#FFD123' }, ].map((s, i) => ( -
{s.disp}: {info.value[s.stat].max}
+
{s.disp}: {cryp[s.stat].max}
)); - const skills = info.value.skills.map((s, i) => ); + const skills = cryp.skills.map((s, i) => ); return (
-
{info.value.name}
+
{cryp.name}
{stats} {skills}
); } - /*if (info.item) { - if (SKILLS[info.item]) { - itemDetails = SKILLS[info.item]; - } else if (SPECS[info.item]) { - itemDetails = SPECS[info.item]; - } else if (COLOURS[info.item]) { - itemDetails = COLOURS[info.item]; + /*if (item) { + if (SKILLS[item]) { + itemDetails = SKILLS[item]; + } else if (SPECS[item]) { + itemDetails = SPECS[item]; + } else if (COLOURS[item]) { + itemDetails = COLOURS[item]; } }*/ -/* const unequip = (itemDetails && info.cryp) - ? +/* const unequip = (itemDetails && cryp) + ? : null; */ diff --git a/client/src/components/instance.container.jsx b/client/src/components/instance.container.jsx index 4ae4e971..054c8573 100644 --- a/client/src/components/instance.container.jsx +++ b/client/src/components/instance.container.jsx @@ -24,8 +24,8 @@ const addState = connect( dispatch(actions.setInstance(null)); } - function setInfo(item, cryp) { - dispatch(actions.setInfo(item, cryp)); + function setInfo(item, value) { + dispatch(actions.setInfo([item, value])); } return { quit, setInfo };