on master help sign in
- Disabled ‘network seed’ input field if user logged in with a master ticket
commitc2a7ff599249e2bb081c9aee0ee8dae19f8bc376 authorChris Johnson <chris@cjohnson.io> dateWed 13 Mar 2019, 15:24 (8 years ago) parent632f406
4 files changed+9−3
src/components/ProtoInput.js+1 src/components/advancedInput.js+1−2 src/style/input.css+4 src/views/SetKeys.js+3−1
src/components/ProtoInput.js+1
@@ -18,6 +18,7 @@ const ProtoInput = props => {
1818 onFocus={e => props.onFocus(e)}
1919 onBlur={e => props.onBlur(e)}
2020 placeholder={props.placeholder}
21+ disabled={props.disabled}
2122 type={props.type}
2223 name={props.name}
2324 style={props.style}
src/components/advancedInput.js+1−2
@@ -118,6 +118,7 @@ const advancedInput = ({
118118 didPass={ report.pass }
119119 value={props.value}
120120 className={ props.className }
121+ disabled={ props.disabled }
121122 valClassname={valClassname}
122123 advanced={true} />
123124 )
@@ -148,6 +149,4 @@ const styleSelector = (pass, fail) => {
148149 return 'br-gray-50 f-br-blue outline-blue'
149150}
150151
151−
152−
153152export default advancedInput;
src/style/input.css+4
@@ -49,3 +49,7 @@ input[prop-format*='innerLabel'][prop-size='md'] {
4949 padding-left: 4rem;
5050 padding-right: 4rem;
5151}
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'
1010import { ROUTE_NAMES } from '../lib/router'
1111import { attemptSeedDerivation } from '../lib/keys'
1212
13+import { WALLET_NAMES } from '../lib/wallet'
14+
1315import * as kg from '../../node_modules/urbit-key-generation/dist/index'
1416
1517import {
@@ -280,7 +282,6 @@ class SetKeys extends React.Component {
280282 ? props.pointCache[state.point]
281283 : (() => { throw BRIDGE_ERROR.MISSING_POINT })()
282284
283−
284285 return (
285286 <Row>
286287 <Col>
@@ -317,6 +318,7 @@ class SetKeys extends React.Component {
317318 prop-size='lg'
318319 prop-format='innerLabel'
319320 autoFocus
321+ disabled= { props.walletType === WALLET_NAMES.TICKET || props.walletType === WALLET_NAMES.SHARD}
320322 value={ state.networkSeed }
321323 onChange={ this.handleNetworkSeedInput }>
322324 <InnerLabel>{ 'Network seed' }</InnerLabel>