You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

SubjectText.tsx 1.6KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. import clsx from 'clsx';
  2. import React from 'react';
  3. import { useSelector } from 'react-redux';
  4. import { makeStyles } from 'tss-react/mui';
  5. import { getConferenceName } from '../../../base/conference/functions';
  6. import { withPixelLineHeight } from '../../../base/styles/functions.web';
  7. import Tooltip from '../../../base/tooltip/components/Tooltip';
  8. const useStyles = makeStyles()(theme => {
  9. return {
  10. container: {
  11. ...withPixelLineHeight(theme.typography.bodyLongRegular),
  12. color: theme.palette.text01,
  13. padding: '2px 16px',
  14. backgroundColor: 'rgba(0, 0, 0, 0.6)',
  15. maxWidth: '324px',
  16. boxSizing: 'border-box',
  17. height: '28px',
  18. borderRadius: `${theme.shape.borderRadius}px 0 0 ${theme.shape.borderRadius}px`,
  19. marginLeft: '2px',
  20. '@media (max-width: 300px)': {
  21. display: 'none'
  22. }
  23. },
  24. content: {
  25. overflow: 'hidden',
  26. textOverflow: 'ellipsis',
  27. whiteSpace: 'nowrap'
  28. }
  29. };
  30. });
  31. /**
  32. * Label for the conference name.
  33. *
  34. * @returns {ReactElement}
  35. */
  36. const SubjectText = () => {
  37. const subject = useSelector(getConferenceName);
  38. const { classes } = useStyles();
  39. return (
  40. <Tooltip
  41. content = { subject }
  42. position = 'bottom'>
  43. <div className = { classes.container }>
  44. <div className = { clsx('subject-text--content', classes.content) }>{subject}</div>
  45. </div>
  46. </Tooltip>
  47. );
  48. };
  49. export default SubjectText;