diff --git a/stylesheets/components/StagedLinkPreview.scss b/stylesheets/components/StagedLinkPreview.scss index 5524e414ec52..240cf8e309ab 100644 --- a/stylesheets/components/StagedLinkPreview.scss +++ b/stylesheets/components/StagedLinkPreview.scss @@ -52,6 +52,10 @@ display: flex; flex-direction: column; margin-right: 20px; + + &--only-url { + justify-content: center; + } } .module-staged-link-preview__title { @include font-body-1-bold; diff --git a/ts/components/TextStoryCreator.tsx b/ts/components/TextStoryCreator.tsx index 22bbd33efb65..67709dbe3a67 100644 --- a/ts/components/TextStoryCreator.tsx +++ b/ts/components/TextStoryCreator.tsx @@ -14,6 +14,7 @@ import type { TextAttachmentType } from '../types/Attachment'; import { Button, ButtonVariant } from './Button'; import { ContextMenu } from './ContextMenu'; import { LinkPreviewSourceType, findLinks } from '../types/LinkPreview'; +import type { MaybeGrabLinkPreviewOptionsType } from '../types/LinkPreview'; import { Input } from './Input'; import { Slider } from './Slider'; import { StagedLinkPreview } from './conversation/StagedLinkPreview'; @@ -31,7 +32,8 @@ import { handleOutsideClick } from '../util/handleOutsideClick'; export type PropsType = { debouncedMaybeGrabLinkPreview: ( message: string, - source: LinkPreviewSourceType + source: LinkPreviewSourceType, + options?: MaybeGrabLinkPreviewOptionsType ) => unknown; i18n: LocalizerType; linkPreview?: LinkPreviewType; @@ -178,7 +180,10 @@ export const TextStoryCreator = ({ } debouncedMaybeGrabLinkPreview( linkPreviewInputValue, - LinkPreviewSourceType.StoryCreator + LinkPreviewSourceType.StoryCreator, + { + mode: 'story', + } ); }, [ debouncedMaybeGrabLinkPreview, @@ -525,12 +530,9 @@ export const TextStoryCreator = ({ {linkPreview ? ( <>