Skip to content

armgit / umami

Public Imported from GitHub
0

Umami is a privacy-first web and product analytics platform. Traffic, campaigns, behavior, conversions, and revenue in one place. No cookies, no surveillance, self-hosted or in the cloud.

Fixed bug in MetricCard: plus sign disappears on click.

Guillermo Graue91bfed6be66
diff --git a/components/metrics/MetricCard.js b/components/metrics/MetricCard.js
index 429a37d60..eb16904cb 100644
--- a/components/metrics/MetricCard.js
+++ b/components/metrics/MetricCard.js
@@ -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>
diff --git a/components/metrics/MetricCard.module.css b/components/metrics/MetricCard.module.css
index 76a696094..a79385aa7 100644
--- a/components/metrics/MetricCard.module.css
+++ b/components/metrics/MetricCard.module.css
@@ -37,3 +37,7 @@
.change.negative {
color: var(--red500);
}
+
+.change.plusSign::before {
+ content: '+';
+}