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
fix: rename ChannelListMessenger to ChannelListUI (#3036)
## Renamed Components
| Old Name | New Name | Notes |
| ---------------------- | --------------- |
-------------------------------------------------------------------------------------------------------
|
| `ChannelListMessenger` | `ChannelListUI` | File renamed
`ChannelListMessenger.tsx` → `ChannelListUI.tsx`; export renamed in
`ChannelList/index.ts` |
## Renamed Types / Interfaces
| Old Name | New Name | Notes |
| --------------------------- | -------------------- |
------------------------------------ |
| `ChannelListMessengerProps` | `ChannelListUIProps` | Props type for
the renamed component |
## Renamed CSS Classes
| Old Name | New Name |
| ---------------------------------------- |
------------------------------------ |
| `str-chat__channel-list-messenger` | `str-chat__channel-list-inner` |
| `str-chat__channel-list-messenger__main` |
`str-chat__channel-list-inner__main` |
## Removed Props
### `ChannelListProps` (on `<ChannelList>`)
| Removed Prop | Type | Migration |
| ----------------------- |
------------------------------------------------- |
-------------------------------------------------------------- |
| `Avatar` | `React.ComponentType<ChannelAvatarProps>` | Use `Avatar`
slot slot in `ComponentContext` instead |
| `List` | `React.ComponentType<ChannelListMessengerProps>` | Use
`ChannelListUI` slot in `ComponentContext` instead |
| `LoadingErrorIndicator` |
`React.ComponentType<LoadingErrorIndicatorProps>` | Use
`LoadingErrorIndicator` slot in `ComponentContext` instead |
| `LoadingIndicator` | `React.ComponentType` | Use `LoadingIndicator`
slot in `ComponentContext` instead |
| `Preview` | `React.ComponentType<ChannelListItemUIProps>` | Use
`ChannelListItemUI` slot in `ComponentContext` instead |
### `ChannelListItemProps` (on `<ChannelListItem>`)
| Removed Prop | Type | Migration |
| ------------ | ----------------------------------------- |
-------------------------------------------------------------- |
| `Avatar` | `React.ComponentType<ChannelAvatarProps>` | Now sourced
from `ComponentContext` inside `ChannelListItemUI` |
### `ChannelListUIProps` (previously `ChannelListMessengerProps`)
| Removed Prop | Type | Migration |
| ----------------------- |
------------------------------------------------- |
---------------------------------------------------------- |
| `LoadingErrorIndicator` |
`React.ComponentType<LoadingErrorIndicatorProps>` | Now sourced from
`ComponentContext` inside `ChannelListUI` |
| `LoadingIndicator` | `React.ComponentType` | Now sourced from
`ComponentContext` inside `ChannelListUI` |
## New `ComponentContext` Slots
| Slot | Type | Description |
| --------------- | ----------------------------------------- |
--------------------------------------------------------------------------------------------
|
| `ChannelListUI` | `React.ComponentType<ChannelListUIProps>` | Custom
UI component for the channel list container (replaces `List` prop on
`<ChannelList>`) |
## Other Breaking Changes
- **Removed CSS class suffix:** The root `<ChannelList>` element no
longer applies the `str-chat__channel-list-react` class. Previously the
default was `str-chat__channel-list str-chat__channel-list-react`, now
it is just `str-chat__channel-list`.
BREAKING CHANGE: The `ChannelListMessenger` component has been renamed
to `ChannelListUI` (props type `ChannelListMessengerProps` ->
`ChannelListUIProps`). The corresponding CSS classes
`str-chat__channel-list-messenger` and
`str-chat__channel-list-messenger__main` have been renamed to
`str-chat__channel-list-inner` and `str-chat__channel-list-inner__main`
respectively. The `Avatar`, `List`, `LoadingErrorIndicator`,
`LoadingIndicator`, and `Preview` props have been removed from the
`ChannelList` component. The `Avatar` prop has also been removed from
`ChannelListItem`, and the `LoadingErrorIndicator` and
`LoadingIndicator` props have been removed from `ChannelListUI`. All of
these component overrides should now be provided through
`ComponentContext` instead of being passed as props directly. A new
`ChannelListUI` slot has been added to `ComponentContext`, replacing the
former `List` prop on `ChannelList`. Additionally, the
`str-chat__channel-list-react` CSS class is no longer applied to the
root `ChannelList` element.
@@ -63,8 +56,6 @@ export type ChannelListProps = {
63
56
* to false, which will prevent channels not in the list from incrementing the list. The default is true.
64
57
*/
65
58
allowNewMessagesFromUnfilteredChannels?: boolean;
66
-
/** UI component to display an avatar, defaults to [Avatar](https://github.com/GetStream/stream-chat-react/blob/master/src/components/Avatar/Avatar.tsx) component and accepts the same props as: [ChannelAvatar](https://github.com/GetStream/stream-chat-react/blob/master/src/components/Avatar/ChannelAvatar.tsx) */
67
-
Avatar?: React.ComponentType<ChannelAvatarProps>;
68
59
/** Optional function to filter channels prior to loading in the DOM. Do not use any complex or async logic that would delay the loading of the ChannelList. We recommend using a pure function with array methods like filter/sort/reduce. */
/** Custom UI component to display the container for the queried channels, defaults to and accepts same props as: [ChannelListMessenger](https://github.com/GetStream/stream-chat-react/blob/master/src/components/ChannelList/ChannelListMessenger.tsx) */
/** Custom UI component to display the loading state, defaults to and accepts same props as: [LoadingChannels](https://github.com/GetStream/stream-chat-react/blob/master/src/components/Loading/LoadingChannels.tsx) */
91
-
LoadingIndicator?: React.ComponentType;
92
77
/** When true, channels won't dynamically sort by most recent message */
93
78
lockChannelOrder?: boolean;
94
79
/** Function to override the default behavior when a user is added to a channel, corresponds to [notification.added\_to\_channel](https://getstream.io/chat/docs/javascript/event_object/?language=javascript) event */
@@ -140,8 +125,6 @@ export type ChannelListProps = {
140
125
options?: ChannelOptions;
141
126
/** Custom UI component to handle channel pagination logic, defaults to and accepts same props as: [LoadMorePaginator](https://github.com/GetStream/stream-chat-react/blob/master/src/components/LoadMore/LoadMorePaginator.tsx) */
/** Custom UI component to display the channel preview in the list, defaults to and accepts same props as: [ChannelPreviewMessenger](https://github.com/GetStream/stream-chat-react/blob/master/src/components/ChannelPreview/ChannelPreviewMessenger.tsx) */
@@ -47,8 +46,6 @@ export type ChannelListItemProps = {
47
46
active?: boolean;
48
47
/** Current selected channel object */
49
48
activeChannel?: Channel;
50
-
/** UI component to display an avatar, defaults to [Avatar](https://github.com/GetStream/stream-chat-react/blob/master/src/components/Avatar/Avatar.tsx) component and accepts the same props as: [ChannelAvatar](https://github.com/GetStream/stream-chat-react/blob/master/src/components/Avatar/ChannelAvatar.tsx) */
51
-
Avatar?: React.ComponentType<ChannelAvatarProps>;
52
49
/** Forces the update of preview component on channel update */
0 commit comments