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

CaptainFact / captain-fact-extension / 4737231341

pending completion
4737231341

push

github

GitHub
fix: Manifest V3 fixes (#193)

29 of 123 branches covered (23.58%)

Branch coverage included in aggregate %.

38 of 38 new or added lines in 6 files covered. (100.0%)

57 of 228 relevant lines covered (25.0%)

0.65 hits per line

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

0.0
/app/components/Popup.js
1
import React from 'react'
2
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
3
import { faCog, faTv } from '@fortawesome/free-solid-svg-icons'
4
import { Tab, Tabs, TabList, TabPanel } from 'react-tabs'
5

6
import Settings from './Settings'
7

8
import styles from './Popup.css'
9
import tabsStyles from './Tabs.css'
10
import translate from '../lib/translate'
11
import VideosList from './VideosList'
12
import ExternalLink from './ExternalLink'
13
import { BrowserExtension } from '../lib/browser-extension'
14
import {
15
  GrantPermissions,
16
  checkHasAllDomainsPermissions,
17
} from './GrantPermissions'
18
import LocalSettings from '../lib/local_settings'
19

20
const checkIfPermissionsWarningShouldBeShown = async () => {
×
21
  const hasPermissions = await checkHasAllDomainsPermissions()
×
22
  if (!hasPermissions) {
×
23
    if (!(await LocalSettings.getValue('dismissPermissionWarning'))) {
×
24
      return true
×
25
    }
26
  }
27

28
  return false
×
29
}
30

31
const Popup = () => {
×
32
  const [showPermissionsWarning, setShowPermissionsWarning] =
33
    React.useState(false)
×
34

35
  React.useEffect(() => {
×
36
    checkIfPermissionsWarningShouldBeShown().then((showWarning) => {
×
37
      setShowPermissionsWarning(showWarning)
×
38
    })
39
  }, [])
40

41
  return (
×
42
    <div className={styles.popup}>
43
      <ExternalLink
44
        href="https://captainfact.io/videos"
45
        className={styles.bannerLink}
46
      >
47
        <img
48
          src={BrowserExtension.runtime.getURL('img/banner.jpg')}
49
          className={styles.banner}
50
          alt="CaptainFact"
51
        />
52
      </ExternalLink>
53
      {showPermissionsWarning ? (
×
54
        <GrantPermissions onClose={() => setShowPermissionsWarning(false)} />
×
55
      ) : (
56
        <Tabs
57
          defaultIndex={0}
58
          selectedTabClassName={tabsStyles.isActive}
59
          selectedTabPanelClassName={tabsStyles.panelActive}
60
        >
61
          <TabList className={tabsStyles.tabsList}>
62
            <Tab>
63
              <a>
64
                <FontAwesomeIcon icon={faTv} />
65
                <span>{translate('videos')}</span>
66
              </a>
67
            </Tab>
68
            <Tab>
69
              <a>
70
                <FontAwesomeIcon icon={faCog} />
71
                <span>{translate('settings')}</span>
72
              </a>
73
            </Tab>
74
          </TabList>
75
          <TabPanel>
76
            <VideosList />
77
          </TabPanel>
78
          <TabPanel>
79
            <div className={styles.content}>
80
              <Settings />
81
            </div>
82
          </TabPanel>
83
        </Tabs>
84
      )}
85
    </div>
86
  )
87
}
88

89
export default Popup
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