@@ -1,7 +1,6 @@
1import React, { useCallback, useMemo } from 'react';
1import React, { useCallback, useMemo } from 'react';
2import { AccessoryIcon, useForm } from 'indigo-react';
2import { AccessoryIcon, useForm } from 'indigo-react';
3import { identity } from 'lodash';
3import { identity } from 'lodash';
4−import * as bip39 from 'bip39';
6import { DEFAULT_HD_PATH } from 'lib/wallet';
5import { DEFAULT_HD_PATH } from 'lib/wallet';
@@ -22,8 +21,14 @@ import { prependSig, convertToNumber } from 'lib/transformers';
23import InputSigil from 'components/InputSigil';
22import InputSigil from 'components/InputSigil';
25−const EXAMPLE_PRIVATE_KEY =
24+const PLACEHOLDER_POINT = '~sampel-ponnym';
26− '0xa44de2416ee6beb2f323fab48b432925c9785808d33a6ca6d7ba00b45e9370c3';
25+const PLACEHOLDER_HD_PATH = DEFAULT_HD_PATH;
26+const PLACEHOLDER_MNEMONIC =
27+ 'example crew supreme gesture quantum web media hazard theory mercy wing kitten';
28+const PLACEHOLDER_TICKET = '~sampel-ticlyt-migfun-falmel';
29+const PLACEHOLDER_ADDRESS = '0x12345abcdeDB11D175F123F6891AA64F01c24F7d';
30+const PLACEHOLDER_PRIVATE_KEY =
31+ '0x12345abcdee6beb2f323fab48b432925c9785808d33a6ca6d7ba00b45e9370c3';
28// pulls out the first input from a useForm() call
33// pulls out the first input from a useForm() call
29function useFirstOf({ inputs, setValue, ...rest }, mapper = identity) {
34function useFirstOf({ inputs, setValue, ...rest }, mapper = identity) {
@@ -71,7 +76,7 @@ export function useHexInput({ length, ...rest }) {
72 type: 'text', // or password
77 type: 'text', // or password
73 autoComplete: 'off',
78 autoComplete: 'off',
74− placeholder: `e.g. ${EXAMPLE_PRIVATE_KEY}`,
79+ placeholder: PLACEHOLDER_PRIVATE_KEY,
75 validators: useMemo(
80 validators: useMemo(
77 validateHexString,
82 validateHexString,
@@ -86,15 +91,14 @@ export function useHexInput({ length, ...rest }) {
89−const kExampleMnemonic = bip39.generateMnemonic();
90const kMnemonicValidators = [validateMnemonic, validateNotEmpty];
94const kMnemonicValidators = [validateMnemonic, validateNotEmpty];
91export function useMnemonicInput(props) {
95export function useMnemonicInput(props) {
92 return useFirstOf(
96 return useFirstOf(
95− type: 'text',
99+ type: 'textarea',
96 autoComplete: 'off',
100 autoComplete: 'off',
97− placeholder: `e.g. ${kExampleMnemonic}`,
101+ placeholder: PLACEHOLDER_MNEMONIC,
98 validators: kMnemonicValidators,
102 validators: kMnemonicValidators,
99 ...props,
103 ...props,
@@ -108,7 +112,7 @@ export function useHdPathInput(props) {
109 type: 'text',
113 type: 'text',
110 autoComplete: 'off',
114 autoComplete: 'off',
111− placeholder: `e.g. ${DEFAULT_HD_PATH}`,
115+ placeholder: PLACEHOLDER_HD_PATH,
112 ...props,
116 ...props,
@@ -124,7 +128,7 @@ export function useTicketInput({ validators = [], deriving = false, ...rest }) {
125 type: 'password',
129 type: 'password',
126 label: 'Ticket',
130 label: 'Ticket',
127− placeholder: 'e.g. ~ragtyd-modwen-bostec-hinsep',
131+ placeholder: PLACEHOLDER_TICKET,
128 validators: useMemo(() => [...validators, ...kTicketValidators], [
132 validators: useMemo(() => [...validators, ...kTicketValidators], [
129 validators,
133 validators,
@@ -162,7 +166,7 @@ export function usePointInput({ size = 4, validators = [], ...rest }) {
163 type: 'text',
167 type: 'text',
164 label: 'Point',
168 label: 'Point',
165− placeholder: 'e.g. ~zod',
169+ placeholder: PLACEHOLDER_POINT,
166 validators: _validators,
170 validators: _validators,
167 transformers: kPointTransformers,
171 transformers: kPointTransformers,
168 mono: true,
172 mono: true,
@@ -236,7 +240,7 @@ export function useAddressInput({ ...rest }) {
237 type: 'string',
241 type: 'string',
238 label: 'Ethereum Address',
242 label: 'Ethereum Address',
239− placeholder: 'e.g. 0x6DEfFb0caFDB11D175F123F6891AA64F01c24F7d',
243+ placeholder: PLACEHOLDER_ADDRESS,
240 autoComplete: 'off',
244 autoComplete: 'off',
241 validators: kAddressValidators,
245 validators: kAddressValidators,
242 mono: true,
246 mono: true,