Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

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

damencho4c37e0d7618b
diff --git a/lang/main.json b/lang/main.json
index 0175c6881f..f165105537 100644
--- a/lang/main.json
+++ b/lang/main.json
@@ -1183,6 +1183,7 @@
"fearful": "Fearful",
"happy": "Happy",
"hours": "{{count}}h",
+ "labelTooltip": "Number of participants: {{count}}",
"minutes": "{{count}}m",
"name": "Name",
"neutral": "Neutral",
diff --git a/react/features/conference/components/web/SpeakerStatsLabel.tsx b/react/features/conference/components/web/SpeakerStatsLabel.tsx
index 62b5460ee4..be02fe126c 100644
--- a/react/features/conference/components/web/SpeakerStatsLabel.tsx
+++ b/react/features/conference/components/web/SpeakerStatsLabel.tsx
@@ -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>
);
}