Skip to main content

LMCreatePostButton

The LMCreatePostButton component provides an interface to initiate the creation of a new post in the feed. This button is customizable, supports dynamic styling, and integrates analytics for post creation tracking.

LMFeedPostContent

Overview

LMCreatePostButton includes:

  • A customizable button that triggers post creation.
  • An icon and text that are styleable and can be modified for personalized community themes.
  • An integration with LMFeedAnalytics for tracking when the post creation process starts.

Customization with Props

PropertyTypeDescription
customTextstringCustom text displayed on the button (e.g., "Ask Question").

Customization with Styles

PropertyTypeDescription
newPostButtonStyleViewStyleStyles for the button’s background and layout, applied via universalFeedStyle.
newPostButtonTextTextStyleStyles for the text on the button, managed via the theme context.
newPostIconImagePropsStyles for the icon, allowing customization of size, color, and other properties.

Integration

To use this component, import it and add it as a child of the UniversalFeed.

Here’s how you integrate LMCreatePostButton within a screen:

import React from "react";
import {
LMCreatePostButton,
UniversalFeed,
STYLES,
} from "@likeminds.community/feed-rn-core";

const FeedScreen = () => {
// to customise ui
useEffect(() => {
STYLES.setUniversalFeedStyles({
newPostButtonStyle: {
backgroundColor: "yellow",
},
});
}, []);
return (
<UniversalFeed>
<LMCreatePostButton />
{/* Other feed components */}
</UniversalFeed>
);
};

export default FeedScreen;