diff --git a/stylesheets/components/CompositionInput.scss b/stylesheets/components/CompositionInput.scss index 4debfa6a9a4a..271298dbe6bb 100644 --- a/stylesheets/components/CompositionInput.scss +++ b/stylesheets/components/CompositionInput.scss @@ -108,6 +108,7 @@ &--link-preview { min-height: 110px; max-height: 200px; + padding-top: 0; } } @@ -203,7 +204,8 @@ div.CompositionInput__link-preview { border-radius: 8px; flex-direction: row-reverse; justify-content: space-between; - margin-bottom: 4px; + margin: 6px; + min-height: 74px; overflow: hidden; @include dark-theme { @@ -223,6 +225,10 @@ div.CompositionInput__link-preview { padding-left: 12px; padding-top: 8px; } + + &__no-image { + margin-right: 0; + } } button.CompositionInput__link-preview__close-button { diff --git a/ts/components/CompositionInput.tsx b/ts/components/CompositionInput.tsx index 6df69c4e2cc4..0e6fd0daf9fa 100644 --- a/ts/components/CompositionInput.tsx +++ b/ts/components/CompositionInput.tsx @@ -695,6 +695,14 @@ export function CompositionInput(props: Props): React.ReactElement { ref={ref} data-testid="CompositionInput" > + {conversationId && linkPreviewLoading && linkPreviewResult && ( + onCloseLinkPreview?.(conversationId)} + /> + )} {children}
- {conversationId && linkPreviewLoading && linkPreviewResult && ( - onCloseLinkPreview?.(conversationId)} - /> - )} {reactQuill} {emojiCompletionElement} {mentionCompletionElement} diff --git a/ts/state/ducks/conversations.ts b/ts/state/ducks/conversations.ts index 1ee05a319dac..3f8501964288 100644 --- a/ts/state/ducks/conversations.ts +++ b/ts/state/ducks/conversations.ts @@ -134,10 +134,7 @@ import { isNotNil } from '../../util/isNotNil'; import { PanelType } from '../../types/Panels'; import { startConversation } from '../../util/startConversation'; import { UUIDKind } from '../../types/UUID'; -import { - removeLinkPreview, - suspendLinkPreviews, -} from '../../services/LinkPreview'; +import { removeLinkPreview } from '../../services/LinkPreview'; import type { ReplaceAttachmentsActionType, SetFocusActionType, @@ -3670,7 +3667,6 @@ function onConversationClosed( } removeLinkPreview(conversationId); - suspendLinkPreviews(); dispatch({ type: CONVERSATION_UNLOADED,