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.

PremiumFeatureDialog.js 1.4KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. // @flow
  2. import React, { PureComponent } from 'react';
  3. import { Dialog } from '../../../base/dialog';
  4. import { translate } from '../../../base/i18n';
  5. import { openURLInBrowser } from '../../../base/util';
  6. import { JAAS_UPGRADE_URL } from '../../constants';
  7. /**
  8. * Component that renders the premium feature dialog.
  9. *
  10. * @returns {React$Element<any>}
  11. */
  12. class PremiumFeatureDialog extends PureComponent<*> {
  13. /**
  14. * Instantiates a new component.
  15. *
  16. * @inheritdoc
  17. */
  18. constructor(props) {
  19. super(props);
  20. this._onSubmitValue = this._onSubmitValue.bind(this);
  21. }
  22. _onSubmitValue: () => void;
  23. /**
  24. * Callback to be invoked when the dialog ok is pressed.
  25. *
  26. * @returns {boolean}
  27. */
  28. _onSubmitValue() {
  29. openURLInBrowser(JAAS_UPGRADE_URL, true);
  30. }
  31. /**
  32. * Implements React's {@link Component#render()}.
  33. *
  34. * @inheritdoc
  35. */
  36. render() {
  37. const { t } = this.props;
  38. return (
  39. <Dialog
  40. hideCancelButton = { true }
  41. okKey = { t('dialog.viewUpgradeOptions') }
  42. onSubmit = { this._onSubmitValue }
  43. titleKey = { t('dialog.viewUpgradeOptionsTitle') }
  44. width = { 'small' }>
  45. <span>{t('dialog.viewUpgradeOptionsContent')}</span>
  46. </Dialog>
  47. );
  48. }
  49. }
  50. export default translate(PremiumFeatureDialog);