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

DialInDialog.tsx 5.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  1. /* eslint-disable lines-around-comment */
  2. import { Theme } from '@mui/material';
  3. import React from 'react';
  4. import { WithTranslation } from 'react-i18next';
  5. import { makeStyles } from 'tss-react/mui';
  6. import { translate } from '../../../base/i18n/functions';
  7. import Icon from '../../../base/icons/components/Icon';
  8. import { IconArrowLeft } from '../../../base/icons/svg';
  9. // @ts-ignore
  10. import { ActionButton } from '../../../base/premeeting';
  11. // @ts-ignore
  12. import { getCountryCodeFromPhone } from '../../utils';
  13. // @ts-ignore
  14. import Label from '../Label';
  15. interface Props extends WithTranslation {
  16. /**
  17. * The number to call in order to join the conference.
  18. */
  19. number: string;
  20. /**
  21. * Handler used when clicking the back button.
  22. */
  23. onBack: Function;
  24. /**
  25. * Click handler for primary button.
  26. */
  27. onPrimaryButtonClick: Function;
  28. /**
  29. * Click handler for the small additional text.
  30. */
  31. onSmallTextClick: (e?: React.MouseEvent) => void;
  32. /**
  33. * Click handler for the text button.
  34. */
  35. onTextButtonClick: (e?: React.MouseEvent) => void;
  36. /**
  37. * The passCode of the conference.
  38. */
  39. passCode: string;
  40. }
  41. const useStyles = makeStyles()((theme: Theme) => {
  42. return {
  43. dialInDialog: {
  44. textAlign: 'center',
  45. '& .prejoin-dialog-dialin-header': {
  46. alignItems: 'center',
  47. margin: `${theme.spacing(3)} 0 ${theme.spacing(5)} ${theme.spacing(3)}`,
  48. display: 'flex'
  49. },
  50. '& .prejoin-dialog-dialin-icon': {
  51. marginRight: theme.spacing(3)
  52. },
  53. '& .prejoin-dialog-dialin-num': {
  54. background: '#3e474f',
  55. borderRadius: '4px',
  56. display: 'inline-block',
  57. fontSize: '15px',
  58. lineHeight: '24px',
  59. margin: theme.spacing(1),
  60. padding: theme.spacing(2),
  61. '& .prejoin-dialog-dialin-num-container': {
  62. minHeight: '48px',
  63. margin: `${theme.spacing(2)} 0`
  64. }
  65. },
  66. '& .prejoin-dialog-dialin-link': {
  67. color: '#6FB1EA',
  68. cursor: 'pointer',
  69. display: 'inline-block',
  70. fontSize: '13px',
  71. lineHeight: '20px',
  72. marginBottom: theme.spacing(4)
  73. },
  74. '& .prejoin-dialog-dialin-spaced-label': {
  75. marginBottom: theme.spacing(3),
  76. marginTop: '28px'
  77. },
  78. '& .prejoin-dialog-dialin-btns > div': {
  79. marginBottom: theme.spacing(3)
  80. }
  81. }
  82. };
  83. });
  84. /**
  85. * This component displays the dialog with all the information
  86. * to join a meeting by calling it.
  87. *
  88. * @param {Props} props - The props of the component.
  89. * @returns {React$Element}
  90. */
  91. function DialinDialog(props: Props) {
  92. const {
  93. number,
  94. onBack,
  95. onPrimaryButtonClick,
  96. onSmallTextClick,
  97. onTextButtonClick,
  98. passCode,
  99. t
  100. } = props;
  101. const { classes } = useStyles();
  102. const flagClassName = `prejoin-dialog-flag iti-flag ${getCountryCodeFromPhone(
  103. number
  104. )}`;
  105. return (
  106. <div className = { classes.dialInDialog }>
  107. <div className = 'prejoin-dialog-dialin-header'>
  108. <Icon
  109. className = 'prejoin-dialog-icon prejoin-dialog-dialin-icon'
  110. onClick = { onBack }
  111. role = 'button'
  112. size = { 24 }
  113. src = { IconArrowLeft } />
  114. <div className = 'prejoin-dialog-title'>
  115. {t('prejoin.dialInMeeting')}
  116. </div>
  117. </div>
  118. <Label number = { 1 }>{ t('prejoin.dialInPin') }</Label>
  119. <div className = 'prejoin-dialog-dialin-num-container'>
  120. <div className = 'prejoin-dialog-dialin-num'>
  121. <div className = { flagClassName } />
  122. <span>{number}</span>
  123. </div>
  124. <div className = 'prejoin-dialog-dialin-num'>{passCode}</div>
  125. </div>
  126. <div>
  127. <span
  128. className = 'prejoin-dialog-dialin-link'
  129. onClick = { onSmallTextClick }>
  130. {t('prejoin.viewAllNumbers')}
  131. </span>
  132. </div>
  133. <div className = 'prejoin-dialog-delimiter' />
  134. <Label
  135. className = 'prejoin-dialog-dialin-spaced-label'
  136. number = { 2 }>
  137. {t('prejoin.connectedWithAudioQ')}
  138. </Label>
  139. <div className = 'prejoin-dialog-dialin-btns'>
  140. <ActionButton
  141. className = 'prejoin-dialog-btn'
  142. onClick = { onPrimaryButtonClick }
  143. type = 'primary'>
  144. {t('prejoin.joinMeeting')}
  145. </ActionButton>
  146. <ActionButton
  147. className = 'prejoin-dialog-btn'
  148. onClick = { onTextButtonClick }
  149. type = 'text'>
  150. {t('dialog.Cancel')}
  151. </ActionButton>
  152. </div>
  153. </div>
  154. );
  155. }
  156. export default translate(DialinDialog);