• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In
Build has been canceled!

zooniverse / front-end-monorepo / 14889416145

07 May 2025 05:21PM UTC coverage: 75.291% (-0.3%) from 75.579%
14889416145

push

github

web-flow
Build All Projects page sorted by recently classified (#6854)

* bulid AllProjectsByRecent

* display all projects from /project_preferences in pagination

11220 of 17221 branches covered (65.15%)

Branch coverage included in aggregate %.

31 of 84 new or added lines in 11 files covered. (36.9%)

4 existing lines in 3 files now uncovered.

17401 of 20793 relevant lines covered (83.69%)

386.14 hits per line

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

73.68
/packages/lib-react-components/src/ProjectCard/components/CardHeader.js
1
import { Box, Text } from 'grommet'
1✔
2
import { number, string } from 'prop-types'
1✔
3
import styled from 'styled-components'
1✔
4

5
import { useTranslation } from '../../translations/i18n'
1✔
6
import SpacedText from '../../SpacedText'
3✔
7

8
const StyledBox = styled(Box)`
1✔
9
  backdrop-filter: blur(2px);
10
  background: ${props => props.state === 'paused' ? 
24!
11
    'rgba(67, 187, 253, 0.5)'
12
    : props.state === 'finished' ?
24!
13
    'rgba(228, 89, 80, 0.5)'
14
    : undefined};
15
  position: relative;
16
`
17

18
const StyledBadge = styled(Text)`
1✔
19
  background: white;
20
  border-radius: 0.5rem;
21
  box-shadow: 1px 1px 4px 0px rgba(0, 0, 0, 0.25);
22
  height: fit-content;
23
  min-width: 0.75rem;
24
  padding: 2px 3px;
25
  position: absolute;
26
  right: 5px;
27
  text-align: center;
28
  top: 5px;
29
`
30

31
function CardHeader({
32
  badge,
24✔
33
  state = 'live'
24!
34
}) {
35
  // project.state can be 'live', 'paused', 'finished', or 'development'
36
  if ((state !== 'paused' && state !== 'finished') && !badge) return null
24!
37
  
38
  const { t } = useTranslation()
24✔
39

40
  let stateText
41
  if (state === 'paused') {
24!
UNCOV
42
    stateText = t('ProjectCard.paused')
×
43
  } else if (state === 'finished') {
24!
UNCOV
44
    stateText = t('ProjectCard.finished')
×
45
  }
46

47
  return (
24✔
48
    <StyledBox
49
      direction='row'
50
      align='center'
51
      height='30px'
52
      justify='center'
53
      round={{ corner: 'top', size: '8px' }}
54
      state={state}
55
    >
56
      {stateText ? (
24!
57
        <SpacedText
58
          color='white'
59
          size='0.75rem'
60
          weight='bold'
61
        >
62
          {stateText}
63
        </SpacedText>
64
      ) : null}
65
      {badge ? (
24!
66
        <StyledBadge
67
          color='black'
68
          size='0.75rem'
69
          weight='bold'
70
          elevation='small'
71
        >
72
          {badge}
73
        </StyledBadge>
74
      ) : null}
75
    </StyledBox>
76
  )
77
}
78

79
CardHeader.propTypes = {
1✔
80
  badge: number,
81
  state: string
82
}
1✔
83

84
export default CardHeader
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