Skip to content

Commit 4225c78

Browse files
committed
1 parent 5f41463 commit 4225c78

2 files changed

Lines changed: 12 additions & 6 deletions

File tree

src/components/map-projects/MapProject.jsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import Tooltip from '@mui/material/Tooltip';
2727
import Alert from '@mui/material/Alert';
2828
import Collapse from '@mui/material/Collapse';
2929
import Divider from '@mui/material/Divider';
30+
import Badge from '@mui/material/Badge';
3031
import { DataGrid } from '@mui/x-data-grid';
3132

3233

@@ -1555,19 +1556,21 @@ const MapProject = () => {
15551556
})
15561557
}
15571558
</div>
1558-
<div className='col-xs-12' style={{padding: '8px 14px', display: 'flex', alignItems: 'center', backgroundColor: SURFACE_COLORS.main}}>
1559+
<div className='col-xs-12' style={{padding: '12px 14px 8px 14px', display: 'flex', alignItems: 'center', backgroundColor: SURFACE_COLORS.main}}>
15591560
<FormControl sx={{minWidth: '16px'}}>
15601561
<SearchField onChange={debounce(val => setSearchText(val || ''))} />
15611562
</FormControl>
1563+
<Badge badgeContent={matchTypes.very_high || 0} max={999} color='primary'>
15621564
<FormControlLabel
15631565
sx={{
15641566
marginLeft: '4px',
15651567
marginRight: '8px',
15661568
'.MuiFormControlLabel-label': {fontSize: '0.8125rem'}
15671569
}}
15681570
control={<Switch disabled={!showMatchSummary || selectedRowStatus === 'unmapped'} size="small" checked={selectedMatchBucket === 'very_high'} onChange={() => onMatchTypeChange('very_high')} />}
1569-
label={`Auto Match (${(matchTypes.very_high || 0).toLocaleString()})`}
1571+
label='Auto Match'
15701572
/>
1573+
</Badge>
15711574
<ScoreBucketButton
15721575
selected={selectedCandidatesScoreBucket}
15731576
onSort={() => setScoreBucketSortBy(scoreBucketSortBy === 'desc' ? 'asc' : 'desc')}

src/components/map-projects/ScoreBucketButton.jsx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,14 @@ import UpIcon from '@mui/icons-material/NorthRounded';
44
import SortIcon from '@mui/icons-material/SwapVertRounded';
55
import ButtonGroup from '@mui/material/ButtonGroup'
66
import Button from '@mui/material/Button'
7+
import Badge from '@mui/material/Badge'
78
import startCase from 'lodash/startCase'
89
import { SCORES_COLOR } from './constants'
910

1011
const BucketButton = ({id, selected, onClick, count}) => {
1112
const isSelected = selected === id && count
12-
return <Button
13+
return <Badge badgeContent={count} color='primary' max={999} sx={{'.MuiBadge-badge': {backgroundColor: SCORES_COLOR[id]}}}>
14+
<Button
1315
onClick={() => onClick(id)}
1416
disabled={!count}
1517
sx={{
@@ -18,8 +20,9 @@ const BucketButton = ({id, selected, onClick, count}) => {
1820
backgroundColor: isSelected ? SCORES_COLOR[id] : undefined,
1921
borderBottom: count ? `2px solid ${SCORES_COLOR[id]} !important` : undefined,
2022
}}>
21-
{`${startCase(id)} (${count})`}
22-
</Button>
23+
{startCase(id)}
24+
</Button>
25+
</Badge>
2326
}
2427

2528
const ScoreBucketButton = ({onClick, onSort, sortBy, selected, recommended, available, unranked}) => {
@@ -33,7 +36,7 @@ const ScoreBucketButton = ({onClick, onSort, sortBy, selected, recommended, avai
3336
const disabled = !recommended && !available && !unranked
3437
const selectedCount = selected === 'recommended' ? recommended : (selected === 'available' ? available : unranked)
3538
return (
36-
<ButtonGroup size='small' variant='text' sx={{marginRight: '8px'}}>
39+
<ButtonGroup size='small' variant='text' sx={{marginRight: '8px', marginLeft: '12px'}}>
3740
<BucketButton id='recommended' selected={selected} count={recommended} onClick={onClick} />
3841
<BucketButton id='available' selected={selected} count={available} onClick={onClick} />
3942
<BucketButton id='unranked' selected={selected} count={unranked} onClick={onClick} />

0 commit comments

Comments
 (0)