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.

DialInLink.js 1.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. // @flow
  2. import React, { Component } from 'react';
  3. import { translate } from '../../base/i18n';
  4. import { connect } from '../../base/redux';
  5. import { getDialInfoPageURL, shouldDisplayDialIn } from '../../invite';
  6. /**
  7. * The type of the React {@code Component} props of {@link DialInLink}.
  8. */
  9. type Props = {
  10. /**
  11. * The redux state representing the dial-in numbers feature.
  12. */
  13. _dialIn: Object,
  14. /**
  15. * The url of the page containing the dial-in numbers list.
  16. */
  17. _dialInfoPageUrl: string,
  18. /**
  19. * Invoked to obtain translated strings.
  20. */
  21. t: Function
  22. };
  23. /**
  24. * React {@code Component} responsible for displaying a telephone number and
  25. * conference ID for dialing into a conference.
  26. *
  27. * @extends Component
  28. */
  29. class DialInLink extends Component<Props> {
  30. /**
  31. * Implements React's {@link Component#render()}.
  32. *
  33. * @inheritdoc
  34. * @returns {ReactElement}
  35. */
  36. render() {
  37. const { _dialIn, _dialInfoPageUrl, t } = this.props;
  38. if (!shouldDisplayDialIn(_dialIn)) {
  39. return null;
  40. }
  41. return (
  42. <div>{t('toolbar.noAudioSignalDialInDesc')}&nbsp;
  43. <a
  44. href = { _dialInfoPageUrl }
  45. rel = 'noopener noreferrer'
  46. target = '_blank'>
  47. {t('toolbar.noAudioSignalDialInLinkDesc')}
  48. </a>
  49. </div>
  50. );
  51. }
  52. }
  53. /**
  54. * Maps (parts of) the Redux state to the associated props for the
  55. * {@code DialInLink} component.
  56. *
  57. * @param {Object} state - The Redux state.
  58. * @private
  59. * @returns {Props}
  60. */
  61. function _mapStateToProps(state) {
  62. return {
  63. _dialIn: state['features/invite'],
  64. _dialInfoPageUrl: getDialInfoPageURL(state)
  65. };
  66. }
  67. export default translate(connect(_mapStateToProps)(DialInLink));