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

input-output-hk / lace / 8421888543

25 Mar 2024 02:37PM UTC coverage: 51.421% (-2.2%) from 53.598%
8421888543

push

github

web-flow
feat(extension): add sort by posthog events (preferences card and list view header) (#980)

* feat(extension): add sort by posthog events

* feat(extension): add change view posthog events

2294 of 5442 branches covered (42.15%)

Branch coverage included in aggregate %.

5158 of 9050 relevant lines covered (56.99%)

52.47 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