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.

HangupButton.native.js 1.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. // @flow
  2. import PropTypes from 'prop-types';
  3. import React from 'react';
  4. import { connect } from 'react-redux';
  5. import { appNavigate } from '../../../app';
  6. import { ColorPalette } from '../../../base/styles';
  7. import AbstractHangupButton from './AbstractHangupButton';
  8. import ToolbarButton from '../ToolbarButton';
  9. import styles from '../styles';
  10. /**
  11. * Component that renders a toolbar button for leaving the current conference.
  12. *
  13. * @extends Component
  14. */
  15. class HangupButton extends AbstractHangupButton {
  16. /**
  17. * {@code HangupButton} component's property types.
  18. *
  19. * @static
  20. */
  21. static propTypes = {
  22. /**
  23. * Invoked to leave the conference.
  24. */
  25. dispatch: PropTypes.func
  26. };
  27. /**
  28. * Implements React's {@link Component#render()}.
  29. *
  30. * @inheritdoc
  31. * @returns {ReactElement}
  32. */
  33. render() {
  34. return (
  35. <ToolbarButton
  36. accessibilityLabel = 'Hangup'
  37. iconName = 'hangup'
  38. iconStyle = { styles.whitePrimaryToolbarButtonIcon }
  39. onClick = { this._onToolbarHangup }
  40. style = { styles.hangup }
  41. underlayColor = { ColorPalette.buttonUnderlay } />
  42. );
  43. }
  44. /**
  45. * Dispatches an action for leaving the current conference.
  46. *
  47. * @private
  48. * @returns {void}
  49. */
  50. _doHangup() {
  51. this.props.dispatch(appNavigate(undefined));
  52. }
  53. _onToolbarHangup: () => void;
  54. }
  55. export default connect()(HangupButton);