Link preview UI improvements

This commit is contained in:
Josh Perez 2023-02-03 17:21:07 -05:00 committed by GitHub
parent f329d9234a
commit fd6834588c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 17 additions and 15 deletions

View file

@ -695,6 +695,14 @@ export function CompositionInput(props: Props): React.ReactElement {
ref={ref}
data-testid="CompositionInput"
>
{conversationId && linkPreviewLoading && linkPreviewResult && (
<StagedLinkPreview
{...linkPreviewResult}
moduleClassName="CompositionInput__link-preview"
i18n={i18n}
onClose={() => onCloseLinkPreview?.(conversationId)}
/>
)}
{children}
<div
ref={
@ -706,21 +714,13 @@ export function CompositionInput(props: Props): React.ReactElement {
onScroll={onScroll}
className={classNames(
getClassName('__input__scroller'),
linkPreviewResult
!large && linkPreviewResult
? getClassName('__input__scroller--link-preview')
: null,
large ? getClassName('__input__scroller--large') : null,
children ? getClassName('__input--with-children') : null
)}
>
{conversationId && linkPreviewLoading && linkPreviewResult && (
<StagedLinkPreview
{...linkPreviewResult}
moduleClassName="CompositionInput__link-preview"
i18n={i18n}
onClose={() => onCloseLinkPreview?.(conversationId)}
/>
)}
{reactQuill}
{emojiCompletionElement}
{mentionCompletionElement}