From 420ca661916c4a037c5916989da634e91b83f772 Mon Sep 17 00:00:00 2001 From: hackyminer Date: Tue, 21 Aug 2018 20:44:08 +0900 Subject: [PATCH] ui: fix to make selected customRpc editable. fixed save btn style --- ui/app/components/pages/settings/settings.js | 12 +++++++++++- ui/app/css/itcss/components/settings.scss | 3 +-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/ui/app/components/pages/settings/settings.js b/ui/app/components/pages/settings/settings.js index 38d8729ac938..16bddf3d2518 100644 --- a/ui/app/components/pages/settings/settings.js +++ b/ui/app/components/pages/settings/settings.js @@ -161,6 +161,14 @@ class Settings extends Component { } renderNewRpcUrl () { + const { metamask: { provider = {} } } = this.props + let rpcTarget = '' + let chainId = '' + if (provider.type === 'rpc') { + rpcTarget = provider.rpcTarget + chainId = provider.chainId || '' + } + return ( h('div.settings__content-row', [ h('div.settings__content-item', [ @@ -169,6 +177,7 @@ class Settings extends Component { h('div.settings__content-item', [ h('div.settings__content-item-col', [ h('input.settings__input', { + defaultValue: rpcTarget, placeholder: this.context.t('newRPC'), onChange: event => this.setState({ newRpc: event.target.value }), onKeyPress: event => { @@ -178,6 +187,7 @@ class Settings extends Component { }, }), h('input.settings__input', { + defaultValue: chainId, placeholder: this.context.t('optionalChainId'), onChange: event => this.setState({ chainId: event.target.value }), onKeyPress: event => { @@ -186,7 +196,7 @@ class Settings extends Component { } }, }), - h('div.settings__rpc-save-button', { + h('button.btn-primary.settings__rpc-save-button', { onClick: event => { event.preventDefault() this.validateRpc(this.state.newRpc, this.state.chainId) diff --git a/ui/app/css/itcss/components/settings.scss b/ui/app/css/itcss/components/settings.scss index 7a94c1cb648a..a82520120bf5 100644 --- a/ui/app/css/itcss/components/settings.scss +++ b/ui/app/css/itcss/components/settings.scss @@ -125,9 +125,8 @@ .settings__rpc-save-button { align-self: flex-end; - padding: 5px; text-transform: uppercase; - color: $dusty-gray; + width: 30%; cursor: pointer; }