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

input-output-hk / lace / 8535836959

03 Apr 2024 08:45AM UTC coverage: 50.56% (-3.3%) from 53.839%
8535836959

push

github

2dd801
web-flow
chore(extension): update lace version v1.10.0 LW-10198 (#1015)

2172 of 5362 branches covered (40.51%)

Branch coverage included in aggregate %.

5147 of 9114 relevant lines covered (56.47%)

52.15 hits per line

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

71.43
/apps/browser-extension-wallet/src/components/TransactionHashBox/TransactionHashBox.tsx
1
import React, { useState } from 'react';
70✔
2
import { useTranslation } from 'react-i18next';
70✔
3
import { Typography } from 'antd';
70✔
4
import { CopyToClipboard } from 'react-copy-to-clipboard';
70✔
5
import Copy from '../../assets/icons/copy.component.svg';
70✔
6
import Check from '../../assets/icons/check-success.component.svg';
70✔
7
import styles from './TransactionHashBox.module.scss';
70✔
8

9
export interface TransactionHashBoxProps {
10
  hash: string;
11
}
12

13
const { Text, Paragraph } = Typography;
70✔
14

15
export const TransactionHashBox = ({ hash }: TransactionHashBoxProps): React.ReactElement => {
70✔
16
  const { t } = useTranslation();
36✔
17
  const [hasMouseEnter, setHasMouseEnter] = useState(false);
36✔
18
  const [hasBeenCopied, setHasBeenCopied] = useState(false);
36✔
19

20
  const handleMouseEnter = () => {
36✔
21
    setHasMouseEnter(true);
×
22
  };
23
  const hadnelMouseLeave = () => {
36✔
24
    setHasMouseEnter(false);
×
25
    setHasBeenCopied(false);
×
26
  };
27

28
  const handleCopy = (_text: string, result: boolean) => {
36✔
29
    setHasBeenCopied(result);
×
30
  };
31

32
  const copyText = hasBeenCopied ? 'general.button.copied' : 'general.button.copy';
36!
33

34
  return (
36✔
35
    <CopyToClipboard onCopy={handleCopy} text={hash}>
36
      <div className={styles.container} onMouseEnter={handleMouseEnter} onMouseLeave={hadnelMouseLeave}>
37
        <Paragraph className={styles.hash} data-testid="transaction-hash">
38
          {hash}
39
        </Paragraph>
40
        {hasMouseEnter && (
18!
41
          <div className={styles.copyContainer} data-testid="transaction-hash-copy-container">
42
            {hasBeenCopied ? <Check className={styles.checkIcon} /> : <Copy className={styles.copyIcon} />}
×
43
            <Text className={styles.copy} data-testid="transaction-hash-copy-text">
44
              {t(copyText)}{' '}
45
            </Text>
46
          </div>
47
        )}
48
      </div>
49
    </CopyToClipboard>
50
  );
51
};
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

© 2026 Coveralls, Inc