Merge pull request #1466 from guigrpa/bugfix-metric-card-keep-sign

Fixed bug in MetricCard: plus sign disappears on click.
This commit is contained in:
Mike Cao 2022-08-29 22:39:49 -05:00 committed by GitHub
commit 4cae9b261e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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: '+';
}