Skip to content

Commit

Permalink
fix: Channel thread type (#2748)
Browse files Browse the repository at this point in the history
* fix: Channel thread type

* fix: docs for thread

* fix: poll docs too
  • Loading branch information
isekovanic authored Nov 1, 2024
1 parent a861a33 commit d7deaf4
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
A message object that when set indicates a thread is open.
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.
Both of the types may be used interchangeably.

When used with the [`Thread`](../../../../ui-components/thread.mdx) component this will display the thread.
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.

Expand Down
6 changes: 3 additions & 3 deletions docusaurus/docs/reactnative/hooks/poll/use-poll-state.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ A property containing the number of answers (comments) to the `poll`.
| -------- |
| `number` |

### `created_by`
### `createdBy`

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`.

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

### `is_closed`
### `isClosed`

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

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

### `max_votes_allowed`
### `maxVotesAllowed`

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

Expand Down
2 changes: 1 addition & 1 deletion docusaurus/docs/reactnative/ui-components/thread.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const App = () => {
return (
<OverlayProvider>
<Chat client={client}>
<Channel channel={channel} thread={messageId} threadList>
<Channel channel={channel} thread={message} threadList>
// highlight-next-line
<Thread />
</Channel>
Expand Down
6 changes: 4 additions & 2 deletions package/src/components/Channel/Channel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2516,8 +2516,10 @@ const ChannelWithContext = <

export type ChannelProps<
StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
> = Partial<Omit<ChannelPropsWithContext<StreamChatGenerics>, 'channel'>> &
Pick<ChannelPropsWithContext<StreamChatGenerics>, 'channel'>;
> = Partial<Omit<ChannelPropsWithContext<StreamChatGenerics>, 'channel' | 'thread'>> &
Pick<ChannelPropsWithContext<StreamChatGenerics>, 'channel'> & {
thread?: MessageType<StreamChatGenerics> | ThreadType<StreamChatGenerics> | null;
};

/**
*
Expand Down

0 comments on commit d7deaf4

Please sign in to comment.