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 { |   &--nonclickable { | ||||||
|     cursor: inherit; |     cursor: inherit; | ||||||
|     .module-image__image { |     .module-image__image, | ||||||
|  |     .module-image__border-overlay--with-click-handler { | ||||||
|       cursor: inherit; |       cursor: inherit; | ||||||
|     } |     } | ||||||
|   } |   } | ||||||
|  |  | ||||||
|  | @ -6,7 +6,7 @@ import React from 'react'; | ||||||
| import { createPortal } from 'react-dom'; | import { createPortal } from 'react-dom'; | ||||||
| import classNames from 'classnames'; | import classNames from 'classnames'; | ||||||
| import getDirection from 'direction'; | 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 { Manager, Popper, Reference } from 'react-popper'; | ||||||
| import type { PreventOverflowModifier } from '@popperjs/core/lib/modifiers/preventOverflow'; | 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, |         'module-message__link-preview--nonclickable': !isClickable, | ||||||
|       } |       } | ||||||
|     ); |     ); | ||||||
|     const onPreviewImageClick = () => { |     const onPreviewImageClick = isClickable | ||||||
|       if (first.image && !isDownloaded(first.image)) { |       ? () => { | ||||||
|         kickOffAttachmentDownload({ |           if (first.image && !isDownloaded(first.image)) { | ||||||
|           attachment: first.image, |             kickOffAttachmentDownload({ | ||||||
|           messageId: id, |               attachment: first.image, | ||||||
|         }); |               messageId: id, | ||||||
|         return; |             }); | ||||||
|       } |             return; | ||||||
|       openLink(first.url); |           } | ||||||
|     }; |           openLink(first.url); | ||||||
|  |         } | ||||||
|  |       : noop; | ||||||
|     const contents = ( |     const contents = ( | ||||||
|       <> |       <> | ||||||
|         {first.image && previewHasImage && isFullSizeImage ? ( |         {first.image && previewHasImage && isFullSizeImage ? ( | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Evan Hahn
				Evan Hahn