1import React from 'react';
2import { Input, AccessoryIcon } from 'indigo-react';
3import { useField } from 'react-final-form';
5import { prependSig, convertToNumber } from 'lib/transformers';
6import { DEFAULT_HD_PATH } from 'lib/wallet';
7import InputSigil from 'components/InputSigil';
9const PLACEHOLDER_POINT = '~sampel-ponnym';
10const PLACEHOLDER_HD_PATH = DEFAULT_HD_PATH;
11const PLACEHOLDER_MNEMONIC =
12 'example crew supreme gesture quantum web media hazard theory mercy wing kitten';
13const PLACEHOLDER_TICKET = '~sampel-ticlyt-migfun-falmel';
14const PLACEHOLDER_ADDRESS = '0x12345abcdeDB11D175F123F6891AA64F01c24F7d';
15const PLACEHOLDER_PRIVATE_KEY =
16 '0x12345abcdee6beb2f323fab48b432925c9785808d33a6ca6d7ba00b45e9370c3';
17const PLACEHOLDER_EMAIL = 'Email Address';
19export function TicketInput({ name, ...rest }) {
21 meta: { valid, error, validating, touched, active },
36 placeholder={PLACEHOLDER_TICKET}
38 touched && !active && error ? (
39 <AccessoryIcon.Failure />
41 <AccessoryIcon.Pending />
43 <AccessoryIcon.Success />
46 config={{ format: prependSig }}
53export function MnemonicInput({ ...rest }) {
55 <Input type="textarea" placeholder={PLACEHOLDER_MNEMONIC} mono {...rest} />
59export function HdPathInput({ ...rest }) {
63 placeholder={PLACEHOLDER_HD_PATH}
70export function PassphraseInput({ ...rest }) {
74 placeholder="Passphrase"
81export function PointInput({ name, size = 4, ...rest }) {
84 meta: { active, valid, error },
86 subscription: { value: true, active: true, valid: true, error: true },
94 placeholder={PLACEHOLDER_POINT}
107 config={{ format: prependSig }}
114export function HexInput({ ...rest }) {
118 placeholder={PLACEHOLDER_PRIVATE_KEY}
126export function AddressInput({ ...rest }) {
130 placeholder={PLACEHOLDER_ADDRESS}
138export function NumberInput({ ...rest }) {
144 config={{ format: convertToNumber }}
150export function EmailInput({ ...rest }) {
154 placeholder={PLACEHOLDER_EMAIL}
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