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

input-output-hk / lace / 7115777528

06 Dec 2023 02:18PM UTC coverage: 52.945% (-0.9%) from 53.839%
7115777528

push

github

8d78ac
pczeglik-iohk
chore(extension): use dapp-connector patch (#739)

1989 of 4674 branches covered (0.0%)

Branch coverage included in aggregate %.

4483 of 7550 relevant lines covered (59.38%)

56.08 hits per line

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

55.56
/apps/browser-extension-wallet/src/components/MainMenu/MainHeader.tsx
1
import React from 'react';
24✔
2
import { Link, useLocation } from 'react-router-dom';
24✔
3
import styles from './MainHeader.module.scss';
24✔
4
import LaceLogoMark from '../../assets/branding/lace-logo-mark.component.svg';
24✔
5
import { useTranslation } from 'react-i18next';
24✔
6
import { walletRoutePaths } from '@routes';
24✔
7
import classNames from 'classnames';
24✔
8

9
import { DropdownMenu } from '@components/DropdownMenu';
24✔
10
import { ExpandButton } from '@components/ExpandButton';
24✔
11
import { useBackgroundServiceAPIContext } from '@providers/BackgroundServiceAPI';
24✔
12
import { BrowserViewSections } from '@lib/scripts/types';
24✔
13
import { NetworkPill } from '@components/NetworkPill';
24✔
14
import { useAnalyticsContext } from '@providers';
24✔
15
import { PostHogAction } from '@providers/AnalyticsProvider/analyticsTracker';
24✔
16

17
export const MainHeader = (): React.ReactElement => {
24✔
18
  const { t } = useTranslation();
×
19
  const backgroundServices = useBackgroundServiceAPIContext();
×
20
  const location = useLocation();
×
21
  const analytics = useAnalyticsContext();
×
22

23
  const locationBrowserSection = {
×
24
    [walletRoutePaths.assets]: BrowserViewSections.HOME,
25
    [walletRoutePaths.nfts]: BrowserViewSections.NFTS,
26
    [walletRoutePaths.activity]: BrowserViewSections.TRANSACTION,
27
    [walletRoutePaths.earn]: BrowserViewSections.STAKING,
28
    [walletRoutePaths.addressBook]: BrowserViewSections.ADDRESS_BOOK,
29
    [walletRoutePaths.settings]: BrowserViewSections.SETTINGS
30
  };
31

32
  return (
×
33
    <div className={styles.header} data-testid="header-container">
34
      <div
35
        className={classNames(styles.content, {
36
          [styles.multiWallet]: process.env.USE_MULTI_WALLET === 'true'
37
        })}
38
      >
39
        {process.env.USE_MULTI_WALLET === 'true' && (
×
40
          <div className={styles.multiWalletNetworkPillBox}>
41
            <NetworkPill isPopup />
42
          </div>
43
        )}
44
        <Link
45
          className={styles.linkLogo}
46
          to={walletRoutePaths.assets}
47
          data-testid="header-logo"
48
          onClick={() => analytics.sendEventToPostHog(PostHogAction.WalletLaceClick)}
×
49
        >
50
          <LaceLogoMark className={styles.logo} />
51
          {process.env.USE_MULTI_WALLET !== 'true' && <NetworkPill />}
×
52
        </Link>
53
        <div className={styles.controls}>
54
          <ExpandButton
55
            label={t('expandPopup')}
56
            onClick={() => backgroundServices.handleOpenBrowser({ section: locationBrowserSection[location.pathname] })}
×
57
          />
58
          <DropdownMenu isPopup />
59
        </div>
60
      </div>
61
    </div>
62
  );
63
};
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