Blocked/unapproved convos: no clickable link preview images
This commit is contained in:
parent
30d1b29021
commit
38b921fad7
2 changed files with 15 additions and 12 deletions
|
@ -784,7 +784,8 @@ $message-padding-horizontal: 12px;
|
|||
|
||||
&--nonclickable {
|
||||
cursor: inherit;
|
||||
.module-image__image {
|
||||
.module-image__image,
|
||||
.module-image__border-overlay--with-click-handler {
|
||||
cursor: inherit;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,7 +6,7 @@ import React from 'react';
|
|||
import { createPortal } from 'react-dom';
|
||||
import classNames from 'classnames';
|
||||
import getDirection from 'direction';
|
||||
import { drop, groupBy, orderBy, take, unescape } from 'lodash';
|
||||
import { drop, groupBy, noop, orderBy, take, unescape } from 'lodash';
|
||||
import { Manager, Popper, Reference } from 'react-popper';
|
||||
import type { PreventOverflowModifier } from '@popperjs/core/lib/modifiers/preventOverflow';
|
||||
|
||||
|
@ -1118,16 +1118,18 @@ export class Message extends React.PureComponent<Props, State> {
|
|||
'module-message__link-preview--nonclickable': !isClickable,
|
||||
}
|
||||
);
|
||||
const onPreviewImageClick = () => {
|
||||
if (first.image && !isDownloaded(first.image)) {
|
||||
kickOffAttachmentDownload({
|
||||
attachment: first.image,
|
||||
messageId: id,
|
||||
});
|
||||
return;
|
||||
}
|
||||
openLink(first.url);
|
||||
};
|
||||
const onPreviewImageClick = isClickable
|
||||
? () => {
|
||||
if (first.image && !isDownloaded(first.image)) {
|
||||
kickOffAttachmentDownload({
|
||||
attachment: first.image,
|
||||
messageId: id,
|
||||
});
|
||||
return;
|
||||
}
|
||||
openLink(first.url);
|
||||
}
|
||||
: noop;
|
||||
const contents = (
|
||||
<>
|
||||
{first.image && previewHasImage && isFullSizeImage ? (
|
||||
|
|
Loading…
Reference in a new issue