Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

CallingDialog.js 2.2KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. // @flow
  2. import { makeStyles } from '@material-ui/styles';
  3. import React from 'react';
  4. import { Avatar } from '../../../base/avatar';
  5. import { translate } from '../../../base/i18n';
  6. import { Icon, IconClose } from '../../../base/icons';
  7. import Label from '../Label';
  8. type Props = {
  9. /**
  10. * The phone number that is being called.
  11. */
  12. number: string,
  13. /**
  14. * Closes the dialog.
  15. */
  16. onClose: Function,
  17. /**
  18. * Handler used on hangup click.
  19. */
  20. onHangup: Function,
  21. /**
  22. * The status of the call.
  23. */
  24. status: string,
  25. /**
  26. * Used for translation.
  27. */
  28. t: Function,
  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)}px 0 ${theme.spacing(3)}px 0`
  41. },
  42. '& .prejoin-dialog-calling-number': {
  43. fontSize: '19px',
  44. lineHeight: '28px',
  45. margin: `${theme.spacing(3)}px 0`
  46. }
  47. }
  48. };
  49. });
  50. /**
  51. * Dialog displayed when the user gets called by the meeting.
  52. *
  53. * @param {Props} props - The props of the component.
  54. * @returns {ReactElement}
  55. */
  56. function CallingDialog(props: Props) {
  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 = { IconClose } />
  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);