more description improvements

This commit is contained in:
Mashy
2019-10-30 18:02:50 +10:00
parent ea6936940a
commit e4f091b2b8
5 changed files with 32 additions and 32 deletions
+4 -1
View File
@@ -204,7 +204,10 @@ class InfoComponent extends preact.Component {
);
}
const cost = fullInfo.cost ? `- ${fullInfo.cost}b` : false;
const infoDescription = reactStringReplace(fullInfo.description, '\n', () => <br />);
const regEx = /(RedPower|BluePower|GreenPower|RedLife|BlueLife|GreenLife|SpeedStat|POWER|SPEED|LIFE)/;
let infoDescription = reactStringReplace(fullInfo.description, regEx, match => shapes[match]());
infoDescription = reactStringReplace(infoDescription, '\n', () => <br />);
return (
<div class="info-item">
<h2>{fullInfo.item} {cost}</h2>
+3 -1
View File
@@ -35,7 +35,9 @@ module.exports = {
BluePower: () => circle(['blue']),
SpeedStat: () => triangle(['white']),
POWER: () => circle(['white']),
LIFE: () => square(['white']),
SPEED: () => triangle(['white']),
// specs
// Base