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_ADDRESS = '0x';
22const PLACEHOLDER_HEX = '0x';
23const PLACEHOLDER_PRIVATE_KEY =
24 'a44de2416ee6beb2f323fab48b432925c9785808d33a6ca6d7ba00b45e9370c3';
25const PLACEHOLDER_EMAIL = 'email@example.com';
27const formatPat = buildFormatter([downcase, ensurePatFormat]);
29export function TicketInput({ name, ...rest }) {
31 meta: { valid, error, validating, touched, active },
46 obscure={value => value.replace(/[^~-]+/g, '••••••')}
47 placeholder={PLACEHOLDER_TICKET}
51 touched && !active && error ? (
52 <AccessoryIcon.Failure />
54 <AccessoryIcon.Pending />
56 <AccessoryIcon.Success />
59 config={{ parse: formatPat }}
66export function MnemonicInput({ ...rest }) {
70 placeholder={PLACEHOLDER_MNEMONIC}
79export function HdPathInput({ ...rest }) {
83 placeholder={PLACEHOLDER_HD_PATH}
92export function PassphraseInput({ ...rest }) {
96 placeholder="Passphrase"
104export function PointInput({ name, size = 4, ...rest }) {
107 meta: { active, valid, error },
109 subscription: { value: true, active: true, valid: true, error: true },
117 placeholder={PLACEHOLDER_POINT}
118 autoCapitalize="none"
132 config={{ parse: formatPat }}
139export function HexInput({ ...rest }) {
143 placeholder={PLACEHOLDER_HEX}
144 autoCapitalize="none"
148 config={{ parse: ensureHexPrefix }}
154export function PrivateKeyInput({ ...rest }) {
158 placeholder={PLACEHOLDER_PRIVATE_KEY}
159 config={{ parse: stripHexPrefix }}
165export function AddressInput({ ...rest }) {
169 placeholder={PLACEHOLDER_ADDRESS}
170 autoCapitalize="none"
178export function NumberInput({ ...rest }) {
183 config={{ format: convertToNumber }}
189export function EmailInput({ ...rest }) {
193 placeholder={PLACEHOLDER_EMAIL}
194 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