Skip to content

Commit

Permalink
Fix links to the 'general' attachments
Browse files Browse the repository at this point in the history
  • Loading branch information
davidmz committed Jan 31, 2025
1 parent 8cc5f93 commit 87ca1c3
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/components/post/post-attachment-general.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { faTimes } from '@fortawesome/free-solid-svg-icons';

import { formatFileSize } from '../../utils';
import { Icon } from '../fontawesome-icons';
import { attachmentPreviewUrl } from '../../services/api';

class GeneralAttachment extends PureComponent {
handleClickOnRemoveAttachment = () => {
Expand All @@ -28,7 +29,12 @@ class GeneralAttachment extends PureComponent {

return (
<div className="attachment" role="figure" aria-label={`Attachment ${nameAndSize}`}>
<a href={props.url} title={nameAndSize} target="_blank">
<a
href={attachmentPreviewUrl(props.id, 'original')}
onClick={this.handleClick}
title={nameAndSize}
target="_blank"
>
<Icon icon={faFile} className="attachment-icon" />
<span className="attachment-title">{nameAndSize}</span>
</a>
Expand Down

0 comments on commit 87ca1c3

Please sign in to comment.