on master help sign in
fix: remove e.g. from placeholders
3e184c3Matt Condon (shrugs)
src/lib/useInputs.js+12−8
@@ -22,7 +22,12 @@ import { prependSig, convertToNumber } from 'lib/transformers';
22
22
23import InputSigil from 'components/InputSigil';
23import InputSigil from 'components/InputSigil';
24
24
25−const EXAMPLE_PRIVATE_KEY =
25+const PLACEHOLDER_POINT = '~zod';
26+const PLACEHOLDER_HD_PATH = DEFAULT_HD_PATH;
27+const PLACEHOLDER_MNEMONIC = bip39.generateMnemonic();
28+const PLACEHOLDER_TICKET = '~ragtyd-modwen-bostec-hinsep';
29+const PLACEHOLDER_ADDRESS = '0x6DEfFb0caFDB11D175F123F6891AA64F01c24F7d';
30+const PLACEHOLDER_PRIVATE_KEY =
26 '0xa44de2416ee6beb2f323fab48b432925c9785808d33a6ca6d7ba00b45e9370c3';
31 '0xa44de2416ee6beb2f323fab48b432925c9785808d33a6ca6d7ba00b45e9370c3';
27
32
28// pulls out the first input from a useForm() call
33// pulls out the first input from a useForm() call
@@ -71,7 +76,7 @@ export function useHexInput({ length, ...rest }) {
71 {
76 {
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(
76 () => [
81 () => [
77 validateHexString,
82 validateHexString,
@@ -86,7 +91,6 @@ export function useHexInput({ length, ...rest }) {
86 );
91 );
87}
92}
88
93
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(
@@ -94,7 +98,7 @@ export function useMnemonicInput(props) {
94 {
98 {
95 type: 'text',
99 type: 'text',
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,
100 },
104 },
@@ -108,7 +112,7 @@ export function useHdPathInput(props) {
108 {
112 {
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,
113 },
117 },
114 ])
118 ])
@@ -124,7 +128,7 @@ export function useTicketInput({ validators = [], deriving = false, ...rest }) {
124 {
128 {
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,
130 ]),
134 ]),
@@ -162,7 +166,7 @@ export function usePointInput({ size = 4, validators = [], ...rest }) {
162 {
166 {
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 }) {
236 {
240 {
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,