Moves link previews into the composer

This commit is contained in:
Josh Perez 2023-01-30 15:16:09 -05:00 committed by GitHub
parent 270804d62d
commit de1564fd37
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 277 additions and 214 deletions

View file

@ -52,7 +52,6 @@ import { MandatoryProfileSharingActions } from './conversation/MandatoryProfileS
import { MediaQualitySelector } from './MediaQualitySelector';
import type { Props as QuoteProps } from './conversation/Quote';
import { Quote } from './conversation/Quote';
import { StagedLinkPreview } from './conversation/StagedLinkPreview';
import { countStickers } from './stickers/lib';
import {
useAttachFileShortcut,
@ -691,15 +690,6 @@ export function CompositionArea({
/>
</div>
)}
{linkPreviewLoading && linkPreviewResult && (
<div className="preview-wrapper">
<StagedLinkPreview
{...linkPreviewResult}
i18n={i18n}
onClose={() => onCloseLinkPreview(conversationId)}
/>
</div>
)}
{draftAttachments.length ? (
<div className="CompositionArea__attachment-list">
<AttachmentList
@ -732,8 +722,8 @@ export function CompositionArea({
)}
>
<CompositionInput
conversationId={conversationId}
clearQuotedMessage={clearQuotedMessage}
conversationId={conversationId}
disabled={isDisabled}
draftBodyRanges={draftBodyRanges}
draftText={draftText}
@ -742,6 +732,9 @@ export function CompositionArea({
i18n={i18n}
inputApi={inputApiRef}
large={large}
linkPreviewLoading={linkPreviewLoading}
linkPreviewResult={linkPreviewResult}
onCloseLinkPreview={onCloseLinkPreview}
onDirtyChange={setDirty}
onEditorStateChange={onEditorStateChange}
onPickEmoji={onPickEmoji}