LMCreatePostMedia
The LMCreatePostMedia
component handles the media section of the post creation screen. It allows users to attach various media types (images, videos, documents, polls, and links) to their posts and provides functionality for previewing, managing, and removing attachments.
GitHub File:

Overview
LMCreatePostMedia
provides the following functionality:
- Displays previews of attached media (images, videos, polls, and documents).
- Allows users to add more attachments to their post.
- Supports conditional rendering based on the attachment types.
- Provides cancel functionality for each attachment type.
Styling Customisations
These styling customisations can be applied by calling the setCreatePostStyles
on the STYLES
class
Property | Type | Description |
---|---|---|
text | LMTextProps | Props for the text shown on the button. |
icon | LMIconProps | Props for the icon displayed on the button. |
onTap | (value?: any) => void | Callback function invoked on button tap. |
placement | "start" | "end" | Placement of the button in the layout. |
buttonStyle | ViewStyle | Style for the button container. |
isClickable | boolean | Determines if the button is clickable. |
Example Usage
To use this component, make sure to wrap it within a CreatePost
context provider. Here’s an example:
import React, { useEffect } from "react";
import { View } from "react-native";
import {
LMCreatePostMedia,
STYLES,
CreatePost
} from "@likeminds.community/feed-rn-core";
const CustomCreatePostScreen = () => {
// to customise ui
useEffect(() => {
STYLES.setPostListStyles({
media: {
image: {
height: 10,
width: 10,
},
},
});
}, []);
return (
<CreatePost>
<LMCreatePostMedia />
{/* Additional CreatePost components */}
</CreatePost>
);
};
export default CustomCreatePostScreen;
- Use the
LMCreatePostMedia
or your own custom component with all other create post components as a child of theCreatePost
component in the relevant screens: