tidy up descriptions

This commit is contained in:
Mashy
2019-10-28 22:36:00 +10:00
parent 52f6e528e4
commit 861cc63682
2 changed files with 62 additions and 33 deletions
+6 -3
View File
@@ -70,7 +70,8 @@ class InfoComponent extends preact.Component {
if (isSkill) {
const regEx = /(RedPower|BluePower|GreenPower|RedLife|BlueLife|GreenLife|SpeedStat)/;
const infoDescription = reactStringReplace(fullInfo.description, regEx, match => shapes[match]());
let infoDescription = reactStringReplace(fullInfo.description, regEx, match => shapes[match]());
infoDescription = reactStringReplace(infoDescription, '\n', () => <br />);
const itemSource = itemInfo.combos.filter(c => c.item === removeTier(info));
const itemSourceInfo = itemSource.length
? `${itemSource[0].components[0]} ${itemSource[0].components[1]} ${itemSource[0].components[2]}`
@@ -176,7 +177,8 @@ class InfoComponent extends preact.Component {
);
});
const regEx = /(RedPower|BluePower|GreenPower|RedLife|BlueLife|GreenLife|SpeedStat)/;
const infoDescription = reactStringReplace(fullInfo.description, regEx, match => shapes[match]());
let infoDescription = reactStringReplace(fullInfo.description, regEx, match => shapes[match]());
infoDescription = reactStringReplace(infoDescription, '\n', () => <br />);
const itemSource = itemInfo.combos.filter(c => c.item === info);
let itemSourceInfo = itemSource.length
? `${itemSource[0].components[0]} ${itemSource[0].components[1]} ${itemSource[0].components[2]}`
@@ -202,10 +204,11 @@ class InfoComponent extends preact.Component {
);
}
const cost = fullInfo.cost ? `- ${fullInfo.cost}b` : false;
const infoDescription = reactStringReplace(fullInfo.description, '\n', () => <br />);
return (
<div class="info-item">
<h2>{fullInfo.item} {cost}</h2>
<div>{fullInfo.description}</div>
<div>{infoDescription}</div>
</div>
);
}