Skip to main content

LMFeedCreatePostDialog

LMFeedCreatePostDialog renders the post creation dialog interface, providing a form for users to compose new posts with rich text, media attachments, and polls. It handles post submission and validation.

Props​

PropertyTypeDescriptionOptional
mediaUploadDialogstringControls the visibility state of the media upload dialog✔️

CSS Classnames​

ClassnameDescription
anonymous-post-checkboxCheckbox for anonymous post option
lm-avatar lm-mr-4Avatar image with right margin spacing
anonymous-post-textText label for anonymous post option
lm-feed-create-post-topic-text-area-dividerDivider between topic and text area
lm-textareaText area input styling
lm-feed-create-post-wrapper__user-metaUser metadata container in post creation
lm-feed-create-post-wrapperMain wrapper for post creation dialog
cancelIconClose button icon styling
lm-feed-create-post-anonymous-postContainer for anonymous post options
lm-feed-create-post-wrapper__dialog-headingDialog header text styling

Example​

To customise the component with their classnames, open your base CSS file and override the styles using the classname:

.anonymous-post-checkbox {
font-size: 18px;
color: "red";
}

Advanced Customisation​

You can also pass your custom component to replace the default view for LMFeedCreatePostDialog. You can use the below contexts to customise the component.

Contexts Used​

Below is an example for customising the view for LMFeedCreatePostDialog and rendering your own view. It is fairly a 2 simple step process

  • Step 1: Create your own custom view.
import {
LMSocialFeed,
LMFeedNotificationHeader,
LMFeedUniversalFeed,
LMFeedCustomEvents,
initiateFeedClient,
} from "@likeminds.community/likeminds-feed-reactjs";

// Custom Component for LMFeedCreatePostDialog
const CustomLMFeedCreatePostDialog = () => {
return (
// Your Custom Code
);
};
  • Step 2: Pass your Custom View to LMSocialFeed
import {
LMSocialFeed,
LMFeedNotificationHeader,
LMFeedUniversalFeed,
LMFeedCustomEvents,
initiateFeedClient,
} from "@likeminds.community/likeminds-feed-reactjs"

const App = () => {
const lmFeedClient = initiateFeedClient()

return (
<div className="lm-wrapper">
<LMFeedNotificationHeader customEventClient={customEventClient} />
<LMSocialFeed
client={lmFeedClient}
customEventClient={customEventClient}
userDetails={userDetails}
CustomComponents={{
CustomCreatePostDialog: <CustomLMFeedCreatePostDialog />,
}}
>
<LMFeedUniversalFeed />
</LMSocialFeed>
</div>
)
}
export default App

Reference​

For reference, check out this file