• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

input-output-hk / lace / 8521699122

02 Apr 2024 11:02AM UTC coverage: 53.437% (-0.4%) from 53.839%
8521699122

push

github

f055f2
pczeglik-iohk
chore: cardano services point out live envs

2293 of 5275 branches covered (43.47%)

Branch coverage included in aggregate %.

5239 of 8820 relevant lines covered (59.4%)

54.34 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

38.89
/packages/core/src/ui/components/WalletSetup/WalletSetupRecoveryPhraseLengthStep.tsx
1
import React from 'react';
2✔
2
import { WalletSetupStepLayout, WalletTimelineSteps } from '@ui/components/WalletSetup/WalletSetupStepLayout';
2✔
3
import { RadioChangeEvent } from 'antd';
4
import { Radio, RadioGroup } from '@lace/common';
2✔
5
import styles from './WalletSetupRecoveryPhraseLengthStep.module.scss';
2✔
6
import { TranslationsFor } from '@ui/utils/types';
7

8
export interface WalletSetupRecoveryPhraseLengthStepProps {
9
  onBack: () => void;
10
  onNext: (params: { recoveryPhraseLength: number }) => void;
11
  translations: TranslationsFor<'title' | 'description' | 'wordPassphrase'>;
12
  onChange?: (state: number) => void;
13
}
14

15
// eslint-disable-next-line no-magic-numbers
16
const RECOVERY_PHRASE_LENGTHS = [12, 15, 24];
2✔
17
const DEFAULT_RECOVERY_PHRASE_LENGTH = 24;
2✔
18

19
export const WalletSetupRecoveryPhraseLengthStep = ({
2✔
20
  onBack,
21
  onNext,
22
  translations,
23
  onChange
24
}: WalletSetupRecoveryPhraseLengthStepProps): React.ReactElement => {
25
  const [value, setValue] = React.useState(DEFAULT_RECOVERY_PHRASE_LENGTH);
×
26

27
  const onRadioChange = (e: RadioChangeEvent) => {
×
28
    setValue(e.target.value);
×
29
    onChange?.(e.target.value);
×
30
  };
31

32
  return (
×
33
    <WalletSetupStepLayout
34
      title={translations.title}
35
      description={translations.description}
36
      onNext={() => onNext({ recoveryPhraseLength: value })}
×
37
      onBack={onBack}
38
      currentTimelineStep={WalletTimelineSteps.RECOVERY_PHRASE}
39
    >
40
      <RadioGroup onChange={onRadioChange} value={value} className={styles.radioGroup}>
41
        {RECOVERY_PHRASE_LENGTHS.map((length) => (
42
          <Radio value={length} key={length} data-testid={`${length}-word-passphrase-radio-button`}>
×
43
            {`${length}-${translations.wordPassphrase}`}
44
          </Radio>
45
        ))}
46
      </RadioGroup>
47
    </WalletSetupStepLayout>
48
  );
49
};
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc