2023-01-19 08:59:07 +00:00
|
|
|
import React from 'react';
|
|
|
|
import { useSelector } from 'react-redux';
|
|
|
|
import { makeStyles } from 'tss-react/mui';
|
|
|
|
|
|
|
|
import { getParticipantCount } from '../../../base/participants/functions';
|
|
|
|
import { withPixelLineHeight } from '../../../base/styles/functions.web';
|
|
|
|
|
|
|
|
const useStyles = makeStyles()(theme => {
|
|
|
|
return {
|
|
|
|
badge: {
|
|
|
|
backgroundColor: theme.palette.ui03,
|
|
|
|
borderRadius: '100%',
|
|
|
|
height: '16px',
|
2023-02-09 08:10:16 +00:00
|
|
|
minWidth: '16px',
|
2023-01-19 08:59:07 +00:00
|
|
|
color: theme.palette.text01,
|
|
|
|
...withPixelLineHeight(theme.typography.labelBold),
|
|
|
|
pointerEvents: 'none',
|
|
|
|
position: 'absolute',
|
2023-02-03 11:30:38 +00:00
|
|
|
right: '-4px',
|
2023-02-09 08:10:16 +00:00
|
|
|
top: '-3px',
|
|
|
|
textAlign: 'center',
|
2023-02-21 09:17:22 +00:00
|
|
|
padding: '1px'
|
2023-01-19 08:59:07 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
});
|
|
|
|
|
|
|
|
const ParticipantsCounter = () => {
|
|
|
|
const { classes } = useStyles();
|
|
|
|
const participantsCount = useSelector(getParticipantCount);
|
|
|
|
|
|
|
|
return <span className = { classes.badge }>{participantsCount}</span>;
|
|
|
|
};
|
|
|
|
|
|
|
|
export default ParticipantsCounter;
|