Skip to content

Commit

Permalink
Merge pull request #14 from oktapodia/fix/undefined-currency
Browse files Browse the repository at this point in the history
Fix undefined currency + add Coin -> ETH
  • Loading branch information
oktapodia authored Nov 7, 2017
2 parents 1e83aa6 + 37a3eac commit 9398909
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 58 deletions.
1 change: 1 addition & 0 deletions app/connectors/cryptocompare/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ export function getSymbolListApi() {
'USD',
'GBP',
'BTC',
'ETH',
],
});
}
8 changes: 8 additions & 0 deletions app/helpers/formatPrice.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
import { has } from 'lodash';

function formatPrice(price, currency) {
const symbols = {
USD: '$',
EUR: '€',
GBP: '£',
BTC: '฿',
ETH: 'Ξ',
};

if (!has(symbols, currency)) {
return `${currency} ${price}`;
}

return `${symbols[currency]}${price}`;
}

Expand Down
2 changes: 1 addition & 1 deletion app/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "CoinWatch",
"productName": "CoinWatch",
"version": "0.2.1",
"version": "0.2.2",
"description": "Electron application boilerplate based on React, React Router, Webpack, React Hot Loader for rapid application development",
"main": "./main.prod.js",
"author": {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "coinwatch",
"productName": "CoinWatch",
"version": "0.2.1",
"version": "0.2.2",
"description": "Follow your cryptocurrencies from your Osx menubar",
"scripts": {
"build": "concurrently \"npm run build-main\" \"npm run build-renderer\"",
Expand Down
77 changes: 21 additions & 56 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1963,7 +1963,7 @@ buffers@~0.1.1:
version "0.1.1"
resolved "https://registry.yarnpkg.com/buffers/-/buffers-0.1.1.tgz#b24579c3bed4d6d396aeee6d9a8ae7f5482ab7bb"

[email protected], builder-util-runtime@^2.5.0, builder-util-runtime@~2.5.0:
[email protected], builder-util-runtime@^2.5.0:
version "2.5.0"
resolved "https://registry.yarnpkg.com/builder-util-runtime/-/builder-util-runtime-2.5.0.tgz#22373d4faab8d89e0b077630aef76538deb38476"
dependencies:
Expand All @@ -1972,6 +1972,15 @@ [email protected], builder-util-runtime@^2.5.0, builder-util-runtime@~2
fs-extra-p "^4.4.4"
sax "^1.2.4"

builder-util-runtime@~3.1.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/builder-util-runtime/-/builder-util-runtime-3.1.0.tgz#60ec66d3c49f028655230a09d7767e77ff6f15b8"
dependencies:
bluebird-lst "^1.0.5"
debug "^3.1.0"
fs-extra-p "^4.4.4"
sax "^1.2.4"

[email protected], builder-util@^3.2.0:
version "3.2.0"
resolved "https://registry.yarnpkg.com/builder-util/-/builder-util-3.2.0.tgz#08900f046c6b09c22a1f235f18644ae9eb963bc4"
Expand Down Expand Up @@ -3323,8 +3332,8 @@ [email protected]:
mime "^2.0.3"

electron-settings@^3.1.3:
version "3.1.3"
resolved "https://registry.yarnpkg.com/electron-settings/-/electron-settings-3.1.3.tgz#4e26fac0587ab74472dae56ab7c7b867f5c6fa54"
version "3.1.4"
resolved "https://registry.yarnpkg.com/electron-settings/-/electron-settings-3.1.4.tgz#1b670837fd00626395714210291fb4af8ff52880"
dependencies:
clone "^2.1.1"
jsonfile "^4.0.0"
Expand All @@ -3338,11 +3347,11 @@ electron-to-chromium@^1.3.24:
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.25.tgz#453b21009836d0997d86035601ff6cae4791c460"

electron-updater@^2.15.0:
version "2.15.1"
resolved "https://registry.yarnpkg.com/electron-updater/-/electron-updater-2.15.1.tgz#9cd218d5960b4e36b2528e92aff102d05911f9ae"
version "2.16.1"
resolved "https://registry.yarnpkg.com/electron-updater/-/electron-updater-2.16.1.tgz#29e85589ec31ae817ca05bcaf10358bd66119188"
dependencies:
bluebird-lst "^1.0.5"
builder-util-runtime "~2.5.0"
builder-util-runtime "~3.1.0"
electron-is-dev "^0.3.0"
fs-extra-p "^4.4.4"
js-yaml "^3.10.0"
Expand Down Expand Up @@ -4796,26 +4805,6 @@ highlight.js@^9.3.0:
version "9.12.0"
resolved "https://registry.yarnpkg.com/highlight.js/-/highlight.js-9.12.0.tgz#e6d9dbe57cbefe60751f02af336195870c90c01e"

history@^4.5.1:
version "4.6.3"
resolved "https://registry.yarnpkg.com/history/-/history-4.6.3.tgz#6d723a8712c581d6bef37e8c26f4aedc6eb86967"
dependencies:
invariant "^2.2.1"
loose-envify "^1.2.0"
resolve-pathname "^2.0.0"
value-equal "^0.2.0"
warning "^3.0.0"

history@^4.6.0:
version "4.6.1"
resolved "https://registry.yarnpkg.com/history/-/history-4.6.1.tgz#911cf8eb65728555a94f2b12780a0c531a14d2fd"
dependencies:
invariant "^2.2.1"
loose-envify "^1.2.0"
resolve-pathname "^2.0.0"
value-equal "^0.2.0"
warning "^3.0.0"

history@^4.7.2:
version "4.7.2"
resolved "https://registry.yarnpkg.com/history/-/history-4.7.2.tgz#22b5c7f31633c5b8021c7f4a8a954ac139ee8d5b"
Expand All @@ -4842,10 +4831,6 @@ [email protected]:
version "4.2.0"
resolved "https://registry.yarnpkg.com/hoek/-/hoek-4.2.0.tgz#72d9d0754f7fe25ca2d01ad8f8f9a9449a89526d"

hoist-non-react-statics@^1.2.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/hoist-non-react-statics/-/hoist-non-react-statics-1.2.0.tgz#aa448cf0986d55cc40773b17174b7dd066cb7cfb"

hoist-non-react-statics@^2.2.1, hoist-non-react-statics@^2.3.0, hoist-non-react-statics@^2.3.1:
version "2.3.1"
resolved "https://registry.yarnpkg.com/hoist-non-react-statics/-/hoist-non-react-statics-2.3.1.tgz#343db84c6018c650778898240135a1420ee22ce0"
Expand Down Expand Up @@ -7201,7 +7186,7 @@ [email protected]:
version "0.1.7"
resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-0.1.7.tgz#df604178005f522f15eb4490e7247a1bfaa67f8c"

path-to-regexp@^1.5.3, path-to-regexp@^1.7.0:
path-to-regexp@^1.7.0:
version "1.7.0"
resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-1.7.0.tgz#59fde0f435badacba103a84e9d3bc64e96b9937d"
dependencies:
Expand Down Expand Up @@ -7999,24 +7984,12 @@ react-router-dom@^4.2.2:
warning "^3.0.0"

react-router-redux@^5.0.0-alpha.6:
version "5.0.0-alpha.6"
resolved "https://registry.yarnpkg.com/react-router-redux/-/react-router-redux-5.0.0-alpha.6.tgz#7418663c2ecd3c51be856fcf28f3d1deecc1a576"
version "5.0.0-alpha.8"
resolved "https://registry.yarnpkg.com/react-router-redux/-/react-router-redux-5.0.0-alpha.8.tgz#5242c705730b2ac862aff7a8e90f870d0cf45e12"
dependencies:
history "^4.5.1"
prop-types "^15.5.4"
react-router "^4.1.1"

react-router@^4.1.1:
version "4.1.1"
resolved "https://registry.yarnpkg.com/react-router/-/react-router-4.1.1.tgz#d448f3b7c1b429a6fbb03395099949c606b1fe95"
dependencies:
history "^4.6.0"
hoist-non-react-statics "^1.2.0"
invariant "^2.2.2"
loose-envify "^1.3.1"
path-to-regexp "^1.5.3"
prop-types "^15.5.4"
warning "^3.0.0"
history "^4.7.2"
prop-types "^15.6.0"
react-router "^4.2.0"

react-router@^4.2.0:
version "4.2.0"
Expand Down Expand Up @@ -8468,10 +8441,6 @@ resolve-from@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-4.0.0.tgz#4abcd852ad32dd7baabfe9b40e00a36db5f392e6"

resolve-pathname@^2.0.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/resolve-pathname/-/resolve-pathname-2.1.0.tgz#e8358801b86b83b17560d4e3c382d7aef2100944"

resolve-pathname@^2.2.0:
version "2.2.0"
resolved "https://registry.yarnpkg.com/resolve-pathname/-/resolve-pathname-2.2.0.tgz#7e9ae21ed815fd63ab189adeee64dc831eefa879"
Expand Down Expand Up @@ -9929,10 +9898,6 @@ validator@~7.0.0:
version "7.0.0"
resolved "https://registry.yarnpkg.com/validator/-/validator-7.0.0.tgz#c74deb8063512fac35547938e6f0b1504a282fd2"

value-equal@^0.2.0:
version "0.2.1"
resolved "https://registry.yarnpkg.com/value-equal/-/value-equal-0.2.1.tgz#c220a304361fce6994dbbedaa3c7e1a1b895871d"

value-equal@^0.4.0:
version "0.4.0"
resolved "https://registry.yarnpkg.com/value-equal/-/value-equal-0.4.0.tgz#c5bdd2f54ee093c04839d71ce2e4758a6890abc7"
Expand Down

0 comments on commit 9398909

Please sign in to comment.