Skip to content

Commit

Permalink
Merge pull request #20671 from Skalakid/20600-migrate-AttachmentView
Browse files Browse the repository at this point in the history
20600 - migrated AttachmentView to PressableWithoutFeedback
  • Loading branch information
roryabraham authored Jun 14, 2023
2 parents f467085 + 655c630 commit 65c0fd7
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/components/AttachmentView.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, {memo, useState} from 'react';
import {View, ActivityIndicator, Pressable} from 'react-native';
import {View, ActivityIndicator} from 'react-native';
import _ from 'underscore';
import PropTypes from 'prop-types';
import Str from 'expensify-common/lib/str';
Expand All @@ -15,6 +15,7 @@ import Tooltip from './Tooltip';
import themeColors from '../styles/themes/default';
import variables from '../styles/variables';
import addEncryptedAuthTokenToURL from '../libs/addEncryptedAuthTokenToURL';
import PressableWithoutFeedback from './Pressable/PressableWithoutFeedback';

const propTypes = {
/** Whether source url requires authentication */
Expand Down Expand Up @@ -93,13 +94,15 @@ function AttachmentView(props) {
/>
);
return props.onPress ? (
<Pressable
<PressableWithoutFeedback
onPress={props.onPress}
disabled={loadComplete}
style={containerStyles}
accessibilityRole="imagebutton"
accessibilityLabel={props.file.name || props.translate('attachmentView.unknownFilename')}
>
{children}
</Pressable>
</PressableWithoutFeedback>
) : (
children
);
Expand All @@ -117,13 +120,15 @@ function AttachmentView(props) {
/>
);
return props.onPress ? (
<Pressable
<PressableWithoutFeedback
onPress={props.onPress}
disabled={loadComplete}
style={containerStyles}
accessibilityRole="imagebutton"
accessibilityLabel={props.file.name || props.translate('attachmentView.unknownFilename')}
>
{children}
</Pressable>
</PressableWithoutFeedback>
) : (
children
);
Expand Down

0 comments on commit 65c0fd7

Please sign in to comment.