aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/config.js
diff options
context:
space:
mode:
Diffstat (limited to 'ui/app/config.js')
-rw-r--r--ui/app/config.js25
1 files changed, 24 insertions, 1 deletions
diff --git a/ui/app/config.js b/ui/app/config.js
index c88e7ac6e..b043a47d6 100644
--- a/ui/app/config.js
+++ b/ui/app/config.js
@@ -3,7 +3,7 @@ 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
module.exports = connect(mapStateToProps)(ConfigScreen)
function mapStateToProps (state) {
@@ -74,6 +74,8 @@ ConfigScreen.prototype.render = function () {
}, 'Save'),
]),
h('hr.horizontal-line'),
+ currentConversionInformation(metamaskState, state),
+ h('hr.horizontal-line'),
h('div', {
style: {
@@ -97,6 +99,27 @@ ConfigScreen.prototype.render = function () {
)
}
+function currentConversionInformation (metamaskState, state) {
+ var currentFiat = metamaskState.currentFiat
+ var conversionDate = metamaskState.conversionDate
+ return h('div', [
+ h('span', {style: { fontWeight: 'bold', paddingRight: '10px'}}, 'Current Conversion'),
+ h('span', {style: { fontWeight: 'bold', paddingRight: '10px', fontSize: '13px'}}, `Updated ${Date(conversionDate)}`),
+ h('select#currentFiat', {
+ onChange (event) {
+ event.preventDefault()
+ var element = document.getElementById('currentFiat')
+ var newFiat = element.value
+ state.dispatch(actions.setCurrentFiat(newFiat))
+ },
+ defaultValue: currentFiat,
+ }, currencies.map((currency) => {
+ return h('option', {key: currency.code, value: currency.code}, `${currency.code} - ${currency.name}`)
+ })
+ ),
+ ])
+}
+
function currentProviderDisplay (metamaskState) {
var provider = metamaskState.provider
var title, value