aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/config.js
diff options
context:
space:
mode:
authorDan Finlay <dan@danfinlay.com>2016-04-23 05:39:12 +0800
committerDan Finlay <dan@danfinlay.com>2016-04-23 05:39:12 +0800
commit820736b427fba833c920a73334fde4ba30a7fb2a (patch)
tree00210e4b16543438ef43b2d6acf1f58aab8e7b10 /ui/app/config.js
parentdb85827b2be19d7bfc7dfaeec4786c4d051b6629 (diff)
downloadtangerine-wallet-browser-820736b427fba833c920a73334fde4ba30a7fb2a.tar
tangerine-wallet-browser-820736b427fba833c920a73334fde4ba30a7fb2a.tar.gz
tangerine-wallet-browser-820736b427fba833c920a73334fde4ba30a7fb2a.tar.bz2
tangerine-wallet-browser-820736b427fba833c920a73334fde4ba30a7fb2a.tar.lz
tangerine-wallet-browser-820736b427fba833c920a73334fde4ba30a7fb2a.tar.xz
tangerine-wallet-browser-820736b427fba833c920a73334fde4ba30a7fb2a.tar.zst
tangerine-wallet-browser-820736b427fba833c920a73334fde4ba30a7fb2a.zip
Add RPC config buttons and styles
- Add save button for custom RPC input field - Add button for RPC at `localhost:8545`. - Improve `Current RPC` display.
Diffstat (limited to 'ui/app/config.js')
-rw-r--r--ui/app/config.js36
1 files changed, 31 insertions, 5 deletions
diff --git a/ui/app/config.js b/ui/app/config.js
index 878c9955f..f4eecf7f8 100644
--- a/ui/app/config.js
+++ b/ui/app/config.js
@@ -47,11 +47,14 @@ ConfigScreen.prototype.render = function() {
currentProviderDisplay(metamaskState),
- h('div', [
- h('input', {
+ h('div', { style: {display: 'flex'} }, [
+ h('input#new_rpc', {
placeholder: 'New RPC URL',
style: {
- width: '100%',
+ width: 'inherit',
+ flex: '1 0 auto',
+ height: '30px',
+ margin: '8px',
},
onKeyPress(event) {
if (event.key === 'Enter') {
@@ -61,6 +64,17 @@ ConfigScreen.prototype.render = function() {
}
}
}),
+ h('button', {
+ style: {
+ alignSelf: 'center',
+ },
+ onClick(event) {
+ event.preventDefault()
+ var element = document.querySelector('input#new_rpc')
+ var newRpc = element.value
+ state.dispatch(actions.setRpcTarget(newRpc))
+ }
+ }, 'Save')
]),
h('div', [
@@ -87,6 +101,18 @@ ConfigScreen.prototype.render = function() {
}, 'Use Morden Test Network')
]),
+ h('div', [
+ h('button', {
+ style: {
+ alignSelf: 'center',
+ },
+ onClick(event) {
+ event.preventDefault()
+ state.dispatch(actions.setRpcTarget('http://localhost:8545/'))
+ }
+ }, 'Use http://localhost:8545')
+ ]),
+
]),
]),
])
@@ -96,7 +122,7 @@ ConfigScreen.prototype.render = function() {
function currentProviderDisplay(metamaskState) {
var rpc = metamaskState.provider.rpcTarget
return h('div', [
- h('h3', {style: { fontWeight: 'bold' }}, 'Currently using RPC'),
- h('p', rpc)
+ h('span', {style: { fontWeight: 'bold', paddingRight: '10px'}}, 'Current RPC'),
+ h('span', rpc)
])
}