Fixed bug in MetricCard: plus sign disappears on click.

This commit is contained in:
Guillermo Grau 2022-08-26 16:40:32 +02:00
parent 0f976be5d8
commit e91bfed6be
2 changed files with 6 additions and 2 deletions

View File

@ -29,9 +29,9 @@ const MetricCard = ({
: !reverseColors
? styles.negative
: styles.positive
}`}
} ${change >= 0 ? styles.plusSign : ''}`}
>
{changeProps.x.interpolate(x => `${change >= 0 ? '+' : ''}${format(x)}`)}
{changeProps.x.interpolate(x => format(x))}
</animated.span>
)}
</div>

View File

@ -37,3 +37,7 @@
.change.negative {
color: var(--red500);
}
.change.plusSign::before {
content: '+';
}