1import React, { useCallback, useMemo } from 'react';
2import { Text, Grid, CheckboxInput } from 'indigo-react';
4import { useLocalRouter } from 'lib/LocalRouter';
5import { validateExactly } from 'lib/validators';
6import { isDevelopment } from 'lib/flags';
8import BridgeForm from 'form/BridgeForm';
9import { TicketInput } from 'form/Inputs';
10import { composeValidator, buildPatqValidator } from 'form/validators';
11import SubmitButton from 'form/SubmitButton';
12import FormError from 'form/FormError';
14const STUB_VERIFY_TICKET = isDevelopment;
16export default function ReticketVerify({ newWallet }) {
17 const { push, names } = useLocalRouter();
19 const ticket = newWallet.value.wallet.ticket;
20 const validate = useMemo(
23 ticket: buildPatqValidator([
24 validateExactly(ticket, 'Does not match expected master ticket.'),
30 const initialValues = useMemo(
32 ticket: STUB_VERIFY_TICKET ? ticket : undefined,
37 const goExecute = useCallback(() => push(names.EXECUTE), [push, names]);
40 <Grid className="mt4">
41 <Grid.Item full as={Text}>
42 Verify New Master Ticket
46 afterSubmit={goExecute}
47 initialValues={initialValues}>
48 {({ handleSubmit, values }) => (
54 type={values.showTicket ? 'text' : 'password'}
56 label="New master ticket"
59 <Grid.Item full as={CheckboxInput} name="showTicket" label="Show" />
61 <Grid.Item full as={FormError} />
63 <Grid.Item full as={SubmitButton} handleSubmit={handleSubmit}>
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list