on master help sign in
ActivateCode: hide ticket input if it's implied

Hides the ticket and changes the copy if there's an implied point from the URL, in order to minimise user cognitive load. We don't skip this page entirely because we have to make network and crypto calls and doing this upon pageload would ruin time to interactive. Fixes #443

commit3962f38b500e8d10a4e6e446fb9acbba6a473889 authorLiam Fitzgerald <liam@urizen.co> dateTue 7 Apr 2020, 07:48 (7 years ago) parent5927c5e
1 file changed+20−16
src/views/Activate/ActivateCode.js+20−16
src/views/Activate/ActivateCode.js+20−16
@@ -157,7 +157,7 @@ export default function ActivateCode() {
157157 </Grid.Item>
158158 <Grid.Item full as={P} className="mb2">
159159 Someone has invited you to claim your Urbit identity and join the
160− network. Enter your activation code to continue.
160+ network. {!impliedTicket && 'Enter your activation code to continue.'}
161161 </Grid.Item>
162162 <BridgeForm
163163 validate={validate}
@@ -166,21 +166,25 @@ export default function ActivateCode() {
166166 initialValues={initialValues}>
167167 {({ validating, values, submitting, handleSubmit }) => (
168168 <>
169− <Grid.Item
170− full
171− as={TicketInput}
172− type={values.showTicket ? 'text' : 'password'}
173− name="ticket"
174− label="Activation Code"
175− disabled={!activationAllowed}
176− />
177−
178− <Grid.Item
179− full
180− as={CheckboxInput}
181− name="showTicket"
182− label="Show"
183− />
169+ {!impliedTicket && (
170+ <>
171+ <Grid.Item
172+ full
173+ as={TicketInput}
174+ type={values.showTicket ? 'text' : 'password'}
175+ name="ticket"
176+ label="Activation Code"
177+ disabled={!activationAllowed}
178+ />
179+
180+ <Grid.Item
181+ full
182+ as={CheckboxInput}
183+ name="showTicket"
184+ label="Show"
185+ />
186+ </>
187+ )}
184188
185189 <Grid.Item full as={FormError} />
186190