We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I've tried tinkering with various parts of the message list configuration but haven't found a solution
`import { useCallback, useEffect, useState } from 'react' import { Bubble, GiftedChat, IMessage } from 'react-native-gifted-chat' import { COLORS, spacing } from '@/constants' import { ActivityIndicator } from 'react-native' import { ChatbotInputComponent } from '@/components/chatbot-input-component/ChatbotInputComponent'
export const ChatBot = () => { const [messages, setMessages] = useState<IMessage[]>([]) const [text, setText] = useState('')
const customBubble = (props: any) => { return ( <Bubble {...props} wrapperStyle={{ left: { paddingVertical: spacing.xxxl * 2, backgroundColor: COLORS.BG_TAB_COLOR }, right: { paddingVertical: spacing.xxxl * 2, backgroundColor: COLORS.BUTTON_COLOR } }} textStyle={{ right: { color: COLORS.GLOBAL_COLOR }, left: { color: COLORS.GLOBAL_COLOR } }} /> ) } useEffect(() => { setMessages([ { _id: 1, text: 'Hi!, how can I help you?', createdAt: new Date(), user: { _id: 2, name: 'bot' } }, { _id: 2, text: 'Hi!, how can I help you?', createdAt: new Date(), user: { _id: 2, name: 'bot' } }, { _id: 3, text: 'Hi!, how can I help you?', createdAt: new Date(), user: { _id: 2, name: 'bot' } } ]) }, []) const onSend = useCallback(() => { if (text.trim().length === 0) return const newMessage = { _id: Math.random().toString(), text: text, createdAt: new Date(), user: { _id: 1 } } setMessages(previousMessages => GiftedChat.append(previousMessages, [newMessage])) setText('') }, [text]) return ( <GiftedChat renderLoading={() => <ActivityIndicator size={'large'} color={COLORS.GLOBAL_COLOR} />} renderTime={() => null} messages={messages} user={{ _id: 1 }} renderBubble={customBubble} renderAvatar={null} renderInputToolbar={() => { return ( <ChatbotInputComponent onPress={onSend} value={text} onSubmitEditing={onSend} onChangeText={setText} /> ) }} /> )
} `
The text was updated successfully, but these errors were encountered:
+1
Sorry, something went wrong.
Same here
No branches or pull requests
I've tried tinkering with various parts of the message list configuration but haven't found a solution
`import { useCallback, useEffect, useState } from 'react'
import { Bubble, GiftedChat, IMessage } from 'react-native-gifted-chat'
import { COLORS, spacing } from '@/constants'
import { ActivityIndicator } from 'react-native'
import { ChatbotInputComponent } from '@/components/chatbot-input-component/ChatbotInputComponent'
export const ChatBot = () => {
const [messages, setMessages] = useState<IMessage[]>([])
const [text, setText] = useState('')
}
`
teste.mp4
The text was updated successfully, but these errors were encountered: