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.

SharedVideoDialog.js 1.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. // @flow
  2. import React from 'react';
  3. import { InputDialog } from '../../../base/dialog';
  4. import { translate } from '../../../base/i18n';
  5. import { connect } from '../../../base/redux';
  6. import { ColorPalette } from '../../../base/styles';
  7. import AbstractSharedVideoDialog from '../AbstractSharedVideoDialog';
  8. /**
  9. * Implements a component to render a display name prompt.
  10. */
  11. class SharedVideoDialog extends AbstractSharedVideoDialog<*> {
  12. /**
  13. * Instantiates a new component.
  14. *
  15. * @inheritdoc
  16. */
  17. constructor(props) {
  18. super(props);
  19. this._onSubmitValue = this._onSubmitValue.bind(this);
  20. }
  21. _onSubmitValue: () => boolean;
  22. /**
  23. * Callback to be invoked when the value of the link input is submitted.
  24. *
  25. * @param {string} value - The entered video link.
  26. * @returns {boolean}
  27. */
  28. _onSubmitValue(value) {
  29. return super._onSetVideoLink(value);
  30. }
  31. /**
  32. * Implements React's {@link Component#render()}.
  33. *
  34. * @inheritdoc
  35. */
  36. render() {
  37. const { t } = this.props;
  38. return (
  39. <InputDialog
  40. contentKey = 'dialog.shareVideoTitle'
  41. onSubmit = { this._onSubmitValue }
  42. textInputProps = {{
  43. autoCapitalize: 'none',
  44. autoCorrect: false,
  45. placeholder: t('dialog.sharedVideoLinkPlaceholder'),
  46. placeholderTextColor: ColorPalette.lightGrey
  47. }} />
  48. );
  49. }
  50. }
  51. export default translate(connect()(SharedVideoDialog));