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

zooniverse / front-end-monorepo / 16483941485

23 Jul 2025 11:24PM UTC coverage: 77.14%. First build
16483941485

Pull #6972

github

web-flow
Merge 177ac29d5 into e09dfce1b
Pull Request #6972: lib-react-components: Add CollectIconButton, CollectionsModal, and related components

11378 of 17314 branches covered (65.72%)

Branch coverage included in aggregate %.

89 of 150 new or added lines in 18 files covered. (59.33%)

17670 of 20342 relevant lines covered (86.86%)

394.83 hits per line

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

73.08
/packages/lib-react-components/src/CollectIconButton/CollectIconButton.js
1
import { Bookmark } from 'grommet-icons'
1✔
2
import { string } from 'prop-types'
1✔
3
import { useState } from 'react'
1✔
4

5
import { useTranslation } from '../translations/i18n'
1✔
6
import IconActionButton from '../IconActionButton'
1✔
7
import CollectionsModal from './components/CollectionsModal'
156!
8

9
function CollectIconButton({
10
  projectId,
4✔
11
  subjectId,
4✔
12
  userId,
4✔
13
  ...props
4✔
14
}) {
15
  const [collectionsModalActive, setCollectionsModalActive] = useState(false)
4✔
16
  
17
  const { t } = useTranslation()
4✔
18
  
19
  function handleCollectionsModal() {
NEW
20
    setCollectionsModalActive(!collectionsModalActive)
×
21
  }
22

23
  return (
4✔
24
    <>
25
      <CollectionsModal
26
        collectionsModalActive={collectionsModalActive}
27
        projectId={projectId}
28
        setCollectionsModalActive={setCollectionsModalActive}
29
        subjectId={subjectId}
30
        userId={userId}
31
      />
32
      <IconActionButton
33
        a11yTitle={t('CollectIconButton.collect')}
34
        icon={<Bookmark />}
35
        onClick={handleCollectionsModal}
36
        {...props}
37
      />
38
    </>
39
  )
40
}
41

42
CollectIconButton.propTypes = {
1✔
43
  projectId: string,
44
  subjectId: string.isRequired,
45
  userId: string.isRequired
46
}
1✔
47

48
export default CollectIconButton
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