mirror of
https://gitcode.com/GitHub_Trending/ji/jitsi-meet.git
synced 2025-12-30 11:22:31 +00:00
feat(speakerstats): Shows a tooltip for participants count.
This commit is contained in:
@@ -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>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user