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

input-output-hk / lace / 9413237952

08 Feb 2024 01:46PM UTC coverage: 52.934% (-0.9%) from 53.839%
9413237952

push

github

f98d1b
rhyslbw
chore: bump version

1989 of 4673 branches covered (42.56%)

Branch coverage included in aggregate %.

4487 of 7561 relevant lines covered (59.34%)

56.03 hits per line

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

29.63
/apps/browser-extension-wallet/src/components/MainMenu/DropdownMenuOverlay/DropdownMenuOverlay.tsx
1
import React, { ReactNode, VFC, useState } from 'react';
24✔
2
import { Menu, MenuProps } from 'antd';
24✔
3
import {
24✔
4
  Separator,
5
  Links,
6
  AddressBookLink,
7
  SettingsLink,
8
  ThemeSwitcher,
9
  LockWallet,
10
  UserInfo,
11
  NetworkChoise,
12
  AddNewWalletLink
13
} from './components';
14
import styles from './DropdownMenuOverlay.module.scss';
24✔
15
import { NetworkInfo } from './components/NetworkInfo';
24✔
16
import { Sections } from './types';
24✔
17
import { PostHogAction } from '@providers/AnalyticsProvider/analyticsTracker';
24✔
18

19
interface Props extends MenuProps {
20
  isPopup?: boolean;
21
  lockWalletButton?: ReactNode;
22
  topSection?: ReactNode;
23
  sendAnalyticsEvent?: (event: PostHogAction) => void;
24
}
25

26
export const DropdownMenuOverlay: VFC<Props> = ({
24✔
27
  isPopup,
28
  lockWalletButton = <LockWallet />,
×
29
  topSection = <UserInfo />,
×
30
  sendAnalyticsEvent,
×
31
  ...props
×
32
}): React.ReactElement => {
33
  const [currentSection, setCurrentSection] = useState<Sections>(Sections.Main);
×
34

35
  const handleNetworkChoise = () => {
×
36
    setCurrentSection(Sections.NetworkInfo);
×
37
    sendAnalyticsEvent(PostHogAction.UserWalletProfileNetworkClick);
×
38
  };
39

40
  return (
×
41
    <Menu {...props} className={styles.menuOverlay} data-testid="header-menu">
42
      {currentSection === Sections.Main && (
×
43
        <>
44
          {topSection}
45
          <Links>
46
            {process.env.USE_MULTI_WALLET === 'true' && <AddNewWalletLink />}
×
47
            <AddressBookLink isPopup={isPopup} />
48
            <SettingsLink />
49
            <Separator />
50
            <ThemeSwitcher isPopup={isPopup} />
51
            <NetworkChoise onClick={handleNetworkChoise} />
52
            {lockWalletButton && (
×
53
              <>
54
                <Separator /> {lockWalletButton}
55
              </>
56
            )}
57
          </Links>
58
        </>
59
      )}
60
      {currentSection === Sections.NetworkInfo && <NetworkInfo onBack={() => setCurrentSection(Sections.Main)} />}
×
61
    </Menu>
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