mirror of
https://gitcode.com/GitHub_Trending/ji/jitsi-meet.git
synced 2026-05-14 19:37:47 +00:00
- Move the styles from css to tss-react ones - Dynamic fontSize based on the visible area of the page - Remove the gaps in the background when a line is wrapped. - Change the text color to white. - Remove transparency.
40 lines
948 B
TypeScript
40 lines
948 B
TypeScript
import React from 'react';
|
|
import { makeStyles } from 'tss-react/mui';
|
|
|
|
import { DISPLAY_NAME_VERTICAL_PADDING } from './styles';
|
|
|
|
const useStyles = makeStyles()(theme => {
|
|
const { text01 } = theme.palette;
|
|
|
|
return {
|
|
badge: {
|
|
background: 'rgba(0, 0, 0, 0.6)',
|
|
borderRadius: '3px',
|
|
color: text01,
|
|
maxWidth: '50%',
|
|
overflow: 'hidden',
|
|
padding: `${DISPLAY_NAME_VERTICAL_PADDING / 2}px 16px`,
|
|
textOverflow: 'ellipsis',
|
|
whiteSpace: 'nowrap'
|
|
}
|
|
};
|
|
});
|
|
|
|
/**
|
|
* Component that displays a name badge.
|
|
*
|
|
* @param {Props} props - The props of the component.
|
|
* @returns {ReactElement}
|
|
*/
|
|
const DisplayNameBadge: React.FC<{ name: string; }> = ({ name }) => {
|
|
const { classes } = useStyles();
|
|
|
|
return (
|
|
<div className = { classes.badge }>
|
|
{ name }
|
|
</div>
|
|
);
|
|
};
|
|
|
|
export default DisplayNameBadge;
|