LLChatMessageComposer is used to compose a message which could be a text message, image message in the form of stickers of gifs. As part of LLChat component this component is rendered at the bottom of the UI.
LLChatMessageComposer component in turn renders:
TextInput - To send a text message.
Sticker Picker - To pick and send sticker image. Sticker picker component is shown when clicked on sticker picker icon.
Gif Picker - To pick and send gif. Gif picker component is shown when clicked on gif picker icon.
Custom implementation for GifPickerComponent, StickerPickerComponent and SendButtonComponent example:
import React from 'react';
import {
LLChat,
LLChatMessageComposer,
LLChatMessageComposerProps,
LLGifPickerProps,
LLStickerPickerProps,
} from '@livelike/react-native';
import { LLComposerSendButtonProps } from '../react-native/src/components/LLChatMessageComposer/LLComposerSendButton';
function MySendButton(props: LLComposerSendButtonProps) {
// render your custom send button
}
function MyStickerPicker(props: LLStickerPickerProps) {
// render your custom sticker picker
}
function MyGifPicker(props: LLGifPickerProps) {
// render your custom gif picker
}
function MyComposer(props: LLChatMessageComposerProps) {
return (
<LLChatMessageComposer
{...props}
GifPickerComponent={MyGifPicker}
StickerPickerComponent={MyStickerPicker}
SendButtonComponent={MySendButton}
/>
);
}
export function MyApp() {
return (
<LLChat
roomId="<Your chat room id>"
MessageComposerComponent={MyComposer}
/>
);
}
Customise styles for Stock LLGifPicker, LLStickerPicker and LLComposerSendButton components example: