Skip to main content

Create Poll

Overview

CreatePollUI is a component used to render the user interface for creating a new poll. It provides customizable fields for entering the poll question, adding poll options, and setting poll preferences (like allowing multiple selections). The component handles user input and updates the poll data structure dynamically as the user interacts with it.

GitHub File:

LMFeedLikeListScreen

Styling Customisation

The STYLES class allows you to customize the appearance of the LMFeedCreatePoll. You can set the styles in createPollStyle in STYLES.

PropertyTypeDescription
pollQuestionsStyleReact.CSSPropertiesStyle for the poll questions.
pollOptionsStyleReact.CSSPropertiesStyle for the poll options.
pollExpiryTimeStyleReact.CSSPropertiesStyle for the poll expiry time text.
pollAdvancedOptionTextStyleReact.CSSPropertiesStyle for the text of advanced poll options.
pollAdvancedOptionExpandIconstringPath or URL to the icon used for expanding advanced options.
pollAdvancedOptionMinimiseIconstringPath or URL to the icon used for minimizing advanced options.
pollAdvanceOptionsSwitchThumbColorstringColor of the switch thumb in advanced options.
pollAdvanceOptionsSwitchTrackColorstringColor of the switch track in advanced options.
shouldHideSeparatorbooleanTo show and hide separator.

Usage Example

import { STYLES } from "@likeminds.community/chat-rn-core"

STYLES.setCreatePollStyles({
pollAdvancedOptionTextStyle: {
color: 'yellow',
fontWeight: 'bold'
},
pollOptionsStyle: {
backgroundColor: 'black'
},
pollAdvancedOptionMinimiseIcon: "asset/url/path",
pollQuestionsStyle: {
color: 'black'
}
})