diff --git a/src/components/AttachmentModal.js b/src/components/AttachmentModal.js index 2568e634e884..1d942eaf51f4 100755 --- a/src/components/AttachmentModal.js +++ b/src/components/AttachmentModal.js @@ -25,9 +25,6 @@ import TextWithEllipsis from './TextWithEllipsis'; */ const propTypes = { - /** Determines title of the modal header depending on if we are uploading an attachment or not */ - isUploadingAttachment: PropTypes.bool, - /** Optional source URL for the image shown. If not passed in via props must be specified when modal is opened. */ sourceURL: PropTypes.string, @@ -46,17 +43,24 @@ const propTypes = { /** Do the urls require an authToken? */ isAuthTokenRequired: PropTypes.bool, + /** Determines if download Button should be shown or not */ + allowDownload: PropTypes.bool, + + /** Title shown in the header of the modal */ + headerTitle: PropTypes.string, + ...withLocalizePropTypes, ...windowDimensionsPropTypes, }; const defaultProps = { - isUploadingAttachment: false, sourceURL: null, onConfirm: null, originalFileName: null, isAuthTokenRequired: false, + allowDownload: false, + headerTitle: null, onModalHide: () => {}, }; @@ -145,6 +149,7 @@ class AttachmentModal extends PureComponent { : [styles.imageModalImageCenterContainer, styles.p5]; const {fileName, fileExtension} = this.splitExtensionFromFileName(); + return ( <> fileDownload(sourceURL, this.props.originalFileName)} onCloseButtonPress={() => this.setState({isModalOpen: false})} - subtitle={( + subtitle={fileName ? ( - )} + ) : ''} /> {this.state.sourceURL && ( diff --git a/src/components/HTMLEngineProvider/HTMLRenderers/ImageRenderer.js b/src/components/HTMLEngineProvider/HTMLRenderers/ImageRenderer.js index 49e2e72829d4..96fd95cc5224 100644 --- a/src/components/HTMLEngineProvider/HTMLRenderers/ImageRenderer.js +++ b/src/components/HTMLEngineProvider/HTMLRenderers/ImageRenderer.js @@ -46,6 +46,7 @@ const ImageRenderer = (props) => { return ( { {details ? ( - + + {({show}) => ( + + + + )} + {details.displayName && ( {isSMSLogin ? props.toLocalPhone(details.displayName) : details.displayName} diff --git a/src/pages/home/report/ReportActionCompose.js b/src/pages/home/report/ReportActionCompose.js index 6517fef5d24a..1585dee9ac97 100755 --- a/src/pages/home/report/ReportActionCompose.js +++ b/src/pages/home/report/ReportActionCompose.js @@ -414,7 +414,7 @@ class ReportActionCompose extends React.Component { ]} > { this.submitForm(); Report.addAction(this.props.reportID, '', file);