stream-chat-react icon indicating copy to clipboard operation
stream-chat-react copied to clipboard

Start of a new thread badge

Open arnautov-anton opened this issue 2 years ago • 2 comments

Hide “Start of a new thread” once the first reply landed in the thread.

image.png

arnautov-anton avatar Mar 03 '22 17:03 arnautov-anton

@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}>

alexlopezit avatar May 06 '22 02:05 alexlopezit

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:

arnautov-anton avatar May 06 '22 09:05 arnautov-anton

With the release of v10.0.0 the "Start of new thread" badge was removed

MartinCupela avatar Sep 21 '22 13:09 MartinCupela