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.

ChatPrivacyDialog.js 1.3KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /* @flow */
  2. import React from 'react';
  3. import { Dialog } from '../../../base/dialog';
  4. import { translate } from '../../../base/i18n';
  5. import { connect } from '../../../base/redux';
  6. import { AbstractChatPrivacyDialog, _mapDispatchToProps, _mapStateToProps } from '../AbstractChatPrivacyDialog';
  7. /**
  8. * Implements a component for the dialog displayed to avoid mis-sending private messages.
  9. */
  10. class ChatPrivacyDialog extends AbstractChatPrivacyDialog {
  11. /**
  12. * Implements React's {@link Component#render()}.
  13. *
  14. * @inheritdoc
  15. * @returns {ReactElement}
  16. */
  17. render() {
  18. return (
  19. <Dialog
  20. cancelKey = 'dialog.sendPrivateMessageCancel'
  21. okKey = 'dialog.sendPrivateMessageOk'
  22. onCancel = { this._onSendGroupMessage }
  23. onSubmit = { this._onSendPrivateMessage }
  24. titleKey = 'dialog.sendPrivateMessageTitle'
  25. width = 'small'>
  26. <div>
  27. { this.props.t('dialog.sendPrivateMessage') }
  28. </div>
  29. </Dialog>
  30. );
  31. }
  32. _onSendGroupMessage: () => boolean;
  33. _onSendPrivateMessage: () => boolean;
  34. }
  35. export default translate(connect(_mapStateToProps, _mapDispatchToProps)(ChatPrivacyDialog));