1import React from 'react';
2import { Input, AccessoryIcon } from 'indigo-react';
3import { useField } from 'react-final-form';
10} from 'form/formatters';
11import { DEFAULT_HD_PATH } from 'lib/wallet';
12import InputSigil from 'components/InputSigil';
14const PLACEHOLDER_POINT = '~sampel-ponnym';
15const PLACEHOLDER_HD_PATH = DEFAULT_HD_PATH;
16const PLACEHOLDER_MNEMONIC =
17 'example crew supreme gesture quantum web media hazard theory mercy wing kitten';
18const PLACEHOLDER_TICKET = '~sampel-ticlyt-migfun-falmel';
19const PLACEHOLDER_ADDRESS = '0x12345abcdeDB11D175F123F6891AA64F01c24F7d';
20const PLACEHOLDER_PRIVATE_KEY =
21 '0x12345abcdee6beb2f323fab48b432925c9785808d33a6ca6d7ba00b45e9370c3';
22const PLACEHOLDER_EMAIL = 'email@example.com';
24const formatPat = buildFormatter([downcase, ensurePatFormat]);
26export function TicketInput({ name, ...rest }) {
28 meta: { valid, error, validating, touched, active },
43 obscure={value => value.replace(/[^~-]+/g, '••••••')}
44 placeholder={PLACEHOLDER_TICKET}
48 touched && !active && error ? (
49 <AccessoryIcon.Failure />
51 <AccessoryIcon.Pending />
53 <AccessoryIcon.Success />
56 config={{ parse: formatPat }}
63export function MnemonicInput({ ...rest }) {
67 placeholder={PLACEHOLDER_MNEMONIC}
76export function HdPathInput({ ...rest }) {
80 placeholder={PLACEHOLDER_HD_PATH}
89export function PassphraseInput({ ...rest }) {
93 placeholder="Passphrase"
101export function PointInput({ name, size = 4, ...rest }) {
104 meta: { active, valid, error },
106 subscription: { value: true, active: true, valid: true, error: true },
114 placeholder={PLACEHOLDER_POINT}
115 autoCapitalize="none"
129 config={{ parse: formatPat }}
136export function HexInput({ ...rest }) {
140 placeholder={PLACEHOLDER_PRIVATE_KEY}
141 autoCapitalize="none"
150export function AddressInput({ ...rest }) {
154 placeholder={PLACEHOLDER_ADDRESS}
155 autoCapitalize="none"
163export function NumberInput({ ...rest }) {
168 config={{ format: convertToNumber }}
174export function EmailInput({ ...rest }) {
178 placeholder={PLACEHOLDER_EMAIL}
179 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