From 92fb827923d5b162e2418aaa4e90646244722cc6 Mon Sep 17 00:00:00 2001 From: Kevin Serrano Date: Thu, 4 Aug 2016 14:04:04 -0700 Subject: currency now selectable and save-able. --- ui/app/config.js | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'ui/app/config.js') 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 -- cgit v1.2.3 From be76b05726a5431249ed651ff1282cc584b0724b Mon Sep 17 00:00:00 2001 From: Kevin Serrano Date: Thu, 4 Aug 2016 23:27:30 -0700 Subject: Holding off on select formatting for now. Renamed keys for options. --- ui/app/config.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'ui/app/config.js') diff --git a/ui/app/config.js b/ui/app/config.js index 5fac358b6..9178c199c 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 select = require('react-select') +const Select = require('react-select') module.exports = connect(mapStateToProps)(ConfigScreen) @@ -114,9 +114,9 @@ function currentConversionInformation (metamaskState, state) { 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'), + h('option', {key: 'USD', value: 'USD'}, 'USD'), + h('option', {key: 'EUR', value: 'EUR'}, 'EUR'), + h('option', {key: 'JPY', value: 'JPY'}, 'JPY'), ] ), ] -- cgit v1.2.3 From 8acb3e6007ee62e4f7f1795478de60b614947d96 Mon Sep 17 00:00:00 2001 From: Kevin Serrano Date: Tue, 9 Aug 2016 09:48:08 -0700 Subject: Enable full listing of supported currencies by Cryptonator. --- ui/app/config.js | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'ui/app/config.js') diff --git a/ui/app/config.js b/ui/app/config.js index 9178c199c..664bcd2a7 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 currencies = require('./conversion-util').availableCurrencies.rows const Select = require('react-select') module.exports = connect(mapStateToProps)(ConfigScreen) @@ -103,7 +104,7 @@ 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('span', {style: { fontWeight: 'bold', paddingRight: '10px'}}, 'Current Conversion'), h('select#currentFiat', { onChange (event) { event.preventDefault() @@ -113,11 +114,14 @@ function currentConversionInformation (metamaskState, state) { }, 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'), - ] + }, 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'), + // ] ), ] } -- cgit v1.2.3 From 7d1b2db87e9d66735d0de04dc5e8c53e72e8431b Mon Sep 17 00:00:00 2001 From: Kevin Serrano Date: Tue, 16 Aug 2016 10:48:31 -0700 Subject: linting and ignoring. --- ui/app/config.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'ui/app/config.js') diff --git a/ui/app/config.js b/ui/app/config.js index 664bcd2a7..c86d377bb 100644 --- a/ui/app/config.js +++ b/ui/app/config.js @@ -4,7 +4,7 @@ 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') +// const Select = require('react-select') module.exports = connect(mapStateToProps)(ConfigScreen) @@ -103,27 +103,27 @@ ConfigScreen.prototype.render = function () { function currentConversionInformation (metamaskState, state) { var currentFiat = metamaskState.currentFiat - return h('div'), [ + 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 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}`) - }) + 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) { -- cgit v1.2.3 From 58e3042a3b105d9481cddc3f1c6253ccc6f19565 Mon Sep 17 00:00:00 2001 From: Kevin Serrano Date: Tue, 16 Aug 2016 13:21:16 -0700 Subject: Remove logging. Clean up duplicate entries in currency list. --- ui/app/config.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'ui/app/config.js') diff --git a/ui/app/config.js b/ui/app/config.js index c86d377bb..868ee3213 100644 --- a/ui/app/config.js +++ b/ui/app/config.js @@ -4,7 +4,7 @@ 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') +const Select = require('react-select') module.exports = connect(mapStateToProps)(ConfigScreen) @@ -112,7 +112,6 @@ function currentConversionInformation (metamaskState, state) { 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}`) -- cgit v1.2.3 From da2527ddb4a1d78eba1126785dfe1583161a80fc Mon Sep 17 00:00:00 2001 From: Kevin Serrano Date: Tue, 16 Aug 2016 13:23:28 -0700 Subject: Remove react-select as dependency. --- ui/app/config.js | 7 ------- 1 file changed, 7 deletions(-) (limited to 'ui/app/config.js') diff --git a/ui/app/config.js b/ui/app/config.js index 868ee3213..620e54069 100644 --- a/ui/app/config.js +++ b/ui/app/config.js @@ -4,8 +4,6 @@ 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) function mapStateToProps (state) { @@ -116,11 +114,6 @@ function currentConversionInformation (metamaskState, state) { }, 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'), - // ] ), ]) } -- cgit v1.2.3 From 3b27fe13567271613b1dee8fd705452fc594e45c Mon Sep 17 00:00:00 2001 From: Kevin Serrano Date: Tue, 16 Aug 2016 14:07:42 -0700 Subject: Add recent conversion date. --- ui/app/config.js | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'ui/app/config.js') diff --git a/ui/app/config.js b/ui/app/config.js index 620e54069..154e0aec5 100644 --- a/ui/app/config.js +++ b/ui/app/config.js @@ -101,8 +101,12 @@ ConfigScreen.prototype.render = function () { function currentConversionInformation (metamaskState, state) { var currentFiat = metamaskState.currentFiat + var conversionDate = metamaskState.conversionDate + console.log(conversionDate) + console.log("This is the current date") 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() -- cgit v1.2.3 From 6cee99f0baedf686071cb9c621dab70ad54688fc Mon Sep 17 00:00:00 2001 From: Kevin Serrano Date: Tue, 16 Aug 2016 14:08:14 -0700 Subject: Remove console logs. --- ui/app/config.js | 2 -- 1 file changed, 2 deletions(-) (limited to 'ui/app/config.js') diff --git a/ui/app/config.js b/ui/app/config.js index 154e0aec5..b043a47d6 100644 --- a/ui/app/config.js +++ b/ui/app/config.js @@ -102,8 +102,6 @@ ConfigScreen.prototype.render = function () { function currentConversionInformation (metamaskState, state) { var currentFiat = metamaskState.currentFiat var conversionDate = metamaskState.conversionDate - console.log(conversionDate) - console.log("This is the current date") return h('div', [ h('span', {style: { fontWeight: 'bold', paddingRight: '10px'}}, 'Current Conversion'), h('span', {style: { fontWeight: 'bold', paddingRight: '10px', fontSize: '13px'}}, `Updated ${Date(conversionDate)}`), -- cgit v1.2.3