diff options
author | Kevin Serrano <kevgagser@gmail.com> | 2016-08-05 05:04:04 +0800 |
---|---|---|
committer | Kevin Serrano <kevgagser@gmail.com> | 2016-08-05 05:04:04 +0800 |
commit | 92fb827923d5b162e2418aaa4e90646244722cc6 (patch) | |
tree | 08cb282a77f87f12f028ef8380cb3971e37134d7 | |
parent | 479abadaa7dc59dc900cb35e897e0f164e3bb345 (diff) | |
download | tangerine-wallet-browser-92fb827923d5b162e2418aaa4e90646244722cc6.tar tangerine-wallet-browser-92fb827923d5b162e2418aaa4e90646244722cc6.tar.gz tangerine-wallet-browser-92fb827923d5b162e2418aaa4e90646244722cc6.tar.bz2 tangerine-wallet-browser-92fb827923d5b162e2418aaa4e90646244722cc6.tar.lz tangerine-wallet-browser-92fb827923d5b162e2418aaa4e90646244722cc6.tar.xz tangerine-wallet-browser-92fb827923d5b162e2418aaa4e90646244722cc6.tar.zst tangerine-wallet-browser-92fb827923d5b162e2418aaa4e90646244722cc6.zip |
currency now selectable and save-able.
-rw-r--r-- | package.json | 1 | ||||
-rw-r--r-- | ui/app/actions.js | 2 | ||||
-rw-r--r-- | ui/app/config.js | 25 |
3 files changed, 26 insertions, 2 deletions
diff --git a/package.json b/package.json index ded561301..4b1315008 100644 --- a/package.json +++ b/package.json @@ -60,6 +60,7 @@ "react-hyperscript": "^2.2.2", "react-markdown": "^2.3.0", "react-redux": "^4.4.5", + "react-select": "^1.0.0-beta14", "react-tooltip-component": "^0.3.0", "readable-stream": "^2.1.2", "redux": "^3.0.5", diff --git a/ui/app/actions.js b/ui/app/actions.js index a5846f0d2..2fd1ccc1c 100644 --- a/ui/app/actions.js +++ b/ui/app/actions.js @@ -218,9 +218,7 @@ function revealAccount () { function setCurrentFiat (fiat) { return (dispatch) => { - dispatch(this.showLoadingIndication()) _accountManager.setCurrentFiat(fiat, (data, err) => { - dispatch(this.hideLoadingIndication()) dispatch({ type: this.SET_CURRENT_FIAT, value: { diff --git a/ui/app/config.js b/ui/app/config.js index c88e7ac6e..5fac358b6 100644 --- a/ui/app/config.js +++ b/ui/app/config.js @@ -3,6 +3,7 @@ const Component = require('react').Component const h = require('react-hyperscript') const connect = require('react-redux').connect const actions = require('./actions') +const select = require('react-select') module.exports = connect(mapStateToProps)(ConfigScreen) @@ -74,6 +75,8 @@ ConfigScreen.prototype.render = function () { }, 'Save'), ]), h('hr.horizontal-line'), + currentConversionInformation(metamaskState, state), + h('hr.horizontal-line'), h('div', { style: { @@ -97,6 +100,28 @@ ConfigScreen.prototype.render = function () { ) } +function currentConversionInformation (metamaskState, state) { + var currentFiat = metamaskState.currentFiat + return h('div'), [ + h('span', {style: { fontWeight: 'bold', paddingRight: '10px'}}, "Current Fiat"), + h('select#currentFiat', { + onChange (event) { + event.preventDefault() + var element = document.getElementById("currentFiat") + var newFiat = element.value + state.dispatch(actions.setCurrentFiat(newFiat)) + }, + value: currentFiat, + defaultValue: currentFiat, + }, [ + h('option', {key: 'usd', value: 'usd'}, 'usd'), + h('option', {key: 'eur', value: 'eur'}, 'eur'), + h('option', {key: 'jpy', value: 'jpy'}, 'jpy'), + ] + ), + ] +} + function currentProviderDisplay (metamaskState) { var provider = metamaskState.provider var title, value |