Skip to content

Commit fa71d3b

Browse files
Yakov Karavelovnikolaglumac
andauthored
[DDW-548] Update recovery phrase input placeholder (#2334)
* [DDW-548]: Update receovery phrase input placeholder * [DDW-548]: Update changelog * [DDW-548]: Update receovery phrase input placeholder * [DDW-548]: Update recovery phrase input placeholder on verification dialog Co-authored-by: Nikola Glumac <niglumac@gmail.com>
1 parent 49e17d1 commit fa71d3b

File tree

8 files changed

+138
-90
lines changed

8 files changed

+138
-90
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ Changelog
1313

1414
### Chores
1515

16-
- Adjusted sorting on rewards ([PR 2333](https://github.com/input-output-hk/daedalus/pull/2333))
16+
- Updated recovery phrase entry ([PR 2334](https://github.com/input-output-hk/daedalus/pull/2334))
17+
- Adjusted sorting of table values on the "Rewards" screen ([PR 2333](https://github.com/input-output-hk/daedalus/pull/2333))
1718
- Fixed error thrown when closing delegation wizard while transaction fees are being calculated ([PR 2330](https://github.com/input-output-hk/daedalus/pull/2330))
1819
- Fixed number format for syncing percentage and stake pools count ([PR 2313](https://github.com/input-output-hk/daedalus/pull/2313))
1920
- Updated `cardano-wallet` to version `2021-01-28` and `cardano-node` to version `1.25.1` ([PR 2270](https://github.com/input-output-hk/daedalus/pull/2270))

source/renderer/app/components/wallet/WalletRestoreDialog.js

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ import {
3434
} from '../../config/walletsConfig';
3535
import {
3636
LEGACY_WALLET_RECOVERY_PHRASE_WORD_COUNT,
37-
PAPER_WALLET_RECOVERY_PHRASE_WORD_COUNT,
3837
WALLET_RECOVERY_PHRASE_WORD_COUNT,
3938
YOROI_WALLET_RECOVERY_PHRASE_WORD_COUNT,
4039
} from '../../config/cryptoConfig';
@@ -176,6 +175,12 @@ const messages = defineMessages({
176175
description:
177176
'Hint "Enter your 27-word paper wallet recovery phrase." for the recovery phrase input on the wallet restore dialog.',
178177
},
178+
shieldedRecoveryPhraseInputPlaceholder: {
179+
id: 'wallet.restore.dialog.shielded.recovery.phrase.input.placeholder',
180+
defaultMessage: '!!!Enter word #{wordNumber}',
181+
description:
182+
'Placeholder "Enter word #" for the recovery phrase input on the wallet restore dialog.',
183+
},
179184
restorePaperWalletButtonLabel: {
180185
id: 'wallet.restore.dialog.paper.wallet.button.label',
181186
defaultMessage: '!!!Restore paper wallet',
@@ -387,9 +392,7 @@ export default class WalletRestoreDialog extends Component<Props, State> {
387392
const label = this.isCertificate()
388393
? this.context.intl.formatMessage(messages.restorePaperWalletButtonLabel)
389394
: this.context.intl.formatMessage(messages.importButtonLabel);
390-
391395
const buttonLabel = !isSubmitting ? label : <LoadingSpinner />;
392-
393396
const actions = [
394397
{
395398
label: buttonLabel,
@@ -576,9 +579,12 @@ export default class WalletRestoreDialog extends Component<Props, State> {
576579
placeholder={
577580
!this.isCertificate()
578581
? intl.formatMessage(messages.recoveryPhraseInputHint)
579-
: intl.formatMessage(messages.shieldedRecoveryPhraseInputHint, {
580-
numberOfWords: PAPER_WALLET_RECOVERY_PHRASE_WORD_COUNT,
581-
})
582+
: intl.formatMessage(
583+
messages.shieldedRecoveryPhraseInputPlaceholder,
584+
{
585+
wordNumber: recoveryPhraseField.value.length + 1,
586+
}
587+
)
582588
}
583589
options={suggestedMnemonics}
584590
requiredSelections={[RECOVERY_PHRASE_WORD_COUNT_OPTIONS[walletType]]}

source/renderer/app/components/wallet/backup-recovery/WalletRecoveryPhraseEntryDialog.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,12 @@ const messages = defineMessages({
4242
recoveryPhraseInputHint: {
4343
id: 'wallet.backup.recovery.phrase.entry.dialog.recoveryPhraseInputHint',
4444
defaultMessage: '!!!Enter your {numberOfWords}-word recovery phrase',
45+
description: 'Placeholder hint for the mnemonics autocomplete.',
46+
},
47+
recoveryPhraseInputPlaceholder: {
48+
id:
49+
'wallet.backup.recovery.phrase.entry.dialog.recoveryPhraseInputPlaceholder',
50+
defaultMessage: '!!!Enter word #{wordNumber}',
4551
description: 'Placeholder for the mnemonics autocomplete.',
4652
},
4753
recoveryPhraseNoResults: {
@@ -169,7 +175,6 @@ export default class WalletRecoveryPhraseEntryDialog extends Component<Props> {
169175
]);
170176
const wordCount = WALLET_RECOVERY_PHRASE_WORD_COUNT;
171177
const enteredPhraseString = enteredPhrase.join(' ');
172-
173178
const buttonLabel = !isSubmitting ? (
174179
intl.formatMessage(messages.buttonLabelConfirm)
175180
) : (
@@ -212,9 +217,9 @@ export default class WalletRecoveryPhraseEntryDialog extends Component<Props> {
212217
{...recoveryPhraseField.bind()}
213218
label={intl.formatMessage(messages.recoveryPhraseInputLabel)}
214219
placeholder={intl.formatMessage(
215-
messages.recoveryPhraseInputHint,
220+
messages.recoveryPhraseInputPlaceholder,
216221
{
217-
numberOfWords: wordCount,
222+
wordNumber: enteredPhrase.length + 1,
218223
}
219224
)}
220225
options={suggestedMnemonics}

source/renderer/app/components/wallet/settings/WalletRecoveryPhraseStep2Dialog.js

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,11 @@ export const messages = defineMessages({
4141
defaultMessage: '!!!Verify',
4242
description: 'Label for the recoveryPhraseStep2Button on wallet settings.',
4343
},
44-
recoveryPhraseInputHint: {
45-
id: 'wallet.settings.recoveryPhraseInputHint',
46-
defaultMessage: '!!!Enter recovery phrase',
44+
recoveryPhraseInputPlaceholder: {
45+
id: 'wallet.settings.recoveryPhraseInputPlaceholder',
46+
defaultMessage: '!!!Enter word #{wordNumber}',
4747
description:
48-
'Hint "Enter recovery phrase" for the recovery phrase input on the wallet restore dialog.',
48+
'Placeholder "Enter word #{wordNumber}" for the recovery phrase input on the verification dialog.',
4949
},
5050
recoveryPhraseNoResults: {
5151
id: 'wallet.settings.recoveryPhraseInputNoResults',
@@ -155,11 +155,15 @@ export default class WalletRecoveryPhraseStep2Dialog extends Component<
155155
<div className={styles.subtitle}>
156156
<p>{intl.formatMessage(messages.recoveryPhraseStep2Description)}</p>
157157
</div>
158-
159158
<Autocomplete
160159
{...recoveryPhraseField.bind()}
161160
label={intl.formatMessage(messages.recoveryPhraseStep2Subtitle)}
162-
placeholder={intl.formatMessage(messages.recoveryPhraseInputHint)}
161+
placeholder={intl.formatMessage(
162+
messages.recoveryPhraseInputPlaceholder,
163+
{
164+
wordNumber: enteredWordCount + 1,
165+
}
166+
)}
163167
options={suggestedMnemonics}
164168
requiredSelections={
165169
Array.isArray(expectedWordCount)

source/renderer/app/components/wallet/wallet-restore/MnemonicsDialog.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import type {
2323
const messages = defineMessages({
2424
autocompletePlaceholder: {
2525
id: 'wallet.restore.dialog.step.mnemonics.autocomplete.placeholder',
26-
defaultMessage: '!!!Enter your {numberOfWords}-word recovery phrase',
26+
defaultMessage: '!!!Enter word #{wordNumber}',
2727
description: 'Placeholder for the mnemonics autocomplete.',
2828
},
2929
autocompleteMultiLengthPhrase: {
@@ -138,7 +138,7 @@ export default class MnemonicsDialog extends Component<Props> {
138138
Array.isArray(expectedWordCount)
139139
? intl.formatMessage(messages.autocompleteMultiLengthPhrase)
140140
: intl.formatMessage(messages.autocompletePlaceholder, {
141-
numberOfWords: expectedWordCount,
141+
wordNumber: mnemonics.length + 1,
142142
})
143143
}
144144
options={validWords}

0 commit comments

Comments
 (0)