Skip to main content

Reaction List

Overview

The ReactionList component is responsible for rendering a list of emojis that a user can press so to react to a message in a chatroom

GitHub File:

LMFeedMediaPreviewScreen

Styling Customisations

These styling customisations can be applied through the setReactionListStyle method on the STYLES class

PropertyTypeDescription
reactionSizenumberDefines the size of the reaction icon.
reactionLeftItemStrokestringSets the stroke color for the left reaction.
reactionRightItemStrokestringSets the stroke color for the right reaction.
reactionItemBorderRadiusnumberDefines the border radius for reaction items.
gapnumberSpecifies the gap between items.
selectedMessageBackgroundColorstringSets the background color of selected messages.
tabOptionColorstringDefines the color for the tab option.

Usage Example

  • In your app, create a CustomChatroomScreen file, wrap it with the ChatRoom context provider.
  • Now, you can pass your own reaction list component as prop to the ChatRoom context provider
import {
ChatRoom,
ChatroomHeader,
MessageList,
MessageInput,
useChatroomContext,
useMessageListContext,

ChatroomTopic,
STYLES
} from "@likeminds.community/chat-rn-core";
import {InputBoxContextProvider} from '@likeminds.community/chat-rn-core/ChatSX/context/InputBoxContext';
import {ChatroomContextValues} from '@likeminds.community/chat-rn-core/ChatSX/context/ChatroomContext';
import MessageInputBox from "@likeminds.community/chat-rn-core/ChatSX/components/InputBox";

export function CustomChatroomScreen() {

const {
chatroomID,
chatroomWithUser,
currentChatroomTopic,
chatroomType,
replyChatID,
isEditable,
chatroomName,
isSecret,
refInput,
chatroomDBDetails,
chatRequestState,
setIsEditable,
handleFileUpload,
joinSecretChatroom,
onTapToUndo,
}: ChatroomContextValues = useChatroomContext();

return (
<ChatRoom
customReactionList={<"CUSTOM_REACTION_LIST_COMPONENT">}
>

{/* ChatroomHeader */}
<ChatroomHeader />

{/* ChatroomTopic */}
<ChatroomTopic />

{/* MessageList */}
<MessageList />

{/* Input Box Flow */}
<InputBoxContextProvider
chatroomName={chatroomName}
chatroomWithUser={chatroomWithUser}
replyChatID={replyChatID}
chatroomID={chatroomID}
isUploadScreen={false}
myRef={refInput}
handleFileUpload={handleFileUpload}
isEditable={isEditable}
setIsEditable={(value: boolean) => {
setIsEditable(value);
}}
isSecret={isSecret}
chatroomType={chatroomType}
currentChatroomTopic={currentChatroomTopic}
isPrivateMember={chatroomDBDetails.isPrivateMember}
chatRequestState={chatRequestState}>
<MessageInput>
<MessageInputBox />
</MessageInput>
</InputBoxContextProvider>
</ChatRoom>
);
}