mirror of
https://gitcode.com/GitHub_Trending/ji/jitsi-meet.git
synced 2026-05-14 18:27:48 +00:00
* feat(visitors): Handling of live conference and queue service. * squash: Small refactor mobile code. * squash: Drop debug log. * chore(deps) lib-jitsi-meet@latest https://github.com/jitsi/lib-jitsi-meet/compare/v1836.0.0+d05325f3...v1839.0.0+ea523fc6 * squash: Adds a count function. * squash: Drop debug print. * squash: Skip if queueService is not enabled. * squash: Avoids double subscribing for visitorsWaiting. * squash: Fixes lint error. * squash: Fixes showing dialog.
41 lines
1.4 KiB
TypeScript
41 lines
1.4 KiB
TypeScript
import React from 'react';
|
|
import { useSelector } from 'react-redux';
|
|
|
|
import { IReduxState } from '../../../app/types';
|
|
import { IconUsers } from '../../../base/icons/svg';
|
|
import Label from '../../../base/label/components/native/Label';
|
|
import BaseTheme from '../../../base/ui/components/BaseTheme.native';
|
|
import { getVisitorsCount, getVisitorsShortText, iAmVisitor } from '../../functions';
|
|
|
|
const styles = {
|
|
raisedHandsCountLabel: {
|
|
alignItems: 'center',
|
|
backgroundColor: BaseTheme.palette.warning02,
|
|
borderRadius: BaseTheme.shape.borderRadius,
|
|
flexDirection: 'row',
|
|
marginLeft: BaseTheme.spacing[0],
|
|
marginBottom: BaseTheme.spacing[0]
|
|
},
|
|
|
|
raisedHandsCountLabelText: {
|
|
color: BaseTheme.palette.uiBackground,
|
|
paddingLeft: BaseTheme.spacing[2]
|
|
}
|
|
};
|
|
|
|
const VisitorsCountLabel = () => {
|
|
const visitorsMode = useSelector((state: IReduxState) => iAmVisitor(state));
|
|
const visitorsCount = useSelector(getVisitorsCount);
|
|
|
|
return !visitorsMode && visitorsCount > 0 ? (
|
|
<Label
|
|
icon = { IconUsers }
|
|
iconColor = { BaseTheme.palette.uiBackground }
|
|
style = { styles.raisedHandsCountLabel }
|
|
text = { `${getVisitorsShortText(visitorsCount)}` }
|
|
textStyle = { styles.raisedHandsCountLabelText } />
|
|
) : null;
|
|
};
|
|
|
|
export default VisitorsCountLabel;
|