ChatInput
Reusable ChatInput component with predefined styles for chat
Example
import {useState} from 'react';
import {
ChatInput,
} from '@lad-tech/mobydick-core';
export const ChatWidget = () => {
const [input, setInput] = useState('');
const [myMessages, setMyMessages] = useState([
{time: '12-12-1998', isMe: true, message: 'message'},
]);
const onSend = () => {
setMyMessages([
...myMessages,
{
time: new Date().toString(),
isMe: true,
message: input,
},
]);
setInput('');
};
return (
<ChatInput>
<ChatInput.ChatInputField value={input} onChangeText={setInput} />
<ChatInput.ChatPressableIcon name={'icon-send'} onPress={onSend} />
</ChatInput>
);
};
Props
View Props
Inherits View Props.
containerStyle
TYPE |
---|
ViewStyle |
Custom styles for container
Componetns
ChatInputField
See ChatInputField
ChatInputField
See ChatInputField