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.

DialInSection.js 2.1KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. // @flow
  2. import React from 'react';
  3. import { translate } from '../../../../base/i18n';
  4. import { connect } from '../../../../base/redux';
  5. import { getDialInfoPageURL, hasMultipleNumbers } from '../../../functions';
  6. import DialInNumber from './DialInNumber';
  7. type Props = {
  8. /**
  9. * The numeric identifier for the current conference, used after dialing a
  10. * the number to join the conference.
  11. */
  12. _conferenceID: number,
  13. /**
  14. * The url of the page containing the dial-in numbers list.
  15. */
  16. _dialInfoPageUrl: string,
  17. /**
  18. * If multiple dial-in numbers are available
  19. */
  20. _hasMultipleNumbers: boolean;
  21. /**
  22. * The phone number to dial to begin the process of dialing into a
  23. * conference.
  24. */
  25. phoneNumber: string,
  26. /**
  27. * Invoked to obtain translated strings.
  28. */
  29. t: Function
  30. };
  31. /**
  32. * Returns a ReactElement for showing how to dial into the conference, if
  33. * dialing in is available.
  34. *
  35. * @private
  36. * @returns {null|ReactElement}
  37. */
  38. function DialInSection({
  39. _conferenceID,
  40. _dialInfoPageUrl,
  41. _hasMultipleNumbers,
  42. phoneNumber,
  43. t
  44. }: Props) {
  45. return (
  46. <div className = 'invite-more-dialog dial-in-display'>
  47. <DialInNumber
  48. conferenceID = { _conferenceID }
  49. phoneNumber = { phoneNumber } />
  50. {_hasMultipleNumbers ? <a
  51. className = 'more-numbers'
  52. href = { _dialInfoPageUrl }
  53. rel = 'noopener noreferrer'
  54. target = '_blank'>
  55. { t('info.moreNumbers') }
  56. </a> : null}
  57. </div>
  58. );
  59. }
  60. /**
  61. * Maps (parts of) the Redux state to the associated props for the
  62. * {@code DialInLink} component.
  63. *
  64. * @param {Object} state - The Redux state.
  65. * @private
  66. * @returns {Props}
  67. */
  68. function _mapStateToProps(state) {
  69. const dialIn = state['features/invite'];
  70. return {
  71. _conferenceID: dialIn.conferenceID,
  72. _dialInfoPageUrl: getDialInfoPageURL(state),
  73. _hasMultipleNumbers: hasMultipleNumbers(dialIn.numbers)
  74. };
  75. }
  76. export default translate(connect(_mapStateToProps)(DialInSection));