Skip to content

Commit 863f044

Browse files
authored
Merge pull request #162 from sendbird/docs/update
test(CLNP-2197): update docs-validation for new props
2 parents a0f48aa + 8172319 commit 863f044

File tree

3 files changed

+25
-1
lines changed

3 files changed

+25
-1
lines changed

docs-validation/4_key-functions/ChattingInAChannel/ChatInAGroupChannel.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,11 @@ const GroupChannelScreen2 = ({ route: { params } }: any) => {
141141
}
142142
return <GroupChannelMessageRenderer {...props} />
143143
}}
144+
// Apply query parameters for message list
145+
messageListQueryParams={{
146+
prevResultLimit: 20,
147+
customTypesFilter: ['filter']
148+
}}
144149
/>
145150
);
146151
};

docs-validation/4_key-functions/ListChannels.tsx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import type { GroupChannelListContextsType, GroupChannelListModule } from '@sendbird/uikit-react-native';
22
import React, { useContext, useLayoutEffect } from 'react';
33

4+
const CustomChannelPreview = (_:object) => <></>
5+
46
/**
57
* Usage
68
* {@link https://sendbird.com/docs/chat/uikit/v3/react-native/key-functions/list-channels#2-usage}
@@ -107,6 +109,15 @@ const CustomGroupChannelListScreen2 = () => {
107109
<GroupChannelListFragment2
108110
onPressCreateChannel={navigateToGroupChannelCreateScreen}
109111
onPressChannel={navigateToGroupChannelScreen}
112+
// Render custom channel preview
113+
renderGroupChannelPreview={(props) => {
114+
return <CustomChannelPreview {...props} />;
115+
}}
116+
// Apply query parameters for channel list
117+
channelListQueryParams={{
118+
includeEmpty: true,
119+
includeFrozen: false,
120+
}}
110121
/>
111122
);
112123
};

packages/uikit-testing-tools/src/mocks/createMockChannel.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import {
33
BannedUserListQuery,
44
ChannelType,
5+
FileUploadResult,
56
MetaCounter,
67
MetaData,
78
MutedInfo,
@@ -24,8 +25,9 @@ import {
2425
OperatorFilter,
2526
ReadStatus,
2627
} from '@sendbird/chat/groupChannel';
27-
import type {
28+
import {
2829
BaseListQueryParams,
30+
DeliveryStatus,
2931
MultipleFilesMessageCreateParams,
3032
MultipleFilesMessageRequestHandler,
3133
PinnedMessageListQuery,
@@ -509,6 +511,9 @@ class MockChannel implements GetMockProps<Params, SendbirdBaseChannel & Sendbird
509511
getTypingUsers(): SendbirdMember[] {
510512
return [];
511513
}
514+
getDeliveryStatus(): { [p: string]: DeliveryStatus } {
515+
return {};
516+
}
512517

513518
getUndeliveredMemberCount = jest.fn(() => 0);
514519

@@ -638,4 +643,7 @@ class MockChannel implements GetMockProps<Params, SendbirdBaseChannel & Sendbird
638643
sendMultipleFilesMessage(_params: MultipleFilesMessageCreateParams): MultipleFilesMessageRequestHandler {
639644
throw new Error('Method not implemented.');
640645
}
646+
uploadFile(): Promise<FileUploadResult> {
647+
throw new Error('Method not implemented.');
648+
}
641649
}

0 commit comments

Comments
 (0)