stream-chat-react
stream-chat-react copied to clipboard
Start of a new thread badge
Hide “Start of a new thread” once the first reply landed in the thread.
@arnautov-anton you could do that with a custom component and pass it to the Channel
as prop
import React from 'react'
import { useChannelStateContext } from 'stream-chat-react'
export const ThreadStart = () => {
const { thread } = useChannelStateContext()
if (thread?.reply_count && thread?.reply_count !== 0) {
return null
}
return <div>Start of a new thread</div>
}
The use it like
<Channel ThreadStart={ThreadStart}>
Hey, @alexlopezit! Thank you for your contribution - this is one of the things that should work "out of the box" so that's why we added it to the list. Feel free to open the PR. :slightly_smiling_face:
With the release of v10.0.0 the "Start of new thread" badge was removed