Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

DisplayNameBadge.tsx 854B

12345678910111213141516171819202122232425262728293031323334353637
  1. import React from 'react';
  2. import { makeStyles } from 'tss-react/mui';
  3. const useStyles = makeStyles()(theme => {
  4. const { text01 } = theme.palette;
  5. return {
  6. badge: {
  7. background: 'rgba(0, 0, 0, 0.6)',
  8. borderRadius: '3px',
  9. color: text01,
  10. maxWidth: '50%',
  11. overflow: 'hidden',
  12. padding: '2px 16px',
  13. textOverflow: 'ellipsis',
  14. whiteSpace: 'nowrap'
  15. }
  16. };
  17. });
  18. /**
  19. * Component that displays a name badge.
  20. *
  21. * @param {Props} props - The props of the component.
  22. * @returns {ReactElement}
  23. */
  24. const DisplayNameBadge: React.FC<{ name: string; }> = ({ name }) => {
  25. const { classes } = useStyles();
  26. return (
  27. <div className = { classes.badge }>
  28. { name }
  29. </div>
  30. );
  31. };
  32. export default DisplayNameBadge;