You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
1. Merged "ChannelPreview" and "Preview (ChannelPreview)" into a single,
less confusing article.
2. Removed repeating "channel this" and "channel that" prefix from
Channel List subarticles.
3. Moved the section describing `searchForChannels` prop from Cookbook
to UI Components.
4. Moved AppMenu to its own Cookbook page.
5. Reduced nesting in Cookbook sidebar.
The [`ChannelList`](../core-components/channel-list.mdx)property`Preview` is a UI placeholder (think of it as a UI of a `ChannelList` item) which receives props through the `ChannelList` and the [`ChannelPreview`](./channel-preview.mdx) wrapper which extends these props with additional UI-specific items and renders it. Apart from the UI the `Preview` component is also responsible for channel selection (click handler).
8
+
The [`ChannelList`](../core-components/channel-list.mdx)prop`Preview`allows you to override the preview component which is rendered for each channel in the list (think of it as the UI of a `ChannelList` item). The component passed as the `Preview` will receive props from the `ChannelList` and the `ChannelPreview` wrapper (which extends these props with additional UI-specific items and renders it). Apart from the UI the `Preview` component is also responsible for channel selection (click handler).
9
9
10
10
The `Preview` property defaults to [`ChannelPreviewMessenger`](https://github.com/GetStream/stream-chat-react/blob/master/src/components/ChannelPreview/ChannelPreviewMessenger.tsx) component if no custom component is provided.
11
11
12
+
:::note
13
+
For even deeper customization of the channel list and channel previews, use the [`renderChannels`](../core-components/channel-list.mdx#renderchannels) prop of the `ChannelList` component. Note, however, that using a custom channel list renderer requires more work than overriding the preview UI.
14
+
:::
15
+
12
16
## Basic Usage
13
17
14
18
To customize the `ChannelList` item UI simply pass your custom `Preview` component to the `ChannelList`. See [The Preview Prop Component](../../guides/customization/channel-list-preview.mdx#the-preview-prop-component) for the extended guide.
Copy file name to clipboardExpand all lines: docusaurus/docs/React/components/utility-components/channel-search.mdx
+45-1
Original file line number
Diff line number
Diff line change
@@ -199,6 +199,48 @@ The search results can be rendered in place of the channel list or above the cha
199
199
200
200
The `ChannelSearch` offers possibility to keep the search results open meanwhile the user clicks between the search results. This behavior is controlled by [`clearSearchOnClickOutside`](./#clearsearchonclickoutside) flag. The selected channel is added to the channel list if it was not present there before the search.
201
201
202
+
## Customizing the search method
203
+
204
+
By default, the `ChannelSearch` component searches just for users. Use the `searchForChannels` prop to also search for channels.
205
+
206
+
To override the search method completely, use the `searchFunction` prop. This prop is useful, say, when you want to search only for channels
207
+
that the current logged in user is a member of. See the example below for this.
As of the version 10.0.0, users can add app menu into the `SearchBar`. In case you would like to display menu button next to the search input, you can do that by adding [`AppMenu` component](../../components/utility-components/channel-search.mdx/#appmenu) to the `ChannelSearch` props. The display of `AppMenu` is then toggled by clicking on the menu button. `AppMenu` can be rendered as a drop-down or even a modal. In our example we will render a drop-down menu.
9
+
10
+
:::caution
11
+
The SDK does not provide any default `AppMenu` component and so you will have to write your CSS for it to be styled correctly.
As of the version 10.0.0, users can add app menu into the `SearchBar`. In case you would like to display menu button next to the search input, you can do that by adding [`AppMenu` component](../../components/utility-components/channel-search.mdx/#appmenu) to the `ChannelSearch` props. The display of `AppMenu` is then toggled by clicking on the menu button. `AppMenu` can be rendered as a drop-down or even a modal. In our example we will render a drop-down menu.
356
-
357
-
:::caution
358
-
The SDK does not provide any default `AppMenu` component and so you will have to write your CSS for it to be styled correctly.
0 commit comments