選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

CallingDialog.tsx 2.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. /* eslint-disable lines-around-comment */
  2. import { makeStyles } from '@material-ui/styles';
  3. import React from 'react';
  4. import { WithTranslation } from 'react-i18next';
  5. // @ts-ignore
  6. import { Avatar } from '../../../base/avatar';
  7. import { translate } from '../../../base/i18n/functions';
  8. import Icon from '../../../base/icons/components/Icon';
  9. import { IconClose } from '../../../base/icons/svg';
  10. // @ts-ignore
  11. import Label from '../Label';
  12. interface Props 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: any) => {
  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);