From 6be879857de456248f222c91c208db6b230923ee Mon Sep 17 00:00:00 2001 From: meriadec Date: Wed, 11 Jul 2018 17:10:38 +0200 Subject: [PATCH] Use user-defined countervalue in account page chart tooltip closes #965 --- src/components/BalanceSummary/index.js | 1 + src/components/base/Chart/handleMouseEvents.js | 2 +- src/components/base/Chart/index.js | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/BalanceSummary/index.js b/src/components/BalanceSummary/index.js index fc142a3a..c2a54702 100644 --- a/src/components/BalanceSummary/index.js +++ b/src/components/BalanceSummary/index.js @@ -73,6 +73,7 @@ const BalanceSummary = ({ } height={200} currency={counterValue} + cvCode={counterValue.ticker} tickXScale={selectedTimeRange} renderTickY={ isAvailable ? val => formatShort(counterValue.units[0], val) : () => '' diff --git a/src/components/base/Chart/handleMouseEvents.js b/src/components/base/Chart/handleMouseEvents.js index 77096ed3..b82c0624 100644 --- a/src/components/base/Chart/handleMouseEvents.js +++ b/src/components/base/Chart/handleMouseEvents.js @@ -96,7 +96,7 @@ export default function handleMouseEvents({ unit={props.unit} renderTooltip={renderTooltip} item={d.ref} - counterValue={getFiatCurrencyByTicker('USD')} + counterValue={getFiatCurrencyByTicker(props.cvCode || 'USD')} /> , diff --git a/src/components/base/Chart/index.js b/src/components/base/Chart/index.js index 2b14a107..2ca37856 100644 --- a/src/components/base/Chart/index.js +++ b/src/components/base/Chart/index.js @@ -48,6 +48,7 @@ import type { Data } from './types' export type Props = { data: Data, // eslint-disable-line react/no-unused-prop-types unit?: ?Unit, // eslint-disable-line react/no-unused-prop-types + cvCode?: string, // eslint-disable-line react/no-unused-prop-types id?: string, // eslint-disable-line react/no-unused-prop-types height?: number, tickXScale: string, // eslint-disable-line react/no-unused-prop-types