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.
Callbacks
onPollExpiryTimeClicked
: Triggered when the user clicks to view or edit the poll's expiry time.onAddOptionClicked
: Triggered when the user clicks to add a new option to the poll.onPollOptionCleared
: Triggered when a poll option is removed, providing theindex
of the cleared option.onPollCompleteClicked
: Triggered when the user marks the poll as complete.
Customisation
The STYLES
class allows you to customize the appearance of the LMFeedCreatePoll
. You can set the styles in createPollStyle
in STYLES
.
Property | Type | Description |
---|---|---|
pollQuestionsStyle | React.CSSProperties | Style for the poll questions. |
pollOptionsStyle | React.CSSProperties | Style for the poll options. |
pollExpiryTimeStyle | React.CSSProperties | Style for the poll expiry time text. |
pollAdvancedOptionTextStyle | React.CSSProperties | Style for the text of advanced poll options. |
pollAdvancedOptionExpandIcon | string | Path or URL to the icon used for expanding advanced options. |
pollAdvancedOptionMinimiseIcon | string | Path or URL to the icon used for minimizing advanced options. |
pollAdvanceOptionsSwitchThumbColor | string | Color of the switch thumb in advanced options. |
pollAdvanceOptionsSwitchTrackColor | string | Color of the switch track in advanced options. |
shouldHideSeparator | boolean | To show and hide separator. |