Skip to content

Commit

Permalink
Merge pull request #20176 from Skalakid/17044-migrate-BaseAnchorForAt…
Browse files Browse the repository at this point in the history
…tachmentsOnly

17044 - migrated BaseAnchorForAttachmentsOnly to PressableWithoutFeedback
  • Loading branch information
stitesExpensify committed Jun 7, 2023
2 parents 7d33fb5 + 392ba31 commit 3bccc71
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React from 'react';
import {Pressable} from 'react-native';
import {withOnyx} from 'react-native-onyx';
import PropTypes from 'prop-types';
import {propTypes as anchorForAttachmentsOnlyPropTypes, defaultProps as anchorForAttachmentsOnlyDefaultProps} from './anchorForAttachmentsOnlyPropTypes';
Expand All @@ -11,6 +10,7 @@ import fileDownload from '../../libs/fileDownload';
import addEncryptedAuthTokenToURL from '../../libs/addEncryptedAuthTokenToURL';
import {ShowContextMenuContext, showContextMenuForReport} from '../ShowContextMenuContext';
import * as ReportUtils from '../../libs/ReportUtils';
import PressableWithoutFeedback from '../Pressable/PressableWithoutFeedback';

const propTypes = {
/** Press in handler for the link */
Expand Down Expand Up @@ -45,7 +45,7 @@ const BaseAnchorForAttachmentsOnly = (props) => {
return (
<ShowContextMenuContext.Consumer>
{({anchor, report, action, checkIfContextMenuActive}) => (
<Pressable
<PressableWithoutFeedback
style={props.style}
onPress={() => {
if (isDownloading) {
Expand All @@ -57,14 +57,16 @@ const BaseAnchorForAttachmentsOnly = (props) => {
onPressIn={props.onPressIn}
onPressOut={props.onPressOut}
onLongPress={(event) => showContextMenuForReport(event, anchor, report.reportID, action, checkIfContextMenuActive, ReportUtils.isArchivedRoom(report))}
accessibilityLabel={fileName}
accessibilityRole="button"
>
<AttachmentView
source={sourceURLWithAuth}
file={{name: fileName}}
shouldShowDownloadIcon
shouldShowLoadingSpinnerIcon={isDownloading}
/>
</Pressable>
</PressableWithoutFeedback>
)}
</ShowContextMenuContext.Consumer>
);
Expand Down

0 comments on commit 3bccc71

Please sign in to comment.