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

zooniverse / front-end-monorepo / 16599520111

29 Jul 2025 02:47PM UTC coverage: 77.208% (-0.2%) from 77.453%
16599520111

Pull #6972

github

web-flow
Merge ba27ae6c6 into 367774cd7
Pull Request #6972: lib-react-components: Add CollectIconButton, CollectionsModal, and related components

11385 of 17289 branches covered (65.85%)

Branch coverage included in aggregate %.

88 of 153 new or added lines in 18 files covered. (57.52%)

17673 of 20347 relevant lines covered (86.86%)

396.28 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