Skip to content

Commit d7deaf4

Browse files
authored
fix: Channel thread type (#2748)
* fix: Channel thread type * fix: docs for thread * fix: poll docs too
1 parent a861a33 commit d7deaf4

File tree

4 files changed

+11
-7
lines changed

4 files changed

+11
-7
lines changed

docusaurus/docs/reactnative/common-content/ui-components/channel/props/thread.mdx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
A message object that when set indicates a thread is open.
1+
Can be either a `MessageType` object or a [`ThreadType`](https://github.com/GetStream/stream-chat-react-native/blob/develop/package/src/contexts/threadContext/ThreadContext.tsx) that when set indicates a thread is open.
2+
Both of the types may be used interchangeably.
3+
24
When used with the [`Thread`](../../../../ui-components/thread.mdx) component this will display the thread.
35
When used with the standard [`MessageList`](../../../../ui-components/message-list.mdx) component this will prevent any singleton components in the [`OverlayProvider`](../../../../core-components/overlay-provider.mdx) form getting out of sync.
46

docusaurus/docs/reactnative/hooks/poll/use-poll-state.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ A property containing the number of answers (comments) to the `poll`.
3939
| -------- |
4040
| `number` |
4141

42-
### `created_by`
42+
### `createdBy`
4343

4444
A property containing information about the user who created the `poll`. Its type can be found [here](https://github.com/GetStream/stream-chat-js/blob/b447512922b19bc7e3668bd9df81debcb673dd81/src/types.ts) under `UserResponse`.
4545

@@ -57,7 +57,7 @@ A property depicting whether each user should have only one and unique vote or t
5757
| --------- |
5858
| `boolean` |
5959

60-
### `is_closed`
60+
### `isClosed`
6161

6262
A property depicting whether the `poll` is still open for voting or not.
6363

@@ -75,7 +75,7 @@ This property is not available for anonymous polls.
7575
| -------------------------- |
7676
| `Record<string, PollVote>` |
7777

78-
### `max_votes_allowed`
78+
### `maxVotesAllowed`
7979

8080
A property containing the maximum number of votes allowed per user.
8181

docusaurus/docs/reactnative/ui-components/thread.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const App = () => {
2323
return (
2424
<OverlayProvider>
2525
<Chat client={client}>
26-
<Channel channel={channel} thread={messageId} threadList>
26+
<Channel channel={channel} thread={message} threadList>
2727
// highlight-next-line
2828
<Thread />
2929
</Channel>

package/src/components/Channel/Channel.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2516,8 +2516,10 @@ const ChannelWithContext = <
25162516

25172517
export type ChannelProps<
25182518
StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
2519-
> = Partial<Omit<ChannelPropsWithContext<StreamChatGenerics>, 'channel'>> &
2520-
Pick<ChannelPropsWithContext<StreamChatGenerics>, 'channel'>;
2519+
> = Partial<Omit<ChannelPropsWithContext<StreamChatGenerics>, 'channel' | 'thread'>> &
2520+
Pick<ChannelPropsWithContext<StreamChatGenerics>, 'channel'> & {
2521+
thread?: MessageType<StreamChatGenerics> | ThreadType<StreamChatGenerics> | null;
2522+
};
25212523

25222524
/**
25232525
*

0 commit comments

Comments
 (0)