diff --git a/src/components/DashboardPage/BalanceInfos.js b/src/components/DashboardPage/BalanceInfos.js index 5820bed2..9ff8041c 100644 --- a/src/components/DashboardPage/BalanceInfos.js +++ b/src/components/DashboardPage/BalanceInfos.js @@ -3,6 +3,7 @@ import React from 'react' import { connect } from 'react-redux' import styled from 'styled-components' +import { getDefaultUnitByCoinType } from '@ledgerhq/currencies' import type { MapStateToProps } from 'react-redux' @@ -33,7 +34,7 @@ function BalanceInfos(props: Props) { {'since one week'} - + {'since one week'} diff --git a/src/components/TransactionsList/index.js b/src/components/TransactionsList/index.js index 02c79858..45b529ad 100644 --- a/src/components/TransactionsList/index.js +++ b/src/components/TransactionsList/index.js @@ -78,7 +78,7 @@ const Transaction = ({ tx: TransactionType, }) => { const time = moment(tx.received_at) - const Icon = getIconByCoinType(tx.account.currency.coinType) + const Icon = getIconByCoinType(get(tx, 'account.currency.coinType')) return ( @@ -123,7 +123,7 @@ const Transaction = ({ ( - {currencies.map(cur => ( - - {cur.coinType} - {cur.name} - - {cur.color ? ( - -
-
{cur.color}
- - ) : ( - '-' - )} - - {cur.icon ? createElement(cur.icon, { size: 30 }) : '-'} - - {cur.units && ( -
    - {cur.units.map(unit => ( -
  • - {unit.code} ({unit.magnitude}) -
  • - ))} -
- )} - - - ))} + {currencies.map(cur => { + const Icon = getIconByCoinType(cur.coinType) + return ( + + {cur.coinType} + {cur.name} + + {cur.color ? ( + +
+
{cur.color}
+ + ) : ( + '-' + )} + + {Icon ? : '-'} + + {cur.units && ( +
    + {cur.units.map(unit => ( +
  • + {unit.code} ({unit.magnitude}) +
  • + ))} +
+ )} + + + ) + })}