Skip to content

Commit

Permalink
ui: fix to make selected customRpc editable. fixed save btn style
Browse files Browse the repository at this point in the history
  • Loading branch information
hackmod committed Aug 24, 2018
1 parent 2d8f059 commit 420ca66
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
12 changes: 11 additions & 1 deletion ui/app/components/pages/settings/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -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', [
Expand All @@ -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 => {
Expand All @@ -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 => {
Expand All @@ -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)
Expand Down
3 changes: 1 addition & 2 deletions ui/app/css/itcss/components/settings.scss
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,8 @@

.settings__rpc-save-button {
align-self: flex-end;
padding: 5px;
text-transform: uppercase;
color: $dusty-gray;
width: 30%;
cursor: pointer;
}

Expand Down

0 comments on commit 420ca66

Please sign in to comment.