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.

CallingDialog.tsx 2.3KB

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