on fbcd6b6 help sign in
40 lines 993 B history raw
1import React from 'react';
2import { Input, AccessoryIcon } from 'indigo-react';
4import View from 'components/View';
5import { useTicketInput } from 'components/Inputs';
6import { ForwardButton } from 'components/Buttons';
8import { useLocalRouter } from 'lib/LocalRouter';
10export default function Verify({ STEP_NAMES, newWallet }) {
11 const { push } = useLocalRouter();
13 const ticketInput = useTicketInput({
14 name: 'ticket',
15 label: 'New master ticket',
16 });
17 const ticket = ticketInput.data;
19 const next = () => {
20 push(STEP_NAMES.RETICKET);
21 };
23 const matches = newWallet.value.wallet.ticket === ticket;
25 const displayTicketStatus = matches ? (
26 <AccessoryIcon.Success />
27 ) : (
28 <AccessoryIcon.Failure />
29 );
31 return (
32 <View>
33 Prove that you downloaded the new secrets!
34 <Input {...ticketInput} accessory={displayTicketStatus} />
35 <ForwardButton disabled={!matches} onClick={next}>
36 Reticket
37 </ForwardButton>
38 </View>
39 );