diff --git a/src/components/BalanceSummary/BalanceInfos.js b/src/components/BalanceSummary/BalanceInfos.js
index 8b3ad174..12129e59 100644
--- a/src/components/BalanceSummary/BalanceInfos.js
+++ b/src/components/BalanceSummary/BalanceInfos.js
@@ -42,10 +42,10 @@ export function BalanceSincePercent(props: BalanceSinceProps) {
return (
{t(`time:since.${since}`)}
@@ -58,10 +58,10 @@ export function BalanceSinceDiff(props: Props) {
{t(`time:since.${since}`)}
@@ -73,7 +73,6 @@ export function BalanceTotal(props: BalanceTotalProps) {
return (
(p.isNegative ? p.theme.colors.alertRed : p.theme.colors.positiveGreen),
+ color: p =>
+ p.withIcon
+ ? p.theme.colors.dark
+ : p.isNegative
+ ? p.theme.colors.alertRed
+ : p.theme.colors.positiveGreen,
})``
+const I = ({ color, children }: { color: string, children: any }) => (
+ {children}
+)
+
type Props = {
- val: number,
+ alwaysShowSign?: boolean,
+ disableRounding?: boolean,
fiat?: string | null,
isPercent?: boolean,
- unit?: Unit | null,
- alwaysShowSign?: boolean,
showCode?: boolean,
- disableRounding?: boolean,
+ unit?: Unit | null,
+ val: number,
+ withIcon?: boolean,
}
function FormattedVal(props: Props) {
- const { val, disableRounding, fiat, isPercent, alwaysShowSign, showCode, ...p } = props
- let { unit } = props
+ const { disableRounding, fiat, isPercent, alwaysShowSign, showCode, withIcon, ...p } = props
+ let { val, unit } = props
if (isUndefined(val)) {
throw new Error('FormattedVal require a `val` prop. Received `undefined`')
@@ -45,6 +59,11 @@ function FormattedVal(props: Props) {
} else if (!unit) {
return ''
}
+
+ if (withIcon && isNegative) {
+ val *= -1
+ }
+
text = formatCurrencyUnit(unit, val, {
alwaysShowSign,
disableRounding,
@@ -53,8 +72,25 @@ function FormattedVal(props: Props) {
}
return (
-
- {text}
+
+ {withIcon ? (
+
+
+ {isNegative ? (
+
+
+
+ ) : (
+
+
+
+ )}
+
+ {text}
+
+ ) : (
+ text
+ )}
)
}
@@ -66,6 +102,7 @@ FormattedVal.defaultProps = {
isPercent: false,
showCode: false,
unit: null,
+ withIcon: false,
}
export default FormattedVal
diff --git a/src/icons/Bottom.js b/src/icons/Bottom.js
new file mode 100644
index 00000000..cc14334a
--- /dev/null
+++ b/src/icons/Bottom.js
@@ -0,0 +1,12 @@
+// @flow
+
+import React from 'react'
+
+export default ({ size, ...p }: { size: number }) => (
+
+)
diff --git a/src/icons/Top.js b/src/icons/Top.js
new file mode 100644
index 00000000..68c48884
--- /dev/null
+++ b/src/icons/Top.js
@@ -0,0 +1,12 @@
+// @flow
+
+import React from 'react'
+
+export default ({ size, ...p }: { size: number }) => (
+
+)