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.

DialInDialog.js 3.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. // @flow
  2. import React from 'react';
  3. import { translate } from '../../../base/i18n';
  4. import { Icon, IconArrowLeft } from '../../../base/icons';
  5. import { getCountryCodeFromPhone } from '../../utils';
  6. import ActionButton from '../buttons/ActionButton';
  7. import Label from '../Label';
  8. type Props = {
  9. /**
  10. * The number to call in order to join the conference.
  11. */
  12. number: string,
  13. /**
  14. * Handler used when clicking the back button.
  15. */
  16. onBack: Function,
  17. /**
  18. * Click handler for the text button.
  19. */
  20. onTextButtonClick: Function,
  21. /**
  22. * Click handler for primary button.
  23. */
  24. onPrimaryButtonClick: Function,
  25. /**
  26. * Click handler for the small additional text.
  27. */
  28. onSmallTextClick: Function,
  29. /**
  30. * The passCode of the conference.
  31. */
  32. passCode: string,
  33. /**
  34. * Used for translation.
  35. */
  36. t: Function,
  37. };
  38. /**
  39. * This component displays the dialog whith all the information
  40. * to join a meeting by calling it.
  41. *
  42. * @param {Props} props - The props of the component.
  43. * @returns {React$Element}
  44. */
  45. function DialinDialog(props: Props) {
  46. const {
  47. number,
  48. onBack,
  49. onPrimaryButtonClick,
  50. onSmallTextClick,
  51. onTextButtonClick,
  52. passCode,
  53. t
  54. } = props;
  55. const flagClassName = `prejoin-dialog-flag iti-flag ${getCountryCodeFromPhone(
  56. number,
  57. )}`;
  58. return (
  59. <div className = 'prejoin-dialog-dialin'>
  60. <div className = 'prejoin-dialog-dialin-header'>
  61. <Icon
  62. className = 'prejoin-dialog-icon prejoin-dialog-dialin-icon'
  63. onClick = { onBack }
  64. size = { 24 }
  65. src = { IconArrowLeft } />
  66. <div className = 'prejoin-dialog-title'>
  67. {t('prejoin.dialInMeeting')}
  68. </div>
  69. </div>
  70. <Label number = { 1 }>{ t('prejoin.dialInPin') }</Label>
  71. <div className = 'prejoin-dialog-dialin-num-container'>
  72. <div className = 'prejoin-dialog-dialin-num'>
  73. <div className = { flagClassName } />
  74. <span>{number}</span>
  75. </div>
  76. <div className = 'prejoin-dialog-dialin-num'>{passCode}</div>
  77. </div>
  78. <div>
  79. <span
  80. className = 'prejoin-dialog-dialin-link'
  81. onClick = { onSmallTextClick }>
  82. {t('prejoin.viewAllNumbers')}
  83. </span>
  84. </div>
  85. <div className = 'prejoin-dialog-delimiter' />
  86. <Label
  87. className = 'prejoin-dialog-dialin-spaced-label'
  88. number = { 2 }>
  89. {t('prejoin.connectedWithAudioQ')}
  90. </Label>
  91. <div className = 'prejoin-dialog-dialin-btns'>
  92. <ActionButton
  93. className = 'prejoin-dialog-btn'
  94. onClick = { onPrimaryButtonClick }
  95. type = 'primary'>
  96. {t('prejoin.joinMeeting')}
  97. </ActionButton>
  98. <ActionButton
  99. className = 'prejoin-dialog-btn'
  100. onClick = { onTextButtonClick }
  101. type = 'text'>
  102. {t('dialog.Cancel')}
  103. </ActionButton>
  104. </div>
  105. </div>
  106. );
  107. }
  108. export default translate(DialinDialog);