Make more images non-draggable (#3881)
This commit is contained in:
parent
1dd37c3c64
commit
7b3e257a11
@ -54,13 +54,14 @@ function AnimatedIconWithPreview(props: OwnProps) {
|
|||||||
>
|
>
|
||||||
{thumbDataUri && !isAnimationReady && (
|
{thumbDataUri && !isAnimationReady && (
|
||||||
// eslint-disable-next-line jsx-a11y/alt-text
|
// eslint-disable-next-line jsx-a11y/alt-text
|
||||||
<img src={thumbDataUri} className={buildClassName(styles.preview, thumbClassNames)} />
|
<img src={thumbDataUri} className={buildClassName(styles.preview, thumbClassNames)} draggable={false} />
|
||||||
)}
|
)}
|
||||||
{previewUrl && !isAnimationReady && (
|
{previewUrl && !isAnimationReady && (
|
||||||
// eslint-disable-next-line jsx-a11y/alt-text
|
// eslint-disable-next-line jsx-a11y/alt-text
|
||||||
<img
|
<img
|
||||||
src={previewUrl}
|
src={previewUrl}
|
||||||
className={buildClassName(styles.preview, previewClassNames)}
|
className={buildClassName(styles.preview, previewClassNames)}
|
||||||
|
draggable={false}
|
||||||
onLoad={handlePreviewLoad}
|
onLoad={handlePreviewLoad}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
|||||||
@ -126,7 +126,7 @@ const CustomEmoji: FC<OwnProps> = ({
|
|||||||
>
|
>
|
||||||
<img className={styles.highlightCatch} src={blankImg} alt={customEmoji?.emoji} draggable={false} />
|
<img className={styles.highlightCatch} src={blankImg} alt={customEmoji?.emoji} draggable={false} />
|
||||||
{!customEmoji ? (
|
{!customEmoji ? (
|
||||||
<img className={styles.thumb} src={svgPlaceholder} alt="Emoji" />
|
<img className={styles.thumb} src={svgPlaceholder} alt="Emoji" draggable={false} />
|
||||||
) : (
|
) : (
|
||||||
<StickerView
|
<StickerView
|
||||||
containerRef={containerRef}
|
containerRef={containerRef}
|
||||||
|
|||||||
@ -114,6 +114,7 @@ const File: FC<OwnProps> = ({
|
|||||||
className="full-media"
|
className="full-media"
|
||||||
width={width}
|
width={width}
|
||||||
height={height}
|
height={height}
|
||||||
|
draggable={false}
|
||||||
alt=""
|
alt=""
|
||||||
/>
|
/>
|
||||||
{withThumb && (
|
{withThumb && (
|
||||||
|
|||||||
@ -164,6 +164,7 @@ const GifButton: FC<OwnProps> = ({
|
|||||||
src={previewBlobUrl}
|
src={previewBlobUrl}
|
||||||
alt=""
|
alt=""
|
||||||
className="preview"
|
className="preview"
|
||||||
|
draggable={false}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
{shouldRenderVideo && (
|
{shouldRenderVideo && (
|
||||||
|
|||||||
@ -98,7 +98,7 @@ const ProfilePhoto: FC<OwnProps> = ({
|
|||||||
{isBlurredThumb ? (
|
{isBlurredThumb ? (
|
||||||
<canvas ref={blurredThumbCanvasRef} className="thumb" />
|
<canvas ref={blurredThumbCanvasRef} className="thumb" />
|
||||||
) : (
|
) : (
|
||||||
<img src={avatarBlobUrl} className="thumb" alt="" />
|
<img src={avatarBlobUrl} draggable={false} className="thumb" alt="" />
|
||||||
)}
|
)}
|
||||||
{photo && (
|
{photo && (
|
||||||
isVideo ? (
|
isVideo ? (
|
||||||
|
|||||||
@ -74,6 +74,7 @@ const ReactionStaticEmoji: FC<OwnProps> = ({
|
|||||||
style={size ? `width: ${size}px; height: ${size}px` : undefined}
|
style={size ? `width: ${size}px; height: ${size}px` : undefined}
|
||||||
src={mediaData || blankUrl}
|
src={mediaData || blankUrl}
|
||||||
alt={availableReaction?.title}
|
alt={availableReaction?.title}
|
||||||
|
draggable={false}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@ -305,7 +305,7 @@ const StickerSet: FC<OwnProps> = ({
|
|||||||
onClick={handleDefaultTopicIconClick}
|
onClick={handleDefaultTopicIconClick}
|
||||||
key="default-topic-icon"
|
key="default-topic-icon"
|
||||||
>
|
>
|
||||||
<img src={grey} alt="Reset" className="sticker-media" />
|
<img src={grey} alt="Reset" className="sticker-media" draggable={false} />
|
||||||
</Button>
|
</Button>
|
||||||
)}
|
)}
|
||||||
{withDefaultStatusIcon && (
|
{withDefaultStatusIcon && (
|
||||||
|
|||||||
@ -38,7 +38,7 @@ const TopicChip: FC<OwnProps> = ({
|
|||||||
>
|
>
|
||||||
{topic
|
{topic
|
||||||
? <TopicIcon topic={topic} size={TOPIC_ICON_SIZE} />
|
? <TopicIcon topic={topic} size={TOPIC_ICON_SIZE} />
|
||||||
: <img src={blankSrc} alt="" />}
|
: <img src={blankSrc} alt="" draggable={false} />}
|
||||||
{topic?.title ? renderText(topic.title) : lang('Loading')}
|
{topic?.title ? renderText(topic.title) : lang('Loading')}
|
||||||
{topic?.isClosed && <i className="icon icon-lock" />}
|
{topic?.isClosed && <i className="icon icon-lock" />}
|
||||||
<i className="icon icon-next" />
|
<i className="icon icon-next" />
|
||||||
|
|||||||
@ -128,6 +128,7 @@ function replaceEmojis(textParts: TextPart[], size: 'big' | 'small', type: 'jsx'
|
|||||||
className={`${className}${!isLoaded ? ' opacity-transition slow shown' : ''}`}
|
className={`${className}${!isLoaded ? ' opacity-transition slow shown' : ''}`}
|
||||||
alt={emoji}
|
alt={emoji}
|
||||||
data-path={src}
|
data-path={src}
|
||||||
|
draggable={false}
|
||||||
onLoad={!isLoaded ? handleEmojiLoad : undefined}
|
onLoad={!isLoaded ? handleEmojiLoad : undefined}
|
||||||
/>,
|
/>,
|
||||||
);
|
);
|
||||||
|
|||||||
@ -60,6 +60,7 @@ const CustomEmojiEffect: FC<OwnProps> = ({
|
|||||||
alt=""
|
alt=""
|
||||||
className={styles.particle}
|
className={styles.particle}
|
||||||
style={style}
|
style={style}
|
||||||
|
draggable={false}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
|
|||||||
@ -246,6 +246,7 @@ function renderSummary(
|
|||||||
className={
|
className={
|
||||||
buildClassName('media-preview--image', isRoundVideo && 'round', isSpoiler && 'media-preview-spoiler')
|
buildClassName('media-preview--image', isRoundVideo && 'round', isSpoiler && 'media-preview-spoiler')
|
||||||
}
|
}
|
||||||
|
draggable={false}
|
||||||
/>
|
/>
|
||||||
{getMessageVideo(message) && <i className="icon icon-play" />}
|
{getMessageVideo(message) && <i className="icon icon-play" />}
|
||||||
{messageSummary}
|
{messageSummary}
|
||||||
|
|||||||
@ -127,6 +127,7 @@ function renderSummary(
|
|||||||
className={
|
className={
|
||||||
buildClassName('media-preview--image', isRoundVideo && 'round', isSpoiler && 'media-preview-spoiler')
|
buildClassName('media-preview--image', isRoundVideo && 'round', isSpoiler && 'media-preview-spoiler')
|
||||||
}
|
}
|
||||||
|
draggable={false}
|
||||||
/>
|
/>
|
||||||
{getMessageVideo(message) && <i className="icon icon-play" />}
|
{getMessageVideo(message) && <i className="icon icon-play" />}
|
||||||
{renderMessageSummary(lang, message, true, searchQuery)}
|
{renderMessageSummary(lang, message, true, searchQuery)}
|
||||||
|
|||||||
@ -104,6 +104,7 @@ const WallpaperTile: FC<OwnProps> = ({
|
|||||||
src={previewBlobUrl || localBlobUrl}
|
src={previewBlobUrl || localBlobUrl}
|
||||||
className={buildClassName('full-media', transitionClassNames)}
|
className={buildClassName('full-media', transitionClassNames)}
|
||||||
alt=""
|
alt=""
|
||||||
|
draggable={false}
|
||||||
/>
|
/>
|
||||||
{shouldRenderSpinner && (
|
{shouldRenderSpinner && (
|
||||||
<div className={buildClassName('spinner-container', spinnerClassNames)}>
|
<div className={buildClassName('spinner-container', spinnerClassNames)}>
|
||||||
|
|||||||
@ -47,7 +47,7 @@ const PremiumFeatureItem: FC<OwnProps> = ({
|
|||||||
style={`--item-color: rgb(${r},${g},${b})`}
|
style={`--item-color: rgb(${r},${g},${b})`}
|
||||||
/>
|
/>
|
||||||
) : (
|
) : (
|
||||||
<img src={icon} className={styles.icon} alt="" style={`--item-color: rgb(${r},${g},${b})`} />
|
<img src={icon} className={styles.icon} alt="" style={`--item-color: rgb(${r},${g},${b})`} draggable={false} />
|
||||||
)}
|
)}
|
||||||
<div className={styles.text}>
|
<div className={styles.text}>
|
||||||
<div className={styles.title}>{renderText(title, ['br'])}</div>
|
<div className={styles.title}>{renderText(title, ['br'])}</div>
|
||||||
|
|||||||
@ -311,7 +311,7 @@ const PremiumMainModal: FC<OwnProps & StateProps> = ({
|
|||||||
size={STATUS_EMOJI_SIZE}
|
size={STATUS_EMOJI_SIZE}
|
||||||
/>
|
/>
|
||||||
) : (
|
) : (
|
||||||
<img className={styles.logo} src={PremiumLogo} alt="" />
|
<img className={styles.logo} src={PremiumLogo} alt="" draggable={false} />
|
||||||
)}
|
)}
|
||||||
<h2 className={buildClassName(styles.headerText, fromUserStatusSet && styles.stickerSetText)}>
|
<h2 className={buildClassName(styles.headerText, fromUserStatusSet && styles.stickerSetText)}>
|
||||||
{fromUserStatusSet ? stickerSetTitle : renderText(getHeaderText(), ['simple_markdown', 'emoji'])}
|
{fromUserStatusSet ? stickerSetTitle : renderText(getHeaderText(), ['simple_markdown', 'emoji'])}
|
||||||
|
|||||||
@ -46,7 +46,7 @@ const PremiumFeaturePreviewVideo: FC<OwnProps> = ({
|
|||||||
)}
|
)}
|
||||||
id={`premium_feature_preview_video_${index}`}
|
id={`premium_feature_preview_video_${index}`}
|
||||||
>
|
>
|
||||||
<img src={DeviceFrame} alt="" className={styles.frame} />
|
<img src={DeviceFrame} alt="" className={styles.frame} draggable={false} />
|
||||||
<canvas ref={thumbnailRef} className={styles.video} />
|
<canvas ref={thumbnailRef} className={styles.video} />
|
||||||
<OptimizedVideo
|
<OptimizedVideo
|
||||||
canPlay={isActive}
|
canPlay={isActive}
|
||||||
|
|||||||
@ -90,8 +90,16 @@ const HeaderPinnedMessage: FC<OwnProps> = ({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={styles.pinnedThumb}>
|
<div className={styles.pinnedThumb}>
|
||||||
{thumbDataUri && !spoiler
|
{thumbDataUri && !spoiler && (
|
||||||
&& <img className={styles.pinnedThumbImage} src={srcUrl} width={width} height={height} alt="" />}
|
<img
|
||||||
|
className={styles.pinnedThumbImage}
|
||||||
|
src={srcUrl}
|
||||||
|
width={width}
|
||||||
|
height={height}
|
||||||
|
alt=""
|
||||||
|
draggable={false}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
{thumbDataUri
|
{thumbDataUri
|
||||||
&& <MediaSpoiler thumbDataUri={srcUrl} isVisible={Boolean(spoiler)} width={width} height={height} />}
|
&& <MediaSpoiler thumbDataUri={srcUrl} isVisible={Boolean(spoiler)} width={width} height={height} />}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -45,7 +45,12 @@ const AttachBotIcon: FC<OwnProps> = ({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<i className={buildClassName(styles.root, 'icon', !isTouchScreen && styles.compact)}>
|
<i className={buildClassName(styles.root, 'icon', !isTouchScreen && styles.compact)}>
|
||||||
<img src={iconSvg} alt="" className={buildClassName(styles.image, !isTouchScreen && styles.compact)} />
|
<img
|
||||||
|
src={iconSvg}
|
||||||
|
alt=""
|
||||||
|
className={buildClassName(styles.image, !isTouchScreen && styles.compact)}
|
||||||
|
draggable={false}
|
||||||
|
/>
|
||||||
</i>
|
</i>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@ -48,6 +48,7 @@ const EmojiButton: FC<OwnProps> = ({
|
|||||||
loading="lazy"
|
loading="lazy"
|
||||||
data-path={src}
|
data-path={src}
|
||||||
onLoad={!isLoaded ? handleEmojiLoad : undefined}
|
onLoad={!isLoaded ? handleEmojiLoad : undefined}
|
||||||
|
draggable={false}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -110,6 +110,7 @@ const StickerSetCover: FC<OwnProps> = ({
|
|||||||
style={colorFilter}
|
style={colorFilter}
|
||||||
className={buildClassName(styles.image, transitionClassNames)}
|
className={buildClassName(styles.image, transitionClassNames)}
|
||||||
alt=""
|
alt=""
|
||||||
|
draggable={false}
|
||||||
/>
|
/>
|
||||||
)
|
)
|
||||||
) : (
|
) : (
|
||||||
|
|||||||
@ -51,8 +51,13 @@ const MediaResult: FC<OwnProps> = ({
|
|||||||
if (isForGallery) {
|
if (isForGallery) {
|
||||||
return (
|
return (
|
||||||
<div className="MediaResult chat-item-clickable" onClick={handleClick}>
|
<div className="MediaResult chat-item-clickable" onClick={handleClick}>
|
||||||
<img src={(photo?.thumbnail?.dataUri) || thumbnailDataUrl} alt="" />
|
<img src={(photo?.thumbnail?.dataUri) || thumbnailDataUrl} alt="" draggable={false} />
|
||||||
<img src={mediaBlobUrl} className={buildClassName('full-media', transitionClassNames)} alt="" />
|
<img
|
||||||
|
src={mediaBlobUrl}
|
||||||
|
className={buildClassName('full-media', transitionClassNames)}
|
||||||
|
alt=""
|
||||||
|
draggable={false}
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -87,6 +87,7 @@ function BaseStory({
|
|||||||
src={mediaUrl}
|
src={mediaUrl}
|
||||||
alt=""
|
alt=""
|
||||||
className={buildClassName(styles.media, isPreview && styles.linkPreview, transitionClassNames)}
|
className={buildClassName(styles.media, isPreview && styles.linkPreview, transitionClassNames)}
|
||||||
|
draggable={false}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
{isExpired && (
|
{isExpired && (
|
||||||
|
|||||||
@ -59,6 +59,7 @@ const Game: FC<OwnProps> = ({
|
|||||||
className="preview-content"
|
className="preview-content"
|
||||||
src={photoBlobUrl}
|
src={photoBlobUrl}
|
||||||
alt={title}
|
alt={title}
|
||||||
|
draggable={false}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
{videoBlobUrl && (
|
{videoBlobUrl && (
|
||||||
|
|||||||
@ -103,6 +103,7 @@ const Invoice: FC<OwnProps> = ({
|
|||||||
alt=""
|
alt=""
|
||||||
style={style}
|
style={style}
|
||||||
crossOrigin="anonymous"
|
crossOrigin="anonymous"
|
||||||
|
draggable={false}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
{!photoUrl && photo && (
|
{!photoUrl && photo && (
|
||||||
|
|||||||
@ -55,6 +55,7 @@ const ReactionSelectorReaction: FC<OwnProps> = ({
|
|||||||
className={cn('static-icon')}
|
className={cn('static-icon')}
|
||||||
src={staticIconData}
|
src={staticIconData}
|
||||||
alt=""
|
alt=""
|
||||||
|
draggable={false}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
{!isAnimationLoaded && !noAppearAnimation && (
|
{!isAnimationLoaded && !noAppearAnimation && (
|
||||||
|
|||||||
@ -73,11 +73,11 @@ export default memo(CardInput);
|
|||||||
function getCardIcon(cardType: CardType) {
|
function getCardIcon(cardType: CardType) {
|
||||||
switch (cardType) {
|
switch (cardType) {
|
||||||
case CardType.Mastercard:
|
case CardType.Mastercard:
|
||||||
return <img src={mastercardIconPath} alt="" />;
|
return <img src={mastercardIconPath} draggable={false} alt="" />;
|
||||||
case CardType.Visa:
|
case CardType.Visa:
|
||||||
return <img src={visaIconPath} alt="" />;
|
return <img src={visaIconPath} draggable={false} alt="" />;
|
||||||
case CardType.Mir:
|
case CardType.Mir:
|
||||||
return <img src={mirIconPath} alt="" />;
|
return <img src={mirIconPath} draggable={false} alt="" />;
|
||||||
default:
|
default:
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -158,7 +158,7 @@ const Checkout: FC<OwnProps> = ({
|
|||||||
return (
|
return (
|
||||||
<div className={styles.root}>
|
<div className={styles.root}>
|
||||||
<div className={styles.description}>
|
<div className={styles.description}>
|
||||||
{photoUrl && <img className={styles.checkoutPicture} src={photoUrl} alt="" />}
|
{photoUrl && <img className={styles.checkoutPicture} src={photoUrl} draggable={false} alt="" />}
|
||||||
{!photoUrl && photo && (
|
{!photoUrl && photo && (
|
||||||
<Skeleton
|
<Skeleton
|
||||||
width={photo.dimensions?.width}
|
width={photo.dimensions?.width}
|
||||||
|
|||||||
@ -72,7 +72,12 @@ function renderSummary(lang: LangFn, message: ApiMessage, blobUrl?: string, isRo
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<span className="media-preview">
|
<span className="media-preview">
|
||||||
<img src={blobUrl} alt="" className={buildClassName('media-preview__image', isRoundVideo && 'round')} />
|
<img
|
||||||
|
src={blobUrl}
|
||||||
|
alt=""
|
||||||
|
draggable={false}
|
||||||
|
className={buildClassName('media-preview__image', isRoundVideo && 'round')}
|
||||||
|
/>
|
||||||
{getMessageVideo(message) && <i className="icon icon-play" />}
|
{getMessageVideo(message) && <i className="icon icon-play" />}
|
||||||
{renderMessageSummary(lang, message, true)}
|
{renderMessageSummary(lang, message, true)}
|
||||||
</span>
|
</span>
|
||||||
|
|||||||
@ -123,7 +123,7 @@ function MediaStory({ story, isProtected, isArchive }: OwnProps) {
|
|||||||
)}
|
)}
|
||||||
<div className={styles.wrapper}>
|
<div className={styles.wrapper}>
|
||||||
{thumbUrl && (
|
{thumbUrl && (
|
||||||
<img src={thumbUrl} alt="" className={styles.media} />
|
<img src={thumbUrl} alt="" className={styles.media} draggable={false} />
|
||||||
)}
|
)}
|
||||||
{isProtected && <span className="protector" />}
|
{isProtected && <span className="protector" />}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -726,7 +726,12 @@ function Story({
|
|||||||
>
|
>
|
||||||
<canvas ref={thumbRef} className={styles.thumbnail} />
|
<canvas ref={thumbRef} className={styles.thumbnail} />
|
||||||
{previewBlobUrl && (
|
{previewBlobUrl && (
|
||||||
<img src={previewBlobUrl} alt="" className={buildClassName(styles.media, previewTransitionClassNames)} />
|
<img
|
||||||
|
src={previewBlobUrl}
|
||||||
|
draggable={false}
|
||||||
|
alt=""
|
||||||
|
className={buildClassName(styles.media, previewTransitionClassNames)}
|
||||||
|
/>
|
||||||
)}
|
)}
|
||||||
{shouldRenderSkeleton && (
|
{shouldRenderSkeleton && (
|
||||||
<Skeleton className={buildClassName(skeletonTransitionClassNames, styles.fullSize)} />
|
<Skeleton className={buildClassName(skeletonTransitionClassNames, styles.fullSize)} />
|
||||||
|
|||||||
@ -77,7 +77,7 @@ const AvatarEditable: FC<OwnProps> = ({
|
|||||||
accept="image/png, image/jpeg"
|
accept="image/png, image/jpeg"
|
||||||
/>
|
/>
|
||||||
<i className="icon icon-camera-add" />
|
<i className="icon icon-camera-add" />
|
||||||
{croppedBlobUrl && <img src={croppedBlobUrl} alt="Avatar" />}
|
{croppedBlobUrl && <img src={croppedBlobUrl} draggable={false} alt="Avatar" />}
|
||||||
</label>
|
</label>
|
||||||
<CropModal file={selectedFile} onClose={handleModalClose} onChange={handleAvatarCrop} />
|
<CropModal file={selectedFile} onClose={handleModalClose} onChange={handleAvatarCrop} />
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user