diff options
Diffstat (limited to 'ui/app/config.js')
-rw-r--r-- | ui/app/config.js | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/ui/app/config.js b/ui/app/config.js index c88e7ac6e..664bcd2a7 100644 --- a/ui/app/config.js +++ b/ui/app/config.js @@ -3,6 +3,8 @@ const Component = require('react').Component const h = require('react-hyperscript') const connect = require('react-redux').connect const actions = require('./actions') +const currencies = require('./conversion-util').availableCurrencies.rows +const Select = require('react-select') module.exports = connect(mapStateToProps)(ConfigScreen) @@ -74,6 +76,8 @@ ConfigScreen.prototype.render = function () { }, 'Save'), ]), h('hr.horizontal-line'), + currentConversionInformation(metamaskState, state), + h('hr.horizontal-line'), h('div', { style: { @@ -97,6 +101,31 @@ ConfigScreen.prototype.render = function () { ) } +function currentConversionInformation (metamaskState, state) { + var currentFiat = metamaskState.currentFiat + return h('div'), [ + h('span', {style: { fontWeight: 'bold', paddingRight: '10px'}}, 'Current Conversion'), + 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, + }, currencies.map((currency) => { + return h('option', {key: currency.code, value: currency.code}, `${currency.code} - ${currency.name}`) + }) + // [ + // 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 |