Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

DialInLink.js 2.2KB

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