1import React from 'react';
2import { Input, AccessoryIcon } from 'indigo-react';
3import { useField } from 'react-final-form';
11} from 'form/formatters';
12import { DEFAULT_HD_PATH } from 'lib/wallet';
13import InputSigil from 'components/InputSigil';
15const PLACEHOLDER_POINT = '~sampel-ponnym';
16const PLACEHOLDER_HD_PATH = DEFAULT_HD_PATH;
17const PLACEHOLDER_MNEMONIC =
18 'example crew supreme gesture quantum web media hazard theory mercy wing kitten';
19const PLACEHOLDER_TICKET = '~sampel-ticlyt-migfun-falmel';
20const PLACEHOLDER_ADDRESS = '0x12345abcdeDB11D175F123F6891AA64F01c24F7d';
21const PLACEHOLDER_PRIVATE_KEY =
22 '0x12345abcdee6beb2f323fab48b432925c9785808d33a6ca6d7ba00b45e9370c3';
23const PLACEHOLDER_EMAIL = 'Email Address';
25const TICKET_MAX_BYTE_LEN = 32; // tickets can be as large as 32 bytes
26const formatPat = buildFormatter([
29 ensurePatQDashes(TICKET_MAX_BYTE_LEN),
32export function TicketInput({ name, ...rest }) {
34 meta: { valid, error, validating, touched, active },
49 obscure={value => value.replace(/[^~-]+/g, '••••••')}
50 placeholder={PLACEHOLDER_TICKET}
54 touched && !active && error ? (
55 <AccessoryIcon.Failure />
57 <AccessoryIcon.Pending />
59 <AccessoryIcon.Success />
62 config={{ parse: formatPat }}
69export function MnemonicInput({ ...rest }) {
73 placeholder={PLACEHOLDER_MNEMONIC}
82export function HdPathInput({ ...rest }) {
86 placeholder={PLACEHOLDER_HD_PATH}
95export function PassphraseInput({ ...rest }) {
99 placeholder="Passphrase"
100 autoCapitalize="none"
107export function PointInput({ name, size = 4, ...rest }) {
110 meta: { active, valid, error },
112 subscription: { value: true, active: true, valid: true, error: true },
120 placeholder={PLACEHOLDER_POINT}
121 autoCapitalize="none"
135 config={{ parse: formatPat }}
142export function HexInput({ ...rest }) {
146 placeholder={PLACEHOLDER_PRIVATE_KEY}
147 autoCapitalize="none"
156export function AddressInput({ ...rest }) {
160 placeholder={PLACEHOLDER_ADDRESS}
161 autoCapitalize="none"
169export function NumberInput({ ...rest }) {
174 config={{ format: convertToNumber }}
180export function EmailInput({ ...rest }) {
184 placeholder={PLACEHOLDER_EMAIL}
185 autoCapitalize="none"
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