Skip to main content

LMQNAFeedPollDialogPreview

LMQNAFeedPollDialogPreview renders a preview of poll questions and options specifically for Q&A posts. It allows users to review and edit poll settings before attaching them to questions.

CSS Classnames

ClassnameDescription
poll-preview-subheading-styleSubheading text styling in poll preview
poll-preview-advance-options poll-preview-subheading-styleAdvanced options styling in poll preview
poll-preview-edit-button-parentContainer for poll edit button
poll-preview-titleTitle text styling in poll preview
lm-feed-create-post-wrapper__user-metaUser metadata container in poll preview
lm-feed-create-post-anonymous-postContainer for anonymous post options
poll-preview-header-icon lm-cursor-pointerInteractive header icon in poll preview
lm-feed-create-post-wrapper__dialog-headingDialog header text styling
poll-preview-title-parentContainer for poll title section
anonymous-post-checkboxCheckbox for anonymous post option
lm-feed-create-post-topic-text-area-dividerDivider between topic and text area
poll-option-text-input poll-option-text-input-previewText input styling for poll options
lm-textareaText area input styling
cancelIconClose button icon styling
poll-option-wrapperContainer for poll option elements
lm-avatar lm-mr-4Avatar image with right margin spacing
anonymous-post-textText label for anonymous post option
poll-preview-wrapperMain wrapper for poll preview content
lm-feed-create-post-wrapperMain wrapper for poll creation dialog

Example

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

.poll-preview-subheading-style {
font-size: 18px;
color: "red";
}

Advanced Customisation

Customising LMFeedTextArea

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

Hooks Used

Contexts Used

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

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

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

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

return (
<div className="lm-wrapper">
<LMFeedNotificationHeader customEventClient={customEventClient} />
<LMQNAFeed
client={lmFeedClient}
customEventClient={customEventClient}
userDetails={userDetails}
CustomComponents={{
CustomCreatePostTextArea: <CustomLMFeedTextAreaView />,
}}
>
<LMQNAFeedUniversalFeed />
</LMQNAFeed>
</div>
)
}
export default App

Reference

For reference, check out this file