1import React from 'react';
2import { Input, AccessoryIcon } from 'indigo-react';
3import { useField } from 'react-final-form';
12} from 'form/formatters';
13import { DEFAULT_HD_PATH } from 'lib/wallet';
14import InputSigil from 'components/InputSigil';
16const PLACEHOLDER_POINT = '~sampel-ponnym';
17const PLACEHOLDER_HD_PATH = DEFAULT_HD_PATH;
18const PLACEHOLDER_MNEMONIC =
19 'example crew supreme gesture quantum web media hazard theory mercy wing kitten';
20const PLACEHOLDER_TICKET = '~sampel-ticlyt-migfun-falmel';
21const PLACEHOLDER_PASSWORD = '••••••-••••••-••••••-••••••';
22const PLACEHOLDER_ADDRESS = '0x';
23const PLACEHOLDER_HEX = '0x';
24const PLACEHOLDER_PRIVATE_KEY =
25 'a44de2416ee6beb2f323fab48b432925c9785808d33a6ca6d7ba00b45e9370c3';
26const PLACEHOLDER_EMAIL = 'email@example.com';
28const formatPat = buildFormatter([downcase, ensurePatFormat]);
30export function TicketInput({ name, hidden, ...rest }) {
32 meta: { valid, error, validating, touched, active },
45 type={hidden ? 'password' : 'text'}
47 obscure={value => value.replace(/[^~-]+/g, '••••••')}
48 placeholder={hidden ? PLACEHOLDER_PASSWORD : PLACEHOLDER_TICKET}
52 touched && !active && error ? (
53 <AccessoryIcon.Failure />
55 <AccessoryIcon.Pending />
57 <AccessoryIcon.Success />
60 config={{ parse: formatPat }}
67export function MnemonicInput({ ...rest }) {
71 placeholder={PLACEHOLDER_MNEMONIC}
80export function HdPathInput({ ...rest }) {
84 placeholder={PLACEHOLDER_HD_PATH}
93export function PassphraseInput({ ...rest }) {
97 placeholder="Passphrase"
105export function PointInput({ name, size = 4, ...rest }) {
108 meta: { active, valid, error },
110 subscription: { value: true, active: true, valid: true, error: true },
118 placeholder={PLACEHOLDER_POINT}
119 autoCapitalize="none"
133 config={{ parse: formatPat }}
140export function HexInput({ ...rest }) {
144 placeholder={PLACEHOLDER_HEX}
145 autoCapitalize="none"
149 config={{ parse: ensureHexPrefix }}
155export function PrivateKeyInput({ ...rest }) {
159 placeholder={PLACEHOLDER_PRIVATE_KEY}
160 config={{ parse: stripHexPrefix }}
166export function AddressInput({ ...rest }) {
170 placeholder={PLACEHOLDER_ADDRESS}
171 autoCapitalize="none"
179export function NumberInput({ ...rest }) {
184 config={{ format: convertToNumber }}
190export function EmailInput({ ...rest }) {
194 placeholder={PLACEHOLDER_EMAIL}
195 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