Browse Source

Improved AddAccount Modal

master
Loëck Vézien 7 years ago
parent
commit
d4cf88a029
No known key found for this signature in database GPG Key ID: CBCDCE384E853AC4
  1. 3
      src/actions/counterValues.js
  2. 6
      src/components/base/Chart/Tooltip.js
  3. 2
      src/components/modals/AddAccount/index.js
  4. 2
      src/reducers/counterValues.js

3
src/actions/counterValues.js

@ -2,8 +2,8 @@
import { getFiatUnit } from '@ledgerhq/currencies' import { getFiatUnit } from '@ledgerhq/currencies'
import { fetchHistodayCounterValuesMultiple } from '@ledgerhq/wallet-common/lib/api/countervalue' import { fetchHistodayCounterValuesMultiple } from '@ledgerhq/wallet-common/lib/api/countervalue'
import type { Currency } from '@ledgerhq/currencies'
import type { Currency } from '@ledgerhq/currencies'
import type { Dispatch } from 'redux' import type { Dispatch } from 'redux'
import db from 'helpers/db' import db from 'helpers/db'
@ -29,6 +29,7 @@ export const fetchCounterValues: FetchCounterValues = (currencies: ?(Currency[])
if (!currencies) { if (!currencies) {
currencies = accounts.map(a => a.currency) currencies = accounts.map(a => a.currency)
} }
const { counterValue } = settings const { counterValue } = settings
const fiatUnit = getFiatUnit(counterValue) const fiatUnit = getFiatUnit(counterValue)
const counterValues = await fetchHistodayCounterValuesMultiple(currencies, fiatUnit) const counterValues = await fetchHistodayCounterValuesMultiple(currencies, fiatUnit)

6
src/components/base/Chart/Tooltip.js

@ -51,7 +51,7 @@ const Tooltip = ({
left: 0, left: 0,
transform: `translate3d(-50%, 0, 0)`, transform: `translate3d(-50%, 0, 0)`,
whiteSpace: 'nowrap', whiteSpace: 'nowrap',
marginBottom: 10, marginBottom: 5,
}} }}
> >
<TooltipContainer style={{ textAlign: 'center' }}> <TooltipContainer style={{ textAlign: 'center' }}>
@ -68,9 +68,7 @@ const Tooltip = ({
/> />
)} )}
</TooltipContainer> </TooltipContainer>
<div style={{ background: 'red' }}> <Arrow />
<Arrow />
</div>
</div> </div>
</div> </div>
) )

2
src/components/modals/AddAccount/index.js

@ -131,7 +131,7 @@ class AddAccountModal extends PureComponent<Props, State> {
stepIndex: 0, stepIndex: 0,
}) })
await fetchCounterValues(currency.coinType) await fetchCounterValues([currency])
this.setState({ this.setState({
fetchingCounterValues: false, fetchingCounterValues: false,

2
src/reducers/counterValues.js

@ -8,8 +8,8 @@ import {
makeReverseCounterValue, makeReverseCounterValue,
formatCounterValueDay, formatCounterValueDay,
} from '@ledgerhq/wallet-common/lib/helpers/countervalue' } from '@ledgerhq/wallet-common/lib/helpers/countervalue'
import type { CalculateCounterValue } from '@ledgerhq/wallet-common/lib/types'
import type { CalculateCounterValue } from '@ledgerhq/wallet-common/lib/types'
import type { State } from 'reducers' import type { State } from 'reducers'
export type CounterValuesState = {} export type CounterValuesState = {}

Loading…
Cancel
Save