Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/components/AttachmentView.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ const AttachmentView = (props) => {
<ImageView
onScaleChanged={props.onScaleChanged}
url={props.source}
fileName={props.file.name}
isAuthTokenRequired={isImage && props.isAuthTokenRequired}
/>
);
Expand Down
13 changes: 10 additions & 3 deletions src/components/ImageView/index.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import React, {PureComponent} from 'react';
import PropTypes from 'prop-types';
import {View, Pressable} from 'react-native';
import {View} from 'react-native';
import Image from '../Image';
import styles from '../../styles/styles';
import * as StyleUtils from '../../styles/StyleUtils';
import * as DeviceCapabilities from '../../libs/DeviceCapabilities';
import withWindowDimensions, {windowDimensionsPropTypes} from '../withWindowDimensions';
import FullscreenLoadingIndicator from '../FullscreenLoadingIndicator';
import PressableWithoutFeedback from '../Pressable/PressableWithoutFeedback';

const propTypes = {
/** Whether source url requires authentication */
Expand All @@ -18,6 +19,10 @@ const propTypes = {

/** URL to full-sized image */
url: PropTypes.string.isRequired,

/** image file name */
fileName: PropTypes.string.isRequired,

...windowDimensionsPropTypes,
};

Expand Down Expand Up @@ -266,7 +271,7 @@ class ImageView extends PureComponent {
onLayout={this.onContainerLayoutChanged}
style={[styles.imageViewContainer, styles.overflowAuto, styles.pRelative]}
>
<Pressable
<PressableWithoutFeedback
style={{
...StyleUtils.getZoomSizingStyle(
this.state.isZoomed,
Expand All @@ -283,6 +288,8 @@ class ImageView extends PureComponent {
}}
onPressIn={this.onContainerPressIn}
onPress={this.onContainerPress}
accessibilityRole="image"
accessibilityLabel={this.props.fileName}
>
<Image
source={{uri: this.props.url}}
Expand All @@ -292,7 +299,7 @@ class ImageView extends PureComponent {
onLoadStart={this.imageLoadingStart}
onLoad={this.imageLoad}
/>
</Pressable>
</PressableWithoutFeedback>

{this.state.isLoading && <FullscreenLoadingIndicator style={[styles.opacity1, styles.bgTransparent]} />}
</View>
Expand Down