Skip to main content

Poll Conversation UI

Overview

The PollConversationUI component renders the user interface for displaying and interacting with polls within chat conversations, allowing users to view poll questions, cast votes, and see real-time updates on poll statuses, all while ensuring an engaging and responsive experience in the LikeMinds chat application.

LMFeedMediaPreviewScreen

Customisations

The PollConversationUI can be customised using the chatBubbleStyles

Props

PropertyTypeDescriptionDefaultRequired
huenumber(Optional) The hue value for color customization.
textstringThe text displayed for the poll option.✔️
votesnumberThe number of votes received for this option.0✔️
optionArrPoll[]Array of poll options.✔️
pollTypeTextstringThe text describing the poll type.✔️
submitTypeTextstringThe text for the poll submission button.✔️
addOptionInputFieldstringThe current input value for adding a new option.""✔️
shouldShowSubmitPollButtonbooleanIndicates whether the submit button should be shown.false✔️
selectedPollsnumber[]Array of selected poll indices.✔️
showSelectedbooleanIndicates if the selected options should be shown.false✔️
allowAddOptionbooleanControls whether users can add new options.true✔️
shouldShowVotesbooleanIndicates if vote counts should be displayed.true✔️
hasPollEndedbooleanIndicates if the poll has ended.false✔️
expiryTimestringThe expiration time for the poll.✔️
toShowResultsbooleanIndicates if results should be displayed.false✔️
memberanyInformation about the member participating in the poll.✔️
useranyInformation about the user interacting with the poll.✔️
isEditedbooleanIndicates if the poll has been edited.false✔️
createdAtstringTimestamp of when the poll was created.✔️
pollAnswerTextstringThe text for the poll answer.✔️
isPollEndedbooleanIndicates if the poll has ended.false✔️
isIncludedbooleanIndicates if the poll is included in results.true✔️
multipleSelectNoany(Optional) Number of multiple selections allowed.
multipleSelectStatenumberCurrent state of multiple selections.0✔️
showResultsButtonbooleanIndicates if the results button should be shown.true✔️
pollTypenumberThe type of the poll (e.g., single-choice, multiple-choice).0✔️
onNavigateFunctionCallback to navigate to a specified route.✔️
setSelectedPollOptionsFunctionCallback to update the selected poll options.✔️
addPollOptionFunctionCallback to add a new poll option.✔️
submitPollFunctionCallback to submit the poll.✔️
setShowSelectedFunctionCallback to set the visibility of selected options.✔️
setIsAddPollOptionModalVisibleFunctionCallback to control the visibility of the add option modal.✔️
setAddOptionInputFieldFunctionCallback to set the input field value for adding an option.✔️
openKeyboardFunctionCallback to open the keyboard on user interaction.✔️
longPressOpenKeyboardFunctionCallback to open the keyboard on long press.✔️
stringManipulationFunctionFunction to perform string manipulation.✔️
resetShowResultFunctionCallback to reset the display of poll results.✔️

Poll

PropertyTypeDescriptionDefaultRequired
idstringUnique identifier for the poll option.✔️
isSelectedbooleanIndicates if the poll option is selected.false✔️
percentagenumberThe percentage of votes this option has.0✔️
noVotesnumberThe total number of votes for this option.0✔️