Skip to content

Commit 8c95213

Browse files
authored
Merge pull request #1075 from MyCryptoHQ/develop
Tag Beta 0.2.1
2 parents 1cd65ec + 0dbad53 commit 8c95213

File tree

4 files changed

+80
-14
lines changed

4 files changed

+80
-14
lines changed

common/components/BalanceSidebar/EquivalentValues.scss

+26-2
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,39 @@
2525
&-values {
2626
display: flex;
2727
flex-wrap: wrap;
28+
&-spacer {
29+
height: 1px;
30+
width: 100%;
31+
margin: 0.5rem 0rem;
32+
margin-bottom: 0.75rem;
33+
background-color: #ececec;
34+
background-position: center;
35+
background-size: 1px 1px;
36+
}
2837
&-currency {
29-
width: 50%;
38+
min-width: 50%;
3039
margin-bottom: $space-xs;
40+
display: flex;
41+
flex-wrap: nowrap;
42+
align-items: center;
43+
&-fiat-symbol {
44+
height: 18px;
45+
width: 18px;
46+
margin-right: 0.5rem;
47+
text-align: center;
48+
}
49+
&-coin-and-token {
50+
img {
51+
height: 18px;
52+
width: 18px;
53+
margin-right: 0.5rem;
54+
}
55+
}
3156
&-label {
3257
white-space: pre-wrap;
3358
display: inline-block;
3459
min-width: 36px;
3560
opacity: 0.54;
36-
margin-right: 8px;
3761
}
3862
&-value {
3963
font-weight: 600;

common/components/BalanceSidebar/EquivalentValues.tsx

+45-3
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ import { Wei } from 'libs/units';
1212
import { AppState } from 'reducers';
1313
import { getNetworkConfig, getOffline } from 'selectors/config';
1414
import { connect } from 'react-redux';
15+
import btcIco from 'assets/images/bitcoin.png';
16+
import ethIco from 'assets/images/ether.png';
17+
import repIco from 'assets/images/augur.png';
1518
import { NetworkConfig } from 'types/network';
1619

1720
interface AllValue {
@@ -116,9 +119,22 @@ class EquivalentValues extends React.Component<Props, State> {
116119
const isFetching =
117120
!balance || balance.isPending || !tokenBalances || Object.keys(rates).length === 0;
118121
const pairRates = this.generateValues(equivalentValues.label, equivalentValues.value);
122+
const fiatSymbols = {
123+
USD: '$',
124+
EUR: '€',
125+
GBP: '£',
126+
CHF: ' '
127+
};
128+
const coinAndTokenSymbols = {
129+
BTC: btcIco,
130+
ETH: ethIco,
131+
REP: repIco
132+
};
119133

120-
const Value = ({ rate, value }) => (
121-
<div className="EquivalentValues-values-currency">
134+
const Value = ({ className = '', rate, value, symbol = '', icon = '' }) => (
135+
<div className={`EquivalentValues-values-currency ${className}`}>
136+
<img src={icon} />
137+
{!!symbol && <span className="EquivalentValues-values-currency-fiat-symbol">{symbol}</span>}
122138
<span className="EquivalentValues-values-currency-label">{rate}</span>{' '}
123139
<span className="EquivalentValues-values-currency-value">
124140
<UnitDisplay
@@ -165,7 +181,33 @@ class EquivalentValues extends React.Component<Props, State> {
165181
) : (
166182
<div className="EquivalentValues-values">
167183
{pairRates.length ? (
168-
pairRates.map((equiv, i) => <Value rate={equiv.rate} value={equiv.value} key={i} />)
184+
<React.Fragment>
185+
{pairRates.map(
186+
(equiv, i) =>
187+
(rateSymbols.symbols.fiat as string[]).includes(equiv.rate) && (
188+
<Value
189+
className="EquivalentValues-values-currency-fiat"
190+
rate={equiv.rate}
191+
value={equiv.value}
192+
symbol={fiatSymbols[equiv.rate]}
193+
key={i}
194+
/>
195+
)
196+
)}
197+
<div className="EquivalentValues-values-spacer" />
198+
{pairRates.map(
199+
(equiv, i) =>
200+
(rateSymbols.symbols.coinAndToken as string[]).includes(equiv.rate) && (
201+
<Value
202+
className="EquivalentValues-values-currency-coin-and-token"
203+
rate={equiv.rate}
204+
value={equiv.value}
205+
icon={coinAndTokenSymbols[equiv.rate]}
206+
key={i}
207+
/>
208+
)
209+
)}
210+
</React.Fragment>
169211
) : (
170212
<p>Sorry, equivalent values are not supported for this unit.</p>
171213
)}

common/config/data.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { getValues } from '../utils/helpers';
44
export const languages = require('./languages.json');
55

66
// Displays in the footer
7-
export const VERSION = '0.2.0 (BETA)';
7+
export const VERSION = '0.2.1 (BETA)';
88
export const N_FACTOR = 8192;
99

1010
// Displays at the top of the site, make message empty string to remove.

package.json

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "MyCrypto",
33
"author": "MyCryptoHQ",
4-
"version": "0.1.0",
4+
"version": "0.2.1",
55
"main": "main.js",
66
"description": "MyCrypto web and electron app",
77
"repository": "https://github.com/MyCryptoHQ/MyCrypto",
@@ -58,14 +58,14 @@
5858
"@types/jest": "22.1.2",
5959
"@types/lodash": "4.14.102",
6060
"@types/qrcode": "0.8.0",
61-
"@types/qrcode.react": "0.6.2",
61+
"@types/qrcode.react": "0.6.3",
6262
"@types/query-string": "5.0.1",
63-
"@types/react": "16.0.35",
64-
"@types/react-dom": "16.0.3",
65-
"@types/react-redux": "5.0.14",
66-
"@types/react-router-dom": "4.2.3",
67-
"@types/react-router-redux": "5.0.11",
68-
"@types/react-select": "1.2.0",
63+
"@types/react": "16.0.37",
64+
"@types/react-dom": "16.0.4",
65+
"@types/react-redux": "5.0.15",
66+
"@types/react-router-dom": "4.2.4",
67+
"@types/react-router-redux": "5.0.12",
68+
"@types/react-select": "1.2.2",
6969
"@types/redux-logger": "3.0.5",
7070
"@types/uuid": "3.4.3",
7171
"@types/webpack-env": "1.13.4",

0 commit comments

Comments
 (0)