feat(speakerstats): Shows a tooltip for participants count.

This commit is contained in:
damencho
2025-01-14 09:57:26 -06:00
committed by Дамян Минков
parent a6ff652a03
commit 4c37e0d761
2 changed files with 15 additions and 7 deletions

View File

@@ -1,4 +1,5 @@
import React from 'react';
import { useTranslation } from 'react-i18next';
import { useDispatch, useSelector } from 'react-redux';
import { IReduxState } from '../../../app/types';
@@ -7,6 +8,7 @@ import { IconUsers } from '../../../base/icons/svg';
import Label from '../../../base/label/components/web/Label';
import { COLORS } from '../../../base/label/constants';
import { getParticipantCount } from '../../../base/participants/functions';
import Tooltip from '../../../base/tooltip/components/Tooltip';
import SpeakerStats from '../../../speaker-stats/components/web/SpeakerStats';
import { isSpeakerStatsDisabled } from '../../../speaker-stats/functions';
import { iAmVisitor } from '../../../visitors/functions';
@@ -23,6 +25,7 @@ function SpeakerStatsLabel() {
const iAmVisitorState = useSelector(iAmVisitor);
const _isSpeakerStatsDisabled = useSelector(isSpeakerStatsDisabled);
const dispatch = useDispatch();
const { t } = useTranslation();
// visitor has hidden its own video and should not count itself
if (iAmVisitorState) {
@@ -38,13 +41,17 @@ function SpeakerStatsLabel() {
}
return (
<Label
color = { COLORS.white }
icon = { IconUsers }
iconColor = '#fff'
// eslint-disable-next-line react/jsx-no-bind
onClick = { onClick }
text = { `${count}` } />
<Tooltip
content = { t('speakerStats.labelTooltip', { count }) }
position = { 'bottom' }>
<Label
color = { COLORS.white }
icon = { IconUsers }
iconColor = '#fff'
// eslint-disable-next-line react/jsx-no-bind
onClick = { onClick }
text = { `${count}` } />
</Tooltip>
);
}