1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-10-22 11:22:43 +02:00

currency now selectable and save-able.

This commit is contained in:
Kevin Serrano 2016-08-04 14:04:04 -07:00
parent 479abadaa7
commit 92fb827923
3 changed files with 26 additions and 2 deletions

View File

@ -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",

View File

@ -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: {

View File

@ -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