@@ -4,12 +4,14 @@ import UpIcon from '@mui/icons-material/NorthRounded';
44import SortIcon from '@mui/icons-material/SwapVertRounded' ;
55import ButtonGroup from '@mui/material/ButtonGroup'
66import Button from '@mui/material/Button'
7+ import Badge from '@mui/material/Badge'
78import startCase from 'lodash/startCase'
89import { SCORES_COLOR } from './constants'
910
1011const 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
2528const 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