Story - add caption

This commit is contained in:
Alvaro 2022-10-04 17:17:15 -06:00 committed by GitHub
parent 8fcd36e30a
commit c52fe3f377
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
22 changed files with 688 additions and 163 deletions

View file

@ -21,6 +21,7 @@ import { SendStoryModal } from './SendStoryModal';
import { MediaEditor } from './MediaEditor';
import { TextStoryCreator } from './TextStoryCreator';
import type { SmartCompositionTextAreaProps } from '../state/smart/CompositionTextArea';
export type PropsType = {
debouncedMaybeGrabLinkPreview: (
@ -39,6 +40,9 @@ export type PropsType = {
processAttachment: (
file: File
) => Promise<void | InMemoryAttachmentDraftType>;
renderCompositionTextArea: (
props: SmartCompositionTextAreaProps
) => JSX.Element;
sendStoryModalOpenStateChanged: (isOpen: boolean) => unknown;
} & Pick<StickerButtonProps, 'installedPacks' | 'recentStickers'> &
Pick<
@ -87,6 +91,7 @@ export const StoryCreator = ({
onViewersUpdated,
processAttachment,
recentStickers,
renderCompositionTextArea,
sendStoryModalOpenStateChanged,
setMyStoriesToAllSignalConnections,
signalConnections,
@ -174,11 +179,14 @@ export const StoryCreator = ({
imageSrc={attachmentUrl}
installedPacks={installedPacks}
onClose={onClose}
onDone={data => {
supportsCaption
renderCompositionTextArea={renderCompositionTextArea}
onDone={(data, caption) => {
setDraftAttachment({
contentType: IMAGE_JPEG,
data,
size: data.byteLength,
caption,
});
}}
recentStickers={recentStickers}