Update legend and tooltip to display filtered people count

This commit is contained in:
Maxwell Reid 2022-12-02 10:04:49 +11:00
parent 583671bd5e
commit e10ed4d8c4

View file

@ -126,7 +126,7 @@ const AvailabilityViewer = ({
setTooltip({ setTooltip({
x: Math.round(cellBox.x-wrapperBox.x + cellBox.width/2), x: Math.round(cellBox.x-wrapperBox.x + cellBox.width/2),
y: Math.round(cellBox.y-wrapperBox.y + cellBox.height)+6, y: Math.round(cellBox.y-wrapperBox.y + cellBox.height)+6,
available: `${peopleHere.length} / ${people.length} ${t('event:available')}`, available: `${peopleHere.length} / ${filteredPeople.length} ${t('event:available')}`,
date: parsedDate.hour(time.slice(0, 2)).minute(time.slice(2, 4)).format(isSpecificDates ? `${timeText} ddd, D MMM YYYY` : `${timeText} ddd`), date: parsedDate.hour(time.slice(0, 2)).minute(time.slice(2, 4)).format(isSpecificDates ? `${timeText} ddd, D MMM YYYY` : `${timeText} ddd`),
people: peopleHere, people: peopleHere,
}) })
@ -168,7 +168,7 @@ const AvailabilityViewer = ({
<Legend <Legend
min={Math.min(min, filteredPeople.length)} min={Math.min(min, filteredPeople.length)}
max={Math.min(max, filteredPeople.length)} max={Math.min(max, filteredPeople.length)}
total={people.filter(p => p.availability.length > 0).length} total={filteredPeople.length}
onSegmentFocus={count => setFocusCount(count)} onSegmentFocus={count => setFocusCount(count)}
/> />
<Info>{t('event:group.info1')}</Info> <Info>{t('event:group.info1')}</Info>