From 2d16c8c91a96284b55fa2f519abe26885b102dbc Mon Sep 17 00:00:00 2001 From: Mashy Date: Thu, 12 Sep 2019 13:25:11 +1000 Subject: [PATCH] item base components for combo items --- client/src/components/info.component.jsx | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/client/src/components/info.component.jsx b/client/src/components/info.component.jsx index 5f7c262f..9b0d1c6d 100644 --- a/client/src/components/info.component.jsx +++ b/client/src/components/info.component.jsx @@ -40,11 +40,18 @@ function InfoComponent(args) { if (isSkill) { const regEx = /(RedPower|BluePower|GreenPower|RedLife|BlueLife|GreenLife|SpeedStat)/; const infoDescription = reactStringReplace(fullInfo.description, regEx, match => shapes[match]()); + const itemSource = itemInfo.combos.filter(c => c.item === info); + const itemSourceInfo = itemSource.length + ? `${itemSource[0].components[0]} ${itemSource[0].components[1]} ${itemSource[0].components[2]}` + : false; + const itemRegEx = /(Red|Blue|Green)/; + const itemSourceDescription = reactStringReplace(itemSourceInfo, itemRegEx, match => shapes[match]()); return (

{fullInfo.item}

SKILL

+ {itemSourceDescription}
{infoDescription}
); @@ -135,11 +142,18 @@ function InfoComponent(args) { }); const regEx = /(RedPower|BluePower|GreenPower|RedLife|BlueLife|GreenLife|SpeedStat)/; const infoDescription = reactStringReplace(fullInfo.description, regEx, match => shapes[match]()); + const itemSource = itemInfo.combos.filter(c => c.item === info); + const itemSourceInfo = itemSource.length + ? `${itemSource[0].components[0]} ${itemSource[0].components[1]} ${itemSource[0].components[2]}` + : false; + const itemRegEx = /(Red|Blue|Green)/; + const itemSourceDescription = reactStringReplace(itemSourceInfo, itemRegEx, match => shapes[match]()); return (

{info}

SPEC

+ {itemSourceDescription}
{infoDescription}
{thresholds}