From 19d1118cc4ad4b0453be9224ac1f90b563511e3a Mon Sep 17 00:00:00 2001 From: ntr Date: Sun, 21 Jul 2019 20:10:52 +1000 Subject: [PATCH] yew --- client/assets/styles/vbox.less | 18 +++++++++--------- client/src/components/instance.constructs.jsx | 16 ++++++++-------- client/src/components/nav.jsx | 2 +- client/src/components/vbox.component.jsx | 14 ++++++++++++++ 4 files changed, 32 insertions(+), 18 deletions(-) diff --git a/client/assets/styles/vbox.less b/client/assets/styles/vbox.less index 42c6999b..6371c2df 100644 --- a/client/assets/styles/vbox.less +++ b/client/assets/styles/vbox.less @@ -45,19 +45,19 @@ background-color: @gray; border-width: 0; - .reclaim { - height: auto; - - :hover { - color: @red; - }; - } - :active, :hover, :focus { color: white; } - .reclaiming, .reclaiming:hover, .reclaiming:active { + &.reclaim { + height: auto; + + &:hover { + color: @red; + }; + } + + &.reclaiming, &.reclaiming:hover, &.reclaiming:active { background: @red; color: black; } diff --git a/client/src/components/instance.constructs.jsx b/client/src/components/instance.constructs.jsx index 9b79cb4a..5f92db4c 100644 --- a/client/src/components/instance.constructs.jsx +++ b/client/src/components/instance.constructs.jsx @@ -81,11 +81,15 @@ function Construct(props) { sendUnequip, } = props; + const fullInfo = itemInfo.items.find(i => i.item === itemEquip); + const isSkill = fullInfo && fullInfo.skill; + const isSpec = fullInfo && fullInfo.spec; + const equipping = itemEquip && (isSkill || isSpec); + function onClick(e) { e.stopPropagation(); e.preventDefault(); - console.log('const click eA') - if (itemEquip !== null) sendVboxApply(construct.id, itemEquip); + if (equipping) sendVboxApply(construct.id, itemEquip); setItemEquip(null); return setActiveConstruct(construct); } @@ -124,13 +128,11 @@ function Construct(props) { return true; } - // const action = skill ? '' : 'action'; - const equip = skillList.includes(vbox.bound[itemEquip]) && !skill ? 'equipping' : ''; - const classes = `${equip}`; + const classes = `${equipping ? 'equipping' : ''}`; return (