@sendbird/uikit-react-native 3.4.0 → 3.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonjs/components/ChannelInput/index.js.map +1 -1
- package/lib/commonjs/components/ChannelMessageList/index.js.map +1 -1
- package/lib/commonjs/components/GroupChannelMessageRenderer/GroupChannelMessageOutgoingStatus.js +2 -2
- package/lib/commonjs/components/GroupChannelMessageRenderer/GroupChannelMessageOutgoingStatus.js.map +1 -1
- package/lib/commonjs/domain/groupChannel/types.js.map +1 -1
- package/lib/commonjs/domain/groupChannelBannedUsers/types.js.map +1 -1
- package/lib/commonjs/domain/groupChannelList/types.js.map +1 -1
- package/lib/commonjs/domain/groupChannelModeration/types.js.map +1 -1
- package/lib/commonjs/domain/groupChannelMutedMembers/types.js.map +1 -1
- package/lib/commonjs/domain/groupChannelNotifications/types.js.map +1 -1
- package/lib/commonjs/domain/groupChannelOperators/types.js.map +1 -1
- package/lib/commonjs/domain/groupChannelSettings/types.js.map +1 -1
- package/lib/commonjs/domain/groupChannelUserList/types.js.map +1 -1
- package/lib/commonjs/domain/messageSearch/types.js.map +1 -1
- package/lib/commonjs/domain/openChannel/types.js.map +1 -1
- package/lib/commonjs/domain/openChannelBannedUsers/types.js.map +1 -1
- package/lib/commonjs/domain/openChannelCreate/types.js.map +1 -1
- package/lib/commonjs/domain/openChannelList/types.js.map +1 -1
- package/lib/commonjs/domain/openChannelModeration/types.js.map +1 -1
- package/lib/commonjs/domain/openChannelMutedParticipants/types.js.map +1 -1
- package/lib/commonjs/domain/openChannelOperators/types.js.map +1 -1
- package/lib/commonjs/domain/openChannelSettings/types.js.map +1 -1
- package/lib/commonjs/domain/openChannelUserList/types.js.map +1 -1
- package/lib/commonjs/fragments/createGroupChannelFragment.js +18 -3
- package/lib/commonjs/fragments/createGroupChannelFragment.js.map +1 -1
- package/lib/commonjs/fragments/createGroupChannelListFragment.js +29 -15
- package/lib/commonjs/fragments/createGroupChannelListFragment.js.map +1 -1
- package/lib/commonjs/types.js.map +1 -1
- package/lib/commonjs/version.js +1 -1
- package/lib/commonjs/version.js.map +1 -1
- package/lib/module/components/ChannelInput/index.js.map +1 -1
- package/lib/module/components/ChannelMessageList/index.js.map +1 -1
- package/lib/module/components/GroupChannelMessageRenderer/GroupChannelMessageOutgoingStatus.js +2 -2
- package/lib/module/components/GroupChannelMessageRenderer/GroupChannelMessageOutgoingStatus.js.map +1 -1
- package/lib/module/domain/groupChannel/types.js.map +1 -1
- package/lib/module/domain/groupChannelBannedUsers/types.js.map +1 -1
- package/lib/module/domain/groupChannelList/types.js.map +1 -1
- package/lib/module/domain/groupChannelModeration/types.js.map +1 -1
- package/lib/module/domain/groupChannelMutedMembers/types.js.map +1 -1
- package/lib/module/domain/groupChannelNotifications/types.js.map +1 -1
- package/lib/module/domain/groupChannelOperators/types.js.map +1 -1
- package/lib/module/domain/groupChannelSettings/types.js.map +1 -1
- package/lib/module/domain/groupChannelUserList/types.js.map +1 -1
- package/lib/module/domain/messageSearch/types.js.map +1 -1
- package/lib/module/domain/openChannel/types.js.map +1 -1
- package/lib/module/domain/openChannelBannedUsers/types.js.map +1 -1
- package/lib/module/domain/openChannelCreate/types.js.map +1 -1
- package/lib/module/domain/openChannelList/types.js.map +1 -1
- package/lib/module/domain/openChannelModeration/types.js.map +1 -1
- package/lib/module/domain/openChannelMutedParticipants/types.js.map +1 -1
- package/lib/module/domain/openChannelOperators/types.js.map +1 -1
- package/lib/module/domain/openChannelSettings/types.js.map +1 -1
- package/lib/module/domain/openChannelUserList/types.js.map +1 -1
- package/lib/module/fragments/createGroupChannelFragment.js +18 -3
- package/lib/module/fragments/createGroupChannelFragment.js.map +1 -1
- package/lib/module/fragments/createGroupChannelListFragment.js +30 -16
- package/lib/module/fragments/createGroupChannelListFragment.js.map +1 -1
- package/lib/module/types.js.map +1 -1
- package/lib/module/version.js +1 -1
- package/lib/module/version.js.map +1 -1
- package/lib/typescript/src/components/ChannelInput/index.d.ts +2 -2
- package/lib/typescript/src/components/ChannelMessageList/index.d.ts +4 -5
- package/lib/typescript/src/containers/SendbirdUIKitContainer.d.ts +1 -1
- package/lib/typescript/src/domain/groupChannel/types.d.ts +13 -2
- package/lib/typescript/src/domain/groupChannelBannedUsers/types.d.ts +1 -1
- package/lib/typescript/src/domain/groupChannelList/types.d.ts +13 -2
- package/lib/typescript/src/domain/groupChannelModeration/types.d.ts +1 -1
- package/lib/typescript/src/domain/groupChannelMutedMembers/types.d.ts +1 -1
- package/lib/typescript/src/domain/groupChannelNotifications/types.d.ts +1 -1
- package/lib/typescript/src/domain/groupChannelOperators/types.d.ts +1 -1
- package/lib/typescript/src/domain/groupChannelSettings/types.d.ts +1 -1
- package/lib/typescript/src/domain/groupChannelUserList/types.d.ts +3 -2
- package/lib/typescript/src/domain/messageSearch/types.d.ts +1 -1
- package/lib/typescript/src/domain/openChannel/types.d.ts +1 -1
- package/lib/typescript/src/domain/openChannelBannedUsers/types.d.ts +1 -1
- package/lib/typescript/src/domain/openChannelCreate/types.d.ts +1 -1
- package/lib/typescript/src/domain/openChannelList/types.d.ts +1 -1
- package/lib/typescript/src/domain/openChannelModeration/types.d.ts +1 -1
- package/lib/typescript/src/domain/openChannelMutedParticipants/types.d.ts +1 -1
- package/lib/typescript/src/domain/openChannelOperators/types.d.ts +1 -1
- package/lib/typescript/src/domain/openChannelSettings/types.d.ts +1 -1
- package/lib/typescript/src/domain/openChannelUserList/types.d.ts +3 -3
- package/lib/typescript/src/types.d.ts +4 -4
- package/lib/typescript/src/version.d.ts +1 -1
- package/package.json +5 -5
- package/src/components/ChannelInput/index.tsx +2 -2
- package/src/components/ChannelMessageList/index.tsx +4 -10
- package/src/components/GroupChannelMessageRenderer/GroupChannelMessageOutgoingStatus.tsx +3 -3
- package/src/domain/groupChannel/types.ts +14 -2
- package/src/domain/groupChannelBannedUsers/types.ts +1 -1
- package/src/domain/groupChannelList/types.ts +13 -2
- package/src/domain/groupChannelModeration/types.ts +1 -1
- package/src/domain/groupChannelMutedMembers/types.ts +1 -1
- package/src/domain/groupChannelNotifications/types.ts +1 -1
- package/src/domain/groupChannelOperators/types.ts +1 -1
- package/src/domain/groupChannelSettings/types.ts +1 -1
- package/src/domain/groupChannelUserList/types.ts +2 -2
- package/src/domain/messageSearch/types.ts +1 -1
- package/src/domain/openChannel/types.ts +1 -1
- package/src/domain/openChannelBannedUsers/types.ts +1 -1
- package/src/domain/openChannelCreate/types.ts +1 -1
- package/src/domain/openChannelList/types.ts +1 -1
- package/src/domain/openChannelModeration/types.ts +1 -1
- package/src/domain/openChannelMutedParticipants/types.ts +1 -1
- package/src/domain/openChannelOperators/types.ts +1 -1
- package/src/domain/openChannelSettings/types.ts +1 -1
- package/src/domain/openChannelUserList/types.ts +4 -3
- package/src/fragments/createGroupChannelFragment.tsx +21 -5
- package/src/fragments/createGroupChannelListFragment.tsx +31 -13
- package/src/types.ts +2 -2
- package/src/version.ts +1 -1
|
@@ -1,21 +1,32 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
2
|
import type { FlatListProps } from 'react-native';
|
|
3
3
|
|
|
4
|
+
import type { GroupChannelCollectionParams, GroupChannelFilterParams } from '@sendbird/chat/groupChannel';
|
|
4
5
|
import type { UseGroupChannelListOptions } from '@sendbird/uikit-chat-hooks';
|
|
5
6
|
import type { ActionMenuItem } from '@sendbird/uikit-react-native-foundation';
|
|
6
7
|
import type { SendbirdGroupChannel } from '@sendbird/uikit-utils';
|
|
7
8
|
|
|
8
9
|
import type { CommonComponent } from '../../types';
|
|
9
10
|
|
|
11
|
+
export type ChannelListQueryParamsType = Omit<GroupChannelCollectionParams, 'filter'> & GroupChannelFilterParams;
|
|
10
12
|
export interface GroupChannelListProps {
|
|
11
13
|
Fragment: {
|
|
12
14
|
onPressChannel: GroupChannelListProps['List']['onPressChannel'];
|
|
13
15
|
onPressCreateChannel: (channelType: GroupChannelType) => void;
|
|
14
16
|
renderGroupChannelPreview?: GroupChannelListProps['List']['renderGroupChannelPreview'];
|
|
15
17
|
skipTypeSelection?: boolean;
|
|
16
|
-
collectionCreator?: UseGroupChannelListOptions['collectionCreator'];
|
|
17
18
|
flatListProps?: GroupChannelListProps['List']['flatListProps'];
|
|
18
19
|
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'];
|
|
19
30
|
};
|
|
20
31
|
Header: {};
|
|
21
32
|
List: {
|
|
@@ -61,5 +72,5 @@ export interface GroupChannelListModule {
|
|
|
61
72
|
StatusLoading: CommonComponent;
|
|
62
73
|
}
|
|
63
74
|
|
|
64
|
-
export type GroupChannelListFragment =
|
|
75
|
+
export type GroupChannelListFragment = React.FC<GroupChannelListProps['Fragment']>;
|
|
65
76
|
export type GroupChannelType = 'GROUP' | 'SUPER_GROUP' | 'BROADCAST';
|
|
@@ -45,4 +45,4 @@ export interface GroupChannelModerationModule {
|
|
|
45
45
|
Menu: CommonComponent<GroupChannelModerationProps['Menu']>;
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
-
export type GroupChannelModerationFragment =
|
|
48
|
+
export type GroupChannelModerationFragment = React.FC<GroupChannelModerationProps['Fragment']>;
|
|
@@ -49,4 +49,4 @@ export interface GroupChannelMutedMembersModule {
|
|
|
49
49
|
StatusError: CommonComponent<GroupChannelMutedMembersProps['StatusError']>;
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
-
export type GroupChannelMutedMembersFragment =
|
|
52
|
+
export type GroupChannelMutedMembersFragment = React.FC<GroupChannelMutedMembersProps['Fragment']>;
|
|
@@ -35,4 +35,4 @@ export interface GroupChannelNotificationsModule {
|
|
|
35
35
|
View: CommonComponent<GroupChannelNotificationsProps['View']>;
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
-
export type GroupChannelNotificationsFragment =
|
|
38
|
+
export type GroupChannelNotificationsFragment = React.FC<GroupChannelNotificationsProps['Fragment']>;
|
|
@@ -51,4 +51,4 @@ export interface GroupChannelOperatorsModule {
|
|
|
51
51
|
StatusError: CommonComponent<GroupChannelOperatorsProps['StatusError']>;
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
export type GroupChannelOperatorsFragment =
|
|
54
|
+
export type GroupChannelOperatorsFragment = React.FC<GroupChannelOperatorsProps['Fragment']>;
|
|
@@ -53,4 +53,4 @@ export interface GroupChannelSettingsModule {
|
|
|
53
53
|
Menu: CommonComponent<GroupChannelSettingsProps['Menu']>;
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
-
export type GroupChannelSettingsFragment =
|
|
56
|
+
export type GroupChannelSettingsFragment = React.FC<GroupChannelSettingsProps['Fragment']>;
|
|
@@ -52,7 +52,7 @@ export interface GroupChannelMembersProps {
|
|
|
52
52
|
queryCreator?: UseUserListOptions<SendbirdMember>['queryCreator'];
|
|
53
53
|
};
|
|
54
54
|
}
|
|
55
|
-
export type GroupChannelMembersFragment =
|
|
55
|
+
export type GroupChannelMembersFragment = React.FC<GroupChannelMembersProps['Fragment']>;
|
|
56
56
|
|
|
57
57
|
export interface GroupChannelRegisterOperatorProps {
|
|
58
58
|
Fragment: {
|
|
@@ -64,4 +64,4 @@ export interface GroupChannelRegisterOperatorProps {
|
|
|
64
64
|
queryCreator?: UseUserListOptions<SendbirdMember>['queryCreator'];
|
|
65
65
|
};
|
|
66
66
|
}
|
|
67
|
-
export type GroupChannelRegisterOperatorFragment =
|
|
67
|
+
export type GroupChannelRegisterOperatorFragment = React.FC<GroupChannelRegisterOperatorProps['Fragment']>;
|
|
@@ -52,4 +52,4 @@ export interface MessageSearchModule {
|
|
|
52
52
|
StatusError: CommonComponent<MessageSearchProps['StatusError']>;
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
-
export type MessageSearchFragment =
|
|
55
|
+
export type MessageSearchFragment = React.FC<MessageSearchProps['Fragment']>;
|
|
@@ -111,7 +111,7 @@ export interface OpenChannelModule {
|
|
|
111
111
|
StatusLoading: CommonComponent;
|
|
112
112
|
}
|
|
113
113
|
|
|
114
|
-
export type OpenChannelFragment =
|
|
114
|
+
export type OpenChannelFragment = React.FC<OpenChannelProps['Fragment']>;
|
|
115
115
|
|
|
116
116
|
export type OpenChannelPubSubContextPayload =
|
|
117
117
|
| {
|
|
@@ -49,4 +49,4 @@ export interface OpenChannelBannedUsersModule {
|
|
|
49
49
|
StatusError: CommonComponent<OpenChannelBannedUsersProps['StatusError']>;
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
-
export type OpenChannelBannedUsersFragment =
|
|
52
|
+
export type OpenChannelBannedUsersFragment = React.FC<OpenChannelBannedUsersProps['Fragment']>;
|
|
@@ -42,4 +42,4 @@ export interface OpenChannelCreateModule {
|
|
|
42
42
|
StatusLoading: CommonComponent;
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
export type OpenChannelCreateFragment =
|
|
45
|
+
export type OpenChannelCreateFragment = React.FC<OpenChannelCreateProps['Fragment']>;
|
|
@@ -53,4 +53,4 @@ export interface OpenChannelListModule {
|
|
|
53
53
|
StatusError: CommonComponent<OpenChannelListProps['StatusError']>;
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
-
export type OpenChannelListFragment =
|
|
56
|
+
export type OpenChannelListFragment = React.FC<OpenChannelListProps['Fragment']>;
|
|
@@ -45,4 +45,4 @@ export interface OpenChannelModerationModule {
|
|
|
45
45
|
Menu: CommonComponent<OpenChannelModerationProps['Menu']>;
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
-
export type OpenChannelModerationFragment =
|
|
48
|
+
export type OpenChannelModerationFragment = React.FC<OpenChannelModerationProps['Fragment']>;
|
|
@@ -49,4 +49,4 @@ export interface OpenChannelMutedParticipantsModule {
|
|
|
49
49
|
StatusError: CommonComponent<OpenChannelMutedParticipantsProps['StatusError']>;
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
-
export type OpenChannelMutedParticipantsFragment =
|
|
52
|
+
export type OpenChannelMutedParticipantsFragment = React.FC<OpenChannelMutedParticipantsProps['Fragment']>;
|
|
@@ -51,4 +51,4 @@ export interface OpenChannelOperatorsModule {
|
|
|
51
51
|
StatusError: CommonComponent<OpenChannelOperatorsProps['StatusError']>;
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
export type OpenChannelOperatorsFragment =
|
|
54
|
+
export type OpenChannelOperatorsFragment = React.FC<OpenChannelOperatorsProps['Fragment']>;
|
|
@@ -51,4 +51,4 @@ export interface OpenChannelSettingsModule {
|
|
|
51
51
|
Menu: CommonComponent<OpenChannelSettingsProps['Menu']>;
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
export type OpenChannelSettingsFragment =
|
|
54
|
+
export type OpenChannelSettingsFragment = React.FC<OpenChannelSettingsProps['Fragment']>;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
|
|
1
3
|
import type { UseUserListOptions } from '@sendbird/uikit-chat-hooks';
|
|
2
4
|
import type { SendbirdOpenChannel, SendbirdParticipant, SendbirdUser } from '@sendbird/uikit-utils';
|
|
3
5
|
|
|
4
|
-
import type { CommonComponent } from '../../types';
|
|
5
6
|
import type { UserListProps } from '../userList/types';
|
|
6
7
|
|
|
7
8
|
export interface OpenChannelParticipantsProps {
|
|
@@ -14,7 +15,7 @@ export interface OpenChannelParticipantsProps {
|
|
|
14
15
|
sortComparator?: UseUserListOptions<SendbirdUser | SendbirdParticipant>['sortComparator'];
|
|
15
16
|
};
|
|
16
17
|
}
|
|
17
|
-
export type OpenChannelParticipantsFragment =
|
|
18
|
+
export type OpenChannelParticipantsFragment = React.FC<OpenChannelParticipantsProps['Fragment']>;
|
|
18
19
|
|
|
19
20
|
export interface OpenChannelRegisterOperatorProps {
|
|
20
21
|
Fragment: {
|
|
@@ -27,4 +28,4 @@ export interface OpenChannelRegisterOperatorProps {
|
|
|
27
28
|
sortComparator?: UseUserListOptions<SendbirdUser | SendbirdParticipant>['sortComparator'];
|
|
28
29
|
};
|
|
29
30
|
}
|
|
30
|
-
export type OpenChannelRegisterOperatorFragment =
|
|
31
|
+
export type OpenChannelRegisterOperatorFragment = React.FC<OpenChannelRegisterOperatorProps['Fragment']>;
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import React, { useCallback, useEffect, useMemo, useState } from 'react';
|
|
2
2
|
|
|
3
|
+
import { MessageCollection, MessageFilter } from '@sendbird/chat/groupChannel';
|
|
3
4
|
import { ReplyType } from '@sendbird/chat/message';
|
|
4
5
|
import { Box } from '@sendbird/uikit-react-native-foundation';
|
|
5
6
|
import { useGroupChannelMessages } from '@sendbird/uikit-tools';
|
|
7
|
+
import type { SendbirdFileMessage, SendbirdGroupChannel, SendbirdUserMessage } from '@sendbird/uikit-utils';
|
|
6
8
|
import {
|
|
7
9
|
NOOP,
|
|
8
10
|
PASS,
|
|
9
|
-
SendbirdFileMessage,
|
|
10
|
-
SendbirdGroupChannel,
|
|
11
|
-
SendbirdUserMessage,
|
|
12
11
|
confirmAndMarkAsRead,
|
|
13
12
|
messageComparator,
|
|
14
13
|
useFreshCallback,
|
|
@@ -52,9 +51,10 @@ const createGroupChannelFragment = (initModule?: Partial<GroupChannelModule>): G
|
|
|
52
51
|
onBeforeUpdateFileMessage = PASS,
|
|
53
52
|
channel,
|
|
54
53
|
keyboardAvoidOffset,
|
|
55
|
-
collectionCreator,
|
|
56
54
|
sortComparator = messageComparator,
|
|
57
55
|
flatListProps,
|
|
56
|
+
messageListQueryParams,
|
|
57
|
+
collectionCreator,
|
|
58
58
|
}) => {
|
|
59
59
|
const { playerService, recorderService } = usePlatformService();
|
|
60
60
|
const { sdk, currentUser, sbOptions } = useSendbirdChat();
|
|
@@ -96,7 +96,7 @@ const createGroupChannelFragment = (initModule?: Partial<GroupChannelModule>): G
|
|
|
96
96
|
},
|
|
97
97
|
onChannelDeleted,
|
|
98
98
|
onCurrentUserBanned: onChannelDeleted,
|
|
99
|
-
collectionCreator,
|
|
99
|
+
collectionCreator: getCollectionCreator(channel, messageListQueryParams, collectionCreator),
|
|
100
100
|
sortComparator,
|
|
101
101
|
markAsRead: confirmAndMarkAsRead,
|
|
102
102
|
replyType,
|
|
@@ -260,4 +260,20 @@ function shouldRenderInput(channel: SendbirdGroupChannel) {
|
|
|
260
260
|
return true;
|
|
261
261
|
}
|
|
262
262
|
|
|
263
|
+
function getCollectionCreator(
|
|
264
|
+
channel: SendbirdGroupChannel,
|
|
265
|
+
messageListQueryParams?: GroupChannelProps['Fragment']['messageListQueryParams'],
|
|
266
|
+
deprecatedCreatorProp?: () => MessageCollection,
|
|
267
|
+
) {
|
|
268
|
+
if (!messageListQueryParams && deprecatedCreatorProp) return deprecatedCreatorProp;
|
|
269
|
+
|
|
270
|
+
return (defaultParams: GroupChannelProps['Fragment']['messageListQueryParams']) => {
|
|
271
|
+
const params = { ...defaultParams, ...messageListQueryParams };
|
|
272
|
+
return channel.createMessageCollection({
|
|
273
|
+
...params,
|
|
274
|
+
filter: new MessageFilter(params),
|
|
275
|
+
});
|
|
276
|
+
};
|
|
277
|
+
}
|
|
278
|
+
|
|
263
279
|
export default createGroupChannelFragment;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { GroupChannelCollection, GroupChannelFilter } from '@sendbird/chat/groupChannel';
|
|
4
|
+
import { useGroupChannelList } from '@sendbird/uikit-tools';
|
|
5
|
+
import { PASS, SendbirdChatSDK, confirmAndMarkAsDelivered, useAppState, useFreshCallback } from '@sendbird/uikit-utils';
|
|
5
6
|
|
|
6
7
|
import StatusComposition from '../components/StatusComposition';
|
|
7
8
|
import GroupChannelPreviewContainer from '../containers/GroupChannelPreviewContainer';
|
|
@@ -18,23 +19,24 @@ const createGroupChannelListFragment = (initModule?: Partial<GroupChannelListMod
|
|
|
18
19
|
return ({
|
|
19
20
|
onPressChannel,
|
|
20
21
|
onPressCreateChannel,
|
|
21
|
-
collectionCreator,
|
|
22
22
|
renderGroupChannelPreview,
|
|
23
23
|
skipTypeSelection = false,
|
|
24
24
|
flatListProps = {},
|
|
25
25
|
menuItemCreator = PASS,
|
|
26
|
+
channelListQueryParams,
|
|
27
|
+
collectionCreator,
|
|
26
28
|
}) => {
|
|
27
|
-
const { sdk,
|
|
28
|
-
const { groupChannels,
|
|
29
|
-
collectionCreator,
|
|
30
|
-
|
|
29
|
+
const { sdk, sbOptions, markAsDeliveredWithChannel } = useSendbirdChat();
|
|
30
|
+
const { groupChannels, loadMore, initialized } = useGroupChannelList(sdk, {
|
|
31
|
+
collectionCreator: getCollectionCreator(sdk, channelListQueryParams, collectionCreator),
|
|
32
|
+
markAsDelivered: confirmAndMarkAsDelivered,
|
|
31
33
|
});
|
|
32
34
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
+
useAppState('change', (status) => {
|
|
36
|
+
if (sbOptions.appInfo.deliveryReceiptEnabled) {
|
|
35
37
|
if (status === 'active') groupChannels.forEach(markAsDeliveredWithChannel);
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
+
}
|
|
39
|
+
});
|
|
38
40
|
|
|
39
41
|
const _renderGroupChannelPreview: GroupChannelListProps['List']['renderGroupChannelPreview'] = useFreshCallback(
|
|
40
42
|
(props) => {
|
|
@@ -49,13 +51,13 @@ const createGroupChannelListFragment = (initModule?: Partial<GroupChannelListMod
|
|
|
49
51
|
return (
|
|
50
52
|
<GroupChannelListModule.Provider>
|
|
51
53
|
<GroupChannelListModule.Header />
|
|
52
|
-
<StatusComposition loading={
|
|
54
|
+
<StatusComposition loading={!initialized} LoadingComponent={<GroupChannelListModule.StatusLoading />}>
|
|
53
55
|
<GroupChannelListModule.List
|
|
54
56
|
onPressChannel={onPressChannel}
|
|
55
57
|
menuItemCreator={menuItemCreator}
|
|
56
58
|
renderGroupChannelPreview={_renderGroupChannelPreview}
|
|
57
59
|
groupChannels={groupChannels}
|
|
58
|
-
onLoadNext={
|
|
60
|
+
onLoadNext={loadMore}
|
|
59
61
|
flatListProps={{
|
|
60
62
|
ListEmptyComponent: <GroupChannelListModule.StatusEmpty />,
|
|
61
63
|
contentContainerStyle: { flexGrow: 1 },
|
|
@@ -72,4 +74,20 @@ const createGroupChannelListFragment = (initModule?: Partial<GroupChannelListMod
|
|
|
72
74
|
};
|
|
73
75
|
};
|
|
74
76
|
|
|
77
|
+
function getCollectionCreator(
|
|
78
|
+
sdk: SendbirdChatSDK,
|
|
79
|
+
channelListQueryParams?: GroupChannelListProps['Fragment']['channelListQueryParams'],
|
|
80
|
+
deprecatedCreatorProp?: () => GroupChannelCollection,
|
|
81
|
+
) {
|
|
82
|
+
if (!channelListQueryParams && deprecatedCreatorProp) return deprecatedCreatorProp;
|
|
83
|
+
|
|
84
|
+
return (defaultParams: GroupChannelListProps['Fragment']['channelListQueryParams']) => {
|
|
85
|
+
const params = { ...defaultParams, ...channelListQueryParams };
|
|
86
|
+
return sdk.groupChannel.createGroupChannelCollection({
|
|
87
|
+
...params,
|
|
88
|
+
filter: new GroupChannelFilter(params),
|
|
89
|
+
});
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
|
|
75
93
|
export default createGroupChannelListFragment;
|
package/src/types.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ErrorInfo, ReactNode } from 'react';
|
|
1
|
+
import type { ComponentType, ErrorInfo, ReactNode } from 'react';
|
|
2
2
|
|
|
3
3
|
import type { SendbirdUser } from '@sendbird/uikit-utils';
|
|
4
4
|
|
|
@@ -17,7 +17,7 @@ export interface LocalCacheStorage {
|
|
|
17
17
|
|
|
18
18
|
export type ErrorBoundaryProps = { error: Error; errorInfo: ErrorInfo; reset: () => void };
|
|
19
19
|
|
|
20
|
-
export type CommonComponent<P = {}> =
|
|
20
|
+
export type CommonComponent<P = {}> = ComponentType<P & { children?: ReactNode | undefined }>;
|
|
21
21
|
|
|
22
22
|
export type MentionedUser = {
|
|
23
23
|
range: Range;
|
package/src/version.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const VERSION = '3.4.
|
|
1
|
+
const VERSION = '3.4.2';
|
|
2
2
|
export default VERSION;
|