Files
jitsi-meet/react/features/recent-list/components/DeleteItemButton.native.js
Saúl Ibarra Corretgé 63fe1de789 rn,recent-list: replace swipe options with long-press sheet
This change serves 2 purposes:

- (Hopefully) make the recent list entry options easier to discover
- Remove the (now unmaintained) swipeout dependency
2020-10-08 10:17:53 +02:00

49 lines
1.1 KiB
JavaScript

// @flow
import { translate } from '../../base/i18n';
import { IconTrash } from '../../base/icons';
import { connect } from '../../base/redux';
import { AbstractButton, type AbstractButtonProps } from '../../base/toolbox/components';
import { deleteRecentListEntry } from '../actions';
export type Props = AbstractButtonProps & {
/**
* The redux {@code dispatch} function.
*/
dispatch: Function,
/**
* The ID of the entry to be deleted.
*/
itemId: Object,
/**
* The function to be used to translate i18n labels.
*/
t: Function
};
/**
* A recent list menu button which deletes the selected entry.
*/
class DeleteItemButton extends AbstractButton<Props, *> {
accessibilityLabel = 'welcomepage.recentListDelete';
icon = IconTrash;
label = 'welcomepage.recentListDelete';
/**
* Handles clicking / pressing the button.
*
* @private
* @returns {void}
*/
_handleClick() {
const { dispatch, itemId } = this.props;
dispatch(deleteRecentListEntry(itemId));
}
}
export default translate(connect()(DeleteItemButton));