Files
jitsi-meet/react/features/display-name/components/web/DisplayNameBadge.tsx
raduanastase8x8 d2e52d2c2a ref(Theme): Changes typography values to rem (#16021)
Replaces hard-coded pixel values with relative rem units across UI components to improve typography responsiveness and maintainability.

Co-authored-by: Hristo Terezov <hristo@jitsi.org>
2025-08-06 19:07:27 -05:00

42 lines
1.0 KiB
TypeScript

import React from 'react';
import { makeStyles } from 'tss-react/mui';
import { remToPixels } from '../../../base/ui/functions.any';
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: `${remToPixels(`${DISPLAY_NAME_VERTICAL_PADDING}rem`) / 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;