on master help sign in
- Disabled ‘network seed’ input field if user logged in with a master ticket
c2a7ff5Chris Johnson
src/components/ProtoInput.js+1
@@ -18,6 +18,7 @@ const ProtoInput = props => {
18 onFocus={e => props.onFocus(e)}
18 onFocus={e => props.onFocus(e)}
19 onBlur={e => props.onBlur(e)}
19 onBlur={e => props.onBlur(e)}
20 placeholder={props.placeholder}
20 placeholder={props.placeholder}
21+ disabled={props.disabled}
21 type={props.type}
22 type={props.type}
22 name={props.name}
23 name={props.name}
23 style={props.style}
24 style={props.style}
src/components/advancedInput.js+1−2
@@ -118,6 +118,7 @@ const advancedInput = ({
118 didPass={ report.pass }
118 didPass={ report.pass }
119 value={props.value}
119 value={props.value}
120 className={ props.className }
120 className={ props.className }
121+ disabled={ props.disabled }
121 valClassname={valClassname}
122 valClassname={valClassname}
122 advanced={true} />
123 advanced={true} />
123 )
124 )
@@ -148,6 +149,4 @@ const styleSelector = (pass, fail) => {
148 return 'br-gray-50 f-br-blue outline-blue'
149 return 'br-gray-50 f-br-blue outline-blue'
149}
150}
150
151
151−
152−
153export default advancedInput;
152export default advancedInput;
src/style/input.css+4
@@ -49,3 +49,7 @@ input[prop-format*='innerLabel'][prop-size='md'] {
49 padding-left: 4rem;
49 padding-left: 4rem;
50 padding-right: 4rem;
50 padding-right: 4rem;
51}
51}
52+
53+input[disabled] {
54+ background-color: #d3d3d3;
55+}
src/views/SetKeys.js+3−1
@@ -10,6 +10,8 @@ import { BRIDGE_ERROR } from '../lib/error'
10import { ROUTE_NAMES } from '../lib/router'
10import { ROUTE_NAMES } from '../lib/router'
11import { attemptSeedDerivation } from '../lib/keys'
11import { attemptSeedDerivation } from '../lib/keys'
12
12
13+import { WALLET_NAMES } from '../lib/wallet'
14+
13import * as kg from '../../node_modules/urbit-key-generation/dist/index'
15import * as kg from '../../node_modules/urbit-key-generation/dist/index'
14
16
15import {
17import {
@@ -280,7 +282,6 @@ class SetKeys extends React.Component {
280 ? props.pointCache[state.point]
282 ? props.pointCache[state.point]
281 : (() => { throw BRIDGE_ERROR.MISSING_POINT })()
283 : (() => { throw BRIDGE_ERROR.MISSING_POINT })()
282
284
283−
284 return (
285 return (
285 <Row>
286 <Row>
286 <Col>
287 <Col>
@@ -317,6 +318,7 @@ class SetKeys extends React.Component {
317 prop-size='lg'
318 prop-size='lg'
318 prop-format='innerLabel'
319 prop-format='innerLabel'
319 autoFocus
320 autoFocus
321+ disabled= { props.walletType === WALLET_NAMES.TICKET || props.walletType === WALLET_NAMES.SHARD}
320 value={ state.networkSeed }
322 value={ state.networkSeed }
321 onChange={ this.handleNetworkSeedInput }>
323 onChange={ this.handleNetworkSeedInput }>
322 <InnerLabel>{ 'Network seed' }</InnerLabel>
324 <InnerLabel>{ 'Network seed' }</InnerLabel>