Created
October 6, 2020 03:52
-
-
Save efstathiosntonas/ce4d8cea1936a65c99ef49bf75717c08 to your computer and use it in GitHub Desktop.
System and custom message react native gifted chat
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { | |
GiftedChat, | |
SystemMessage, | |
// ...all other imports | |
} from "react-native-gifted-chat | |
<GiftedChat | |
// ...all other stuff | |
renderSystemMessage={(systemMessage) => { | |
// @ts-ignore | |
const feed: Doc<Feed> = systemMessage.currentMessage.feed; | |
if (feed != null) { | |
return <FeedInChat feed={feed} time={time} date={date} />; | |
} | |
return <SystemMessage {...systemMessage} />; | |
}} | |
user={{ | |
_id: currentUser().uid | |
}} | |
/> | |
</GiftedChat> | |
// ^^ FeedInChat is a custom component, you can use whatever you want |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment