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 { 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 db from 'helpers/db'
@ -29,6 +29,7 @@ export const fetchCounterValues: FetchCounterValues = (currencies: ?(Currency[])
if (!currencies) {
currencies = accounts.map(a => a.currency)
}
const { counterValue } = settings
const fiatUnit = getFiatUnit(counterValue)
const counterValues = await fetchHistodayCounterValuesMultiple(currencies, fiatUnit)

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

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

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

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

2
src/reducers/counterValues.js

@ -8,8 +8,8 @@ import {
makeReverseCounterValue,
formatCounterValueDay,
} 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'
export type CounterValuesState = {}

Loading…
Cancel
Save