Skip to content

Commit f9752d4

Browse files
authored
feat: allow to customize ChannelListHeader (#3234)
1 parent 5106de2 commit f9752d4

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

‎src/components/ChannelList/ChannelList.tsx‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ import {
3939
import { moveChannelUpwards } from './utils';
4040
import type { TranslationContextValue } from '../../context/TranslationContext';
4141
import type { PaginatorProps } from '../../types/types';
42-
import { ChannelListHeader } from './ChannelListHeader';
42+
import { ChannelListHeader as DefaultChannelListHeader } from './ChannelListHeader';
4343
import { useStableId } from '../UtilityComponents/useStableId';
4444

4545
const DEFAULT_FILTERS = {};
@@ -194,6 +194,7 @@ const UnMemoizedChannelList = (props: ChannelListProps) => {
194194
useImageFlagEmojisOnWindows,
195195
} = useChatContext('ChannelList');
196196
const {
197+
ChannelListHeader = DefaultChannelListHeader,
197198
ChannelListUI = DefaultChannelListUI,
198199
NotificationList = DefaultNotificationList,
199200
Search = DefaultSearch,

‎src/context/ComponentContext.tsx‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,8 @@ export type ComponentContextValue = {
113113
CalloutDialog?: React.ComponentType<CalloutDialogProps>;
114114
/** Custom UI component shown instead of the image when it fails to load, defaults to and accepts same props as: [ImagePlaceholder](https://github.com/GetStream/stream-chat-react/blob/master/src/components/BaseImage/ImagePlaceholder.tsx) */
115115
ImagePlaceholder?: React.ComponentType<ImagePlaceholderProps>;
116+
/** Custom UI component to display the header of the `ChannelList`, defaults to and accepts same props as: [ChannelListHeader](https://github.com/GetStream/stream-chat-react/blob/master/src/components/ChannelList/ChannelListHeader.tsx) */
117+
ChannelListHeader?: React.ComponentType;
116118
/** Custom UI component to display the container for the queried channels, defaults to and accepts same props as: [ChannelListUI](https://github.com/GetStream/stream-chat-react/blob/master/src/components/ChannelList/ChannelListUI.tsx) */
117119
ChannelListUI?: React.ComponentType<ChannelListUIProps>;
118120
/** Custom UI component to display set of action buttons within `ChannelListItemUI` component, accepts same props as: [ChannelListItemActionButtons](https://github.com/GetStream/stream-chat-react/blob/master/src/components/ChannelList/ChannelListItemActionButtons.tsx) */

0 commit comments

Comments
 (0)