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.

ConferenceID.tsx 2.1KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. import { Theme } from '@mui/material';
  2. import React from 'react';
  3. import { WithTranslation } from 'react-i18next';
  4. import { makeStyles } from 'tss-react/mui';
  5. import { translate } from '../../../../base/i18n/functions';
  6. import { withPixelLineHeight } from '../../../../base/styles/functions.web';
  7. import { _formatConferenceIDPin } from '../../../_utils';
  8. interface IProps extends WithTranslation {
  9. /**
  10. * The conference id.
  11. */
  12. conferenceID?: string | number;
  13. /**
  14. * The conference name.
  15. */
  16. conferenceName: string;
  17. }
  18. const useStyles = makeStyles()((theme: Theme) => {
  19. return {
  20. container: {
  21. marginTop: 32,
  22. maxWidth: 310,
  23. padding: '16px 12px',
  24. background: theme.palette.ui02,
  25. textAlign: 'center',
  26. display: 'flex',
  27. flexDirection: 'column',
  28. borderRadius: 6,
  29. '& *': {
  30. userSelect: 'text'
  31. }
  32. },
  33. confNameLabel: {
  34. ...withPixelLineHeight(theme.typography.heading6),
  35. marginBottom: 18,
  36. whiteSpace: 'nowrap',
  37. overflow: 'hidden',
  38. textOverflow: 'ellipsis'
  39. },
  40. descriptionLabel: {
  41. ...withPixelLineHeight(theme.typography.bodyShortRegularLarge),
  42. marginBottom: 18
  43. },
  44. separator: {
  45. width: '100%',
  46. height: 1,
  47. background: theme.palette.ui04,
  48. marginBottom: 18
  49. },
  50. pinLabel: {
  51. ...withPixelLineHeight(theme.typography.heading6)
  52. }
  53. };
  54. });
  55. const ConferenceID: React.FC<IProps> = ({ conferenceID, t }) => {
  56. const { classes: styles } = useStyles();
  57. return (
  58. <div className = { styles.container }>
  59. <div className = { styles.descriptionLabel }>
  60. { t('info.dialANumber') }
  61. </div>
  62. <div className = { styles.separator } />
  63. <div className = { styles.pinLabel }>
  64. { `${t('info.dialInConferenceID')} ${_formatConferenceIDPin(conferenceID ?? '')}` }
  65. </div>
  66. </div>
  67. );
  68. };
  69. export default translate(ConferenceID);