LMFeedCreatePostContext
Introduction
The LMFeedCreatePostContext
provides you with the data and functions to LMFeedCreatePost
and its children. You can use the values stored within this context to create a custom UI for post creation components.
Key | Type | Description | Optional |
---|---|---|---|
postText | string | null | ✔️ | |
question | string | null | ✔️ | |
setQuestionText | (text: string) => void | ✔️ | |
setPostText | (text: string) => void | ✔️ | |
mediaList | File[] | ✔️ | |
addMediaItem | (event: React.ChangeEvent<HTMLInputElement>) => void | ✔️ | |
removeMedia | (index: number) => void | ✔️ | |
clearMedia | () => void | ✔️ | |
mediaUploadMode | LMFeedCreatePostMediaUploadMode | ✔️ | |
changeMediaUploadMode | (mode: LMFeedCreatePostMediaUploadMode) => void | ✔️ | |
textFieldRef | MutableRefObject<HTMLDivElement | null> | ✔️ | |
containerRef | MutableRefObject<HTMLDivElement | null> | ✔️ | |
postFeed | () => Promise<void> | ✔️ | |
editPost | () => Promise<void> | ✔️ | |
ogTag | OgTag | null | ✔️ | |
openCreatePostDialog | boolean | ✔️ | |
setOpenCreatePostDialog | React.Dispatch<boolean> | ✔️ | |
temporaryPost | Post | null | ✔️ | |
selectedTopicIds | string[] | ✔️ | |
setSelectedTopicIds | React.Dispatch<string[]> | ✔️ | |
preSelectedTopics | Topic[] | ✔️ | |
setPreSelectedTopics | React.Dispatch<Topic[]> | ✔️ | |
showOGTagViewContainer | boolean | ✔️ | |
closeOGTagContainer | () => void | ✔️ | |
createPostComponentClickCustomCallback | ComponentDelegatorListener | ✔️ | |
addThumbnailReel | (event: React.ChangeEvent<HTMLInputElement>) => void | ||
addReel | (event: React.ChangeEvent<HTMLInputElement>) => void | ||
tempReel | File[] | ||
tempReelThumbnail | File[] | ||
removeThumbnailReel | () => void | ||
removeAddReel | () => void | ||
isAnonymousPost | boolean | ||
changeAnonymousPostStatus | () => void |
Example
For example implementation, checkout here