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.

FeedbackButton.web.js 1017B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /* @flow */
  2. import React, { Component } from 'react';
  3. declare var config: Object;
  4. /**
  5. * Implements a Web/React Component which renders a feedback button.
  6. */
  7. export class FeedbackButton extends Component {
  8. state = {
  9. callStatsID: String
  10. };
  11. /**
  12. * Initializes a new FeedbackButton instance.
  13. *
  14. * @param {Object} props - The read-only properties with which the new
  15. * instance is to be initialized.
  16. */
  17. constructor(props: Object) {
  18. super(props);
  19. this.state = {
  20. callStatsID: config.callStatsID
  21. };
  22. }
  23. /**
  24. * Implements React's {@link Component#render()}.
  25. *
  26. * @inheritdoc
  27. * @returns {ReactElement}
  28. */
  29. render() {
  30. // If callstats.io-support is not configured, skip rendering.
  31. if (!this.state.callStatsID) {
  32. return null;
  33. }
  34. return (
  35. <a
  36. className = 'button icon-feedback'
  37. id = 'feedbackButton' />
  38. );
  39. }
  40. }