diff --git a/client/src/actions.jsx b/client/src/actions.jsx
index 0c5db9ce..d952ba54 100644
--- a/client/src/actions.jsx
+++ b/client/src/actions.jsx
@@ -26,7 +26,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 = (item, cryp) => ({ type: SET_INFO, value: (item || cryp) ? { item, cryp } : null });
+export const setInfo = (type, value) => ({ type: SET_INFO, value: type ? { type, value } : null });
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 f10f20d4..4eb9db82 100644
--- a/client/src/components/info.component.jsx
+++ b/client/src/components/info.component.jsx
@@ -7,9 +7,45 @@ function Info(args) {
sendUnequip,
} = args;
if (!info) return (
);
- let itemDetails = null;
- if (info.item) {
+ if (info.type === 'skill') {
+ return (
+
+
+
{info.value.skill}
+
{SKILLS[info.value.skill].description}
+
{SKILLS[info.value.skill].upgrades}
+
+
+
+ );
+ }
+ if (info.type === 'cryp') {
+ const stats = [
+ { stat: 'hp', disp: 'Hp', colour: '#1FF01F' },
+ { stat: 'red_shield', disp: 'Red Shield', colour: '#a52a2a' },
+ { stat: 'blue_shield', disp: 'Blue Shield', colour: '#3498db' },
+ { stat: 'red_damage', disp: 'Red Damage', colour: '#a52a2a' },
+ { stat: 'blue_damage', disp: 'Blue Damage', colour: '#3498db' },
+ { stat: 'green_damage', disp: 'Green Damage', colour: '#1FF01F' },
+ { stat: 'speed', disp: 'Speed', colour: '#FFD123' },
+ ].map((s, i) => (
+ {s.disp}: {info.value[s.stat].max}
+ ));
+ const skills = info.value.skills.map((s, i) => );
+
+ return (
+
+
{info.value.name}
+ {stats}
+ {skills}
+
+ );
+ }
+
+ /*if (info.item) {
if (SKILLS[info.item]) {
itemDetails = SKILLS[info.item];
} else if (SPECS[info.item]) {
@@ -17,37 +53,14 @@ function Info(args) {
} else if (COLOURS[info.item]) {
itemDetails = COLOURS[info.item];
}
- }
- const crypHeader = info.cryp ? {info.cryp.name}
: null;
- const stats = info.cryp ? [
- { stat: 'hp', disp: 'Hp', colour: '#1FF01F' },
- { stat: 'red_shield', disp: 'Red Shield', colour: '#a52a2a' },
- { stat: 'blue_shield', disp: 'Blue Shield', colour: '#3498db' },
- { stat: 'red_damage', disp: 'Red Damage', colour: '#a52a2a' },
- { stat: 'blue_damage', disp: 'Blue Damage', colour: '#3498db' },
- { stat: 'green_damage', disp: 'Green Damage', colour: '#1FF01F' },
- { stat: 'speed', disp: 'Speed', colour: '#FFD123' },
- ].map((s, i) => (
- {s.disp}: {info.cryp[s.stat].max}
- )) : null;
-
- const itemInfo = itemDetails
- ? {info.item} - {itemDetails.description}
- : null;
-
- const unequip = (itemDetails && info.cryp)
+ }*/
+
+
+/* const unequip = (itemDetails && info.cryp)
?
: null;
+*/
-
- return (
-
- {crypHeader}
- {stats}
- {itemInfo}
- {unequip}
-
- );
}
module.exports = Info;
diff --git a/client/src/components/instance.component.jsx b/client/src/components/instance.component.jsx
index 93a1c683..e8340934 100644
--- a/client/src/components/instance.component.jsx
+++ b/client/src/components/instance.component.jsx
@@ -14,7 +14,7 @@ function Cryp(cryp, sendVboxApply, setInfo) {
const s = cryp.skills[i]
? cryp.skills[i].skill
: ( );
- return ;
+ return ;
});
// needed for ondrop to fire
@@ -45,7 +45,7 @@ function Cryp(cryp, sendVboxApply, setInfo) {
onDrop={onDrop}
>
- setInfo(null, cryp)}>
+ setInfo('cryp', cryp)}>
{molecule}
{cryp.name}
diff --git a/client/src/components/vbox.component.jsx b/client/src/components/vbox.component.jsx
index ffd3c18d..6e451314 100644
--- a/client/src/components/vbox.component.jsx
+++ b/client/src/components/vbox.component.jsx
@@ -53,7 +53,7 @@ function Vbox(args) {
const cells = row.map((c, j) => (
| { if (c) return setInfo(c, null) }}
+ onClick={() => { if (c) return setInfo('item', c)}}
onDblClick={() => sendVboxAccept(j, i) }
>
{convertVar(c)}
|