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

input-output-hk / lace / 8325082528

18 Mar 2024 10:32AM UTC coverage: 53.421% (-0.4%) from 53.839%
8325082528

push

github

79df06
pczeglik-iohk
chore(extension): update lace version v1.9.0 (#960)

2291 of 5273 branches covered (43.45%)

Branch coverage included in aggregate %.

5228 of 8802 relevant lines covered (59.4%)

54.4 hits per line

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

42.86
/packages/core/src/ui/components/WalletSetup/WalletSetupSelectAccountsStep.tsx
1
import React, { useState } from 'react';
2✔
2
import { WalletSetupStepLayout, WalletTimelineSteps } from './WalletSetupStepLayout';
2✔
3
import styles from './WalletSetupSelectAccountsStep.module.scss';
2✔
4
import { Radio } from 'antd';
2✔
5
import { useTranslate } from '@src/ui//hooks';
2✔
6

7
export interface WalletSetupSelectAccountsStepProps {
8
  accounts: number;
9
  onBack: () => void;
10
  onSubmit: (accountIndex: number) => void;
11
  isHardwareWallet?: boolean;
12
  wallet?: string;
13
}
14

15
export const WalletSetupSelectAccountsStep = ({
2✔
16
  accounts,
17
  onBack,
18
  onSubmit,
19
  wallet
20
}: WalletSetupSelectAccountsStepProps): React.ReactElement => {
21
  const [selectedAccount, setSelectedAccount] = useState<number | undefined>();
×
22
  const { t } = useTranslate();
×
23

24
  return (
×
25
    <WalletSetupStepLayout
26
      title={t('core.walletSetupSelectAccountsStep.selectAccount')}
27
      onBack={onBack}
28
      onNext={() => onSubmit(selectedAccount)}
×
29
      isNextEnabled={selectedAccount >= 0}
30
      nextLabel={t('core.walletSetupSelectAccountsStep.exportKeys')}
31
      description={
32
        <div className={styles.subtitle}>{t('core.walletSetupSelectAccountsStep.chooseAccountToExport')}</div>
33
      }
34
      belowContentText={
35
        <p className={styles.footerText}>
36
          {t('core.walletSetupSelectAccountsStep.useHWToConfirm', '', {
37
            wallet
38
          })}
39
        </p>
40
      }
41
      currentTimelineStep={WalletTimelineSteps.CONNECT_WALLET}
42
      isHardwareWallet
43
    >
44
      <div className={styles.walletSetupSelectAccountsStep}>
45
        {Array.from({ length: accounts }).map((_, index) => (
46
          <div
×
47
            key={index}
48
            className={styles.account}
49
            onClick={() => setSelectedAccount(index)}
×
50
            data-testid={`select-account-${index}`}
51
          >
52
            <Radio checked={selectedAccount === index} />
53
            <p>
54
              {t('core.walletSetupSelectAccountsStep.account')} {index} {index === 0 && '- Default'}
×
55
            </p>
56
          </div>
57
        ))}
58
      </div>
59
    </WalletSetupStepLayout>
60
  );
61
};
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