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.

AbstractDisableLobbyModeDialog.js 975B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. // @flow
  2. import { PureComponent } from 'react';
  3. import { toggleLobbyMode } from '../actions';
  4. export type Props = {
  5. /**
  6. * The Redux Dispatch function.
  7. */
  8. dispatch: Function,
  9. /**
  10. * Function to be used to translate i18n labels.
  11. */
  12. t: Function
  13. };
  14. /**
  15. * Abstract class to encapsulate the platform common code of the {@code DisableLobbyModeDialog}.
  16. */
  17. export default class AbstractDisableLobbyModeDialog<P: Props = Props> extends PureComponent<P> {
  18. /**
  19. * Instantiates a new component.
  20. *
  21. * @inheritdoc
  22. */
  23. constructor(props: P) {
  24. super(props);
  25. this._onDisableLobbyMode = this._onDisableLobbyMode.bind(this);
  26. }
  27. _onDisableLobbyMode: () => void;
  28. /**
  29. * Callback to be invoked when the user initiates the lobby mode disable flow.
  30. *
  31. * @returns {void}
  32. */
  33. _onDisableLobbyMode() {
  34. this.props.dispatch(toggleLobbyMode(false));
  35. return true;
  36. }
  37. }