您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

CallingDialog.tsx 2.2KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. import React from 'react';
  2. import { WithTranslation } from 'react-i18next';
  3. import { makeStyles } from 'tss-react/mui';
  4. import Avatar from '../../../../base/avatar/components/Avatar';
  5. import { translate } from '../../../../base/i18n/functions';
  6. import Icon from '../../../../base/icons/components/Icon';
  7. import { IconCloseLarge } from '../../../../base/icons/svg';
  8. import Label from '../Label';
  9. interface IProps extends WithTranslation {
  10. /**
  11. * The phone number that is being called.
  12. */
  13. number: string;
  14. /**
  15. * Closes the dialog.
  16. */
  17. onClose: (e?: React.MouseEvent) => void;
  18. /**
  19. * The status of the call.
  20. */
  21. status: string;
  22. }
  23. const useStyles = makeStyles()(theme => {
  24. return {
  25. callingDialog: {
  26. padding: theme.spacing(3),
  27. textAlign: 'center',
  28. '& .prejoin-dialog-calling-header': {
  29. textAlign: 'right'
  30. },
  31. '& .prejoin-dialog-calling-label': {
  32. fontSize: '15px',
  33. margin: `${theme.spacing(2)} 0 ${theme.spacing(3)} 0`
  34. },
  35. '& .prejoin-dialog-calling-number': {
  36. fontSize: '19px',
  37. lineHeight: '28px',
  38. margin: `${theme.spacing(3)} 0`
  39. }
  40. }
  41. };
  42. });
  43. /**
  44. * Dialog displayed when the user gets called by the meeting.
  45. *
  46. * @param {IProps} props - The props of the component.
  47. * @returns {ReactElement}
  48. */
  49. function CallingDialog(props: IProps) {
  50. const { number, onClose, status, t } = props;
  51. const { classes } = useStyles();
  52. return (
  53. <div className = { classes.callingDialog }>
  54. <div className = 'prejoin-dialog-calling-header'>
  55. <Icon
  56. className = 'prejoin-dialog-icon'
  57. onClick = { onClose }
  58. role = 'button'
  59. size = { 24 }
  60. src = { IconCloseLarge } />
  61. </div>
  62. <Label className = 'prejoin-dialog-calling-label'>
  63. {t(status)}
  64. </Label>
  65. <Avatar size = { 72 } />
  66. <div className = 'prejoin-dialog-calling-number'>{number}</div>
  67. </div>
  68. );
  69. }
  70. export default translate(CallingDialog);