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 = '0x';
20const PLACEHOLDER_PRIVATE_KEY = '0x';
21const PLACEHOLDER_EMAIL = 'email@example.com';
23const formatPat = buildFormatter([downcase, ensurePatFormat]);
25export function TicketInput({ name, ...rest }) {
27 meta: { valid, error, validating, touched, active },
42 obscure={value => value.replace(/[^~-]+/g, '••••••')}
43 placeholder={PLACEHOLDER_TICKET}
47 touched && !active && error ? (
48 <AccessoryIcon.Failure />
50 <AccessoryIcon.Pending />
52 <AccessoryIcon.Success />
55 config={{ parse: formatPat }}
62export function MnemonicInput({ ...rest }) {
66 placeholder={PLACEHOLDER_MNEMONIC}
75export function HdPathInput({ ...rest }) {
79 placeholder={PLACEHOLDER_HD_PATH}
88export function PassphraseInput({ ...rest }) {
92 placeholder="Passphrase"
100export function PointInput({ name, size = 4, ...rest }) {
103 meta: { active, valid, error },
105 subscription: { value: true, active: true, valid: true, error: true },
113 placeholder={PLACEHOLDER_POINT}
114 autoCapitalize="none"
128 config={{ parse: formatPat }}
135export function HexInput({ ...rest }) {
139 placeholder={PLACEHOLDER_PRIVATE_KEY}
140 autoCapitalize="none"
149export function AddressInput({ ...rest }) {
153 placeholder={PLACEHOLDER_ADDRESS}
154 autoCapitalize="none"
162export function NumberInput({ ...rest }) {
167 config={{ format: convertToNumber }}
173export function EmailInput({ ...rest }) {
177 placeholder={PLACEHOLDER_EMAIL}
178 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