Skip to content

Commit a0f48aa

Browse files
authored
Merge pull request #161 from sendbird/chore/new-list-params
chore(CLNP-2179): introduced new list query params
2 parents 58c79b3 + ea06673 commit a0f48aa

File tree

26 files changed

+110
-39
lines changed

26 files changed

+110
-39
lines changed

packages/uikit-chat-hooks/src/channel/useGroupChannelList/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ import type { UseGroupChannelList } from '../../types';
44
import { useGroupChannelListWithCollection } from './useGroupChannelListWithCollection';
55
import { useGroupChannelListWithQuery } from './useGroupChannelListWithQuery';
66

7+
/**
8+
* @deprecated This hook is deprecated and will be replaced by the 'uikit-tools' package.
9+
* */
710
export const useGroupChannelList: UseGroupChannelList = (sdk, userId, options) => {
811
if (sdk.isCacheEnabled || options?.enableCollectionWithoutLocalCache) {
912
if (options?.queryCreator) Logger.warn('`queryCreator` is ignored, please use `collectionCreator` instead.');

packages/uikit-chat-hooks/src/types.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ export interface CustomBidirectionalQueryInterface<Data> {
3333
}
3434

3535
/**
36+
* @deprecated This hook is deprecated and will be replaced by the 'uikit-tools' package.
37+
*
3638
* @interface UseGroupChannelList
3739
* @description interface for group channel list hook
3840
* */

packages/uikit-react-native/__template__/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,4 @@ export interface __domain__Module {
3333
StatusLoading: CommonComponent;
3434
}
3535

36-
export type __domain__Fragment = CommonComponent<__domain__Props['Fragment']>;
36+
export type __domain__Fragment = React.FC<__domain__Props['Fragment']>;

packages/uikit-react-native/src/domain/groupChannel/types.ts

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import type React from 'react';
22
import type { FlatList } from 'react-native';
33

4+
import type { MessageCollectionParams, MessageFilterParams } from '@sendbird/chat/groupChannel';
45
import type { UseGroupChannelMessagesOptions } from '@sendbird/uikit-chat-hooks';
56
import type {
67
OnBeforeHandler,
@@ -20,6 +21,7 @@ import type { ChannelMessageListProps } from '../../components/ChannelMessageLis
2021
import type { CommonComponent } from '../../types';
2122
import type { PubSub } from '../../utils/pubsub';
2223

24+
export type MessageListQueryParamsType = Omit<MessageCollectionParams, 'filter'> & MessageFilterParams;
2325
export interface GroupChannelProps {
2426
Fragment: {
2527
channel: SendbirdGroupChannel;
@@ -43,9 +45,19 @@ export interface GroupChannelProps {
4345
keyboardAvoidOffset?: GroupChannelProps['Provider']['keyboardAvoidOffset'];
4446
flatListProps?: GroupChannelProps['MessageList']['flatListProps'];
4547
sortComparator?: UseGroupChannelMessagesOptions['sortComparator'];
46-
collectionCreator?: UseGroupChannelMessagesOptions['collectionCreator'];
4748

4849
searchItem?: GroupChannelProps['MessageList']['searchItem'];
50+
51+
/**
52+
* @description You can specify the query parameters for the message list.
53+
* @example
54+
* ```
55+
* <GroupChannelFragment messageListQueryParams={{ prevResultLimit: 20, customTypesFilter: ['filter'] }} />
56+
* ```
57+
* */
58+
messageListQueryParams?: MessageListQueryParamsType;
59+
/** @deprecated Please use `messageListQueryParams` instead */
60+
collectionCreator?: UseGroupChannelMessagesOptions['collectionCreator'];
4961
};
5062
Header: {
5163
shouldHideRight: () => boolean;
@@ -169,7 +181,7 @@ export interface GroupChannelModule {
169181
StatusLoading: CommonComponent;
170182
}
171183

172-
export type GroupChannelFragment = CommonComponent<GroupChannelProps['Fragment']>;
184+
export type GroupChannelFragment = React.FC<GroupChannelProps['Fragment']>;
173185

174186
export type GroupChannelPubSubContextPayload =
175187
| {

packages/uikit-react-native/src/domain/groupChannelBannedUsers/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,4 @@ export interface GroupChannelBannedUsersModule {
4949
StatusError: CommonComponent<GroupChannelBannedUsersProps['StatusError']>;
5050
}
5151

52-
export type GroupChannelBannedUsersFragment = CommonComponent<GroupChannelBannedUsersProps['Fragment']>;
52+
export type GroupChannelBannedUsersFragment = React.FC<GroupChannelBannedUsersProps['Fragment']>;

packages/uikit-react-native/src/domain/groupChannelList/types.ts

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,32 @@
11
import type React from 'react';
22
import type { FlatListProps } from 'react-native';
33

4+
import type { GroupChannelCollectionParams, GroupChannelFilterParams } from '@sendbird/chat/groupChannel';
45
import type { UseGroupChannelListOptions } from '@sendbird/uikit-chat-hooks';
56
import type { ActionMenuItem } from '@sendbird/uikit-react-native-foundation';
67
import type { SendbirdGroupChannel } from '@sendbird/uikit-utils';
78

89
import type { CommonComponent } from '../../types';
910

11+
export type ChannelListQueryParamsType = Omit<GroupChannelCollectionParams, 'filter'> & GroupChannelFilterParams;
1012
export interface GroupChannelListProps {
1113
Fragment: {
1214
onPressChannel: GroupChannelListProps['List']['onPressChannel'];
1315
onPressCreateChannel: (channelType: GroupChannelType) => void;
1416
renderGroupChannelPreview?: GroupChannelListProps['List']['renderGroupChannelPreview'];
1517
skipTypeSelection?: boolean;
16-
collectionCreator?: UseGroupChannelListOptions['collectionCreator'];
1718
flatListProps?: GroupChannelListProps['List']['flatListProps'];
1819
menuItemCreator?: GroupChannelListProps['List']['menuItemCreator'];
20+
/**
21+
* @description You can specify the query parameters for the channel list.
22+
* @example
23+
* ```
24+
* <GroupChannelListFragment channelListQueryParams={{ limit: 20, includeEmpty: false }} />
25+
* ```
26+
* */
27+
channelListQueryParams?: ChannelListQueryParamsType;
28+
/** @deprecated Please use `channelListQueryParams` instead */
29+
collectionCreator?: UseGroupChannelListOptions['collectionCreator'];
1930
};
2031
Header: {};
2132
List: {
@@ -61,5 +72,5 @@ export interface GroupChannelListModule {
6172
StatusLoading: CommonComponent;
6273
}
6374

64-
export type GroupChannelListFragment = CommonComponent<GroupChannelListProps['Fragment']>;
75+
export type GroupChannelListFragment = React.FC<GroupChannelListProps['Fragment']>;
6576
export type GroupChannelType = 'GROUP' | 'SUPER_GROUP' | 'BROADCAST';

packages/uikit-react-native/src/domain/groupChannelModeration/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,4 @@ export interface GroupChannelModerationModule {
4545
Menu: CommonComponent<GroupChannelModerationProps['Menu']>;
4646
}
4747

48-
export type GroupChannelModerationFragment = CommonComponent<GroupChannelModerationProps['Fragment']>;
48+
export type GroupChannelModerationFragment = React.FC<GroupChannelModerationProps['Fragment']>;

packages/uikit-react-native/src/domain/groupChannelMutedMembers/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,4 @@ export interface GroupChannelMutedMembersModule {
4949
StatusError: CommonComponent<GroupChannelMutedMembersProps['StatusError']>;
5050
}
5151

52-
export type GroupChannelMutedMembersFragment = CommonComponent<GroupChannelMutedMembersProps['Fragment']>;
52+
export type GroupChannelMutedMembersFragment = React.FC<GroupChannelMutedMembersProps['Fragment']>;

packages/uikit-react-native/src/domain/groupChannelNotifications/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,4 @@ export interface GroupChannelNotificationsModule {
3535
View: CommonComponent<GroupChannelNotificationsProps['View']>;
3636
}
3737

38-
export type GroupChannelNotificationsFragment = CommonComponent<GroupChannelNotificationsProps['Fragment']>;
38+
export type GroupChannelNotificationsFragment = React.FC<GroupChannelNotificationsProps['Fragment']>;

packages/uikit-react-native/src/domain/groupChannelOperators/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,4 +51,4 @@ export interface GroupChannelOperatorsModule {
5151
StatusError: CommonComponent<GroupChannelOperatorsProps['StatusError']>;
5252
}
5353

54-
export type GroupChannelOperatorsFragment = CommonComponent<GroupChannelOperatorsProps['Fragment']>;
54+
export type GroupChannelOperatorsFragment = React.FC<GroupChannelOperatorsProps['Fragment']>;

0 commit comments

Comments
 (0)