Files
jitsi-meet/react/features/visitors/components/web/VisitorsCountLabel.tsx
Дамян Минков 649a4ffd46 feat(visitors): Updates mobile to handle redirected conf error. (#13110)
* feat(visitors): Updates mobile to handle redirected conf error.

* squash: Center the buttons when iAmVisitor.

* squash: Enables chat in visitor mode.

* feat: Prints the used lib-jitsi-meet.

* feat: Shows a notification when joining as a visitor.

* fix(notifications): display and fix styles for notifications in tile view

---------

Co-authored-by: Calin-Teodor <calin.chitu@8x8.com>
2023-03-28 08:08:56 -05:00

41 lines
1.4 KiB
TypeScript

import React from 'react';
import { useTranslation } from 'react-i18next';
import { useSelector } from 'react-redux';
import { makeStyles } from 'tss-react/mui';
import { IReduxState } from '../../../app/types';
import { IconUsers } from '../../../base/icons/svg';
import Label from '../../../base/label/components/web/Label';
import Tooltip from '../../../base/tooltip/components/Tooltip';
import { getVisitorsShortText, iAmVisitor } from '../../functions';
const useStyles = makeStyles()(theme => {
return {
label: {
backgroundColor: theme.palette.warning02,
color: theme.palette.uiBackground
}
};
});
const VisitorsCountLabel = () => {
const { classes: styles, theme } = useStyles();
const visitorsMode = useSelector((state: IReduxState) => iAmVisitor(state));
const visitorsCount = useSelector((state: IReduxState) =>
state['features/visitors'].count || 0);
const { t } = useTranslation();
return !visitorsMode && visitorsCount > 0 && (<Tooltip
content = { t('visitors.labelTooltip', { count: visitorsCount }) }
position = { 'bottom' }>
<Label
className = { styles.label }
icon = { IconUsers }
iconColor = { theme.palette.icon04 }
id = 'visitorsCountLabel'
text = { `${getVisitorsShortText(visitorsCount)}` } />
</Tooltip>);
};
export default VisitorsCountLabel;