您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

DeleteItemButton.native.ts 988B

12345678910111213141516171819202122232425262728293031323334353637
  1. import { connect } from 'react-redux';
  2. import { translate } from '../../base/i18n/functions';
  3. import { IconTrash } from '../../base/icons/svg';
  4. import AbstractButton, { IProps as AbstractButtonProps } from '../../base/toolbox/components/AbstractButton';
  5. import { deleteRecentListEntry } from '../actions';
  6. export interface IProps extends AbstractButtonProps {
  7. /**
  8. * The ID of the entry to be deleted.
  9. */
  10. itemId: Object;
  11. }
  12. /**
  13. * A recent list menu button which deletes the selected entry.
  14. */
  15. class DeleteItemButton extends AbstractButton<IProps> {
  16. accessibilityLabel = 'welcomepage.recentListDelete';
  17. icon = IconTrash;
  18. label = 'welcomepage.recentListDelete';
  19. /**
  20. * Handles clicking / pressing the button.
  21. *
  22. * @private
  23. * @returns {void}
  24. */
  25. _handleClick() {
  26. const { dispatch, itemId } = this.props;
  27. dispatch(deleteRecentListEntry(itemId));
  28. }
  29. }
  30. export default translate(connect()(DeleteItemButton));