@tencent-rtc/mcp 1.3.4 → 1.3.6
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/index.js +4 -4
- package/index.js.map +1 -1
- package/package.json +1 -1
- package/resource/doc/chatuikit/android/features/theme.md +363 -0
- package/resource/doc/chatuikit/{android/client_api_Android.md → faq/android_sdk/client-api.md} +0 -2
- package/resource/doc/chatuikit/faq/common/product.md +8 -0
- package/resource/doc/chatuikit/faq/flutter_sdk/faq.md +53 -0
- package/resource/doc/chatuikit/{iOS/client_api_iOS.md → faq/ios_sdk/client-api.md} +0 -2
- package/resource/doc/chatuikit/flutter/features/theme.md +379 -0
- package/resource/doc/chatuikit/flutter/integration.md +413 -0
- package/resource/doc/chatuikit/flutter/workflow.md +941 -0
- package/resource/doc/chatuikit/iOS/features/theme.md +416 -0
- package/resource/doc/chatuikit/react/components/chat-setting.md +86 -0
- package/resource/doc/chatuikit/react/components/contact-list.md +1093 -0
- package/resource/doc/chatuikit/react/components/search.md +745 -0
- package/resource/doc/chatuikit/vue/components/chat-setting.md +64 -0
- package/resource/doc/chatuikit/vue/components/contact-list.md +679 -0
- package/resource/doc/chatuikit/vue/components/search.md +1384 -0
- package/resource/doc/livekit/live/android/workflow.md +137 -6
- package/resource/doc/livekit/live/ios/live-audience-list.md +339 -0
- package/resource/doc/livekit/live/ios/live-audio-effect.md +370 -0
- package/resource/doc/livekit/live/ios/live-barrage.md +517 -0
- package/resource/doc/livekit/live/ios/live-base-beauty.md +247 -0
- package/resource/doc/livekit/live/ios/live-co-guest-interaction.md +518 -0
- package/resource/doc/livekit/live/ios/live-gift.md +783 -0
- package/resource/doc/livekit/live/ios/live-host-interaction.md +815 -0
- package/resource/doc/livekit/live/ios/live-integration.md +931 -0
- package/resource/doc/livekit/live/ios/live-live-list.md +485 -0
- package/resource/doc/livekit/live/ios/workflow.md +454 -0
- package/resource/doc/rtcengine/web/plugin/20-advanced-customized-capture-rendering.md +87 -0
- package/resource/doc/rtcengine/web/plugin/21-advanced-auto-play-policy.md +87 -0
- package/resource/doc/rtcengine/web/plugin/22-advanced-audio-mixer.md +175 -0
- package/resource/doc/rtcengine/web/plugin/23-advanced-support-detection.md +221 -0
- package/resource/doc/rtcengine/web/plugin/24-advanced-network-quality.md +140 -0
- package/resource/doc/rtcengine/web/plugin/25-advanced-device-change.md +99 -0
- package/resource/doc/rtcengine/web/plugin/26-advanced-publish-cdn-stream.md +451 -0
- package/resource/doc/rtcengine/web/plugin/27-advanced-small-stream.md +151 -0
- package/resource/doc/rtcengine/web/plugin/28-advanced-beauty.md +322 -0
- package/resource/doc/rtcengine/web/plugin/29-advanced-water-mark.md +149 -0
- package/resource/doc/rtcengine/web/plugin/30-advanced-cross-room-link.md +96 -0
- package/resource/doc/rtcengine/web/plugin/31-advanced-plugins-overview.md +330 -0
- package/resource/doc/rtcengine/web/plugin/34-advanced-proxy.md +248 -0
- package/resource/doc/rtcengine/web/plugin/35-advanced-ai-denoiser.md +81 -0
- package/resource/doc/rtcengine/web/plugin/36-advanced-virtual-background.md +242 -0
- package/resource/doc/rtcengine/web/plugin/37-advanced-voice-changer.md +99 -0
- package/resource/doc/rtcengine/web/plugin/39-advanced-video-decoder.md +33 -0
- package/resource/doc/rtcengine/web/plugin/40-advanced-video-mixer.md +379 -0
- package/resource/doc/rtcengine/web/plugin/41-advanced-small-stream-auto-switcher.md +91 -0
- package/resource/doc/rtcengine/web/plugin/42-advanced-realtime-transcriber.md +315 -0
- package/resource/doc/rtcengine/web/plugin/43-advanced-face-detection.md +180 -0
- package/resource/doc/tuicallkit/android/workflow.md +0 -0
- package/resource/doc/tuicallkit/flutter/workflow.md +331 -0
- package/tools/call/get-native-call-integration.js +27 -11
- package/tools/call/get-native-call-integration.js.map +1 -1
- package/tools/chat/get-native-chat-feature-detail.js +30 -0
- package/tools/chat/get-native-chat-feature-detail.js.map +1 -0
- package/tools/chat/get-native-chat-integration.js +30 -12
- package/tools/chat/get-native-chat-integration.js.map +1 -1
- package/tools/common/get-faq.js +2 -4
- package/tools/common/get-faq.js.map +1 -1
- package/tools/definitions/get_native_call_uikit_integration_def.js +17 -7
- package/tools/definitions/get_native_call_uikit_integration_def.js.map +1 -1
- package/tools/definitions/get_native_chat_feature_detail_def.js +32 -0
- package/tools/definitions/get_native_chat_feature_detail_def.js.map +1 -0
- package/tools/definitions/get_native_chat_uikit_integration_def.js +19 -7
- package/tools/definitions/get_native_chat_uikit_integration_def.js.map +1 -1
- package/tools/definitions/{get_native_live_extra_features_def.js → get_native_live_uikit_extra_features_def.js} +3 -3
- package/tools/definitions/get_native_live_uikit_extra_features_def.js.map +1 -0
- package/tools/definitions/{get_native_live_interaction_def.js → get_native_live_uikit_interaction_def.js} +3 -3
- package/tools/definitions/get_native_live_uikit_interaction_def.js.map +1 -0
- package/tools/definitions/get_web_chat_uikit_component_detail_def.js +49 -10
- package/tools/definitions/get_web_chat_uikit_component_detail_def.js.map +1 -1
- package/tools/index.js +6 -4
- package/tools/index.js.map +1 -1
- package/tools/live/{get_native_live_extra_features.js → get_native_live_uikit_extra_features.js} +4 -4
- package/tools/live/get_native_live_uikit_extra_features.js.map +1 -0
- package/tools/live/{get_native_live_interaction.js → get_native_live_uikit_interaction.js} +4 -4
- package/tools/live/get_native_live_uikit_interaction.js.map +1 -0
- package/tools/rtcengine/get-rtcengine-web-sdk-integration.js.map +1 -1
- package/tools/rtcengine/get-trtc-sdk-faq.js +32 -0
- package/tools/rtcengine/get-trtc-sdk-faq.js.map +1 -0
- package/tools/rtcengine/get-trtc-web-sdk-faq.js +1 -1
- package/tools/rtcengine/get-trtc-web-sdk-integration.js.map +1 -1
- package/tools/rtcengine/get-trtc-web-sdk-plugin.js +45 -0
- package/tools/rtcengine/get-trtc-web-sdk-plugin.js.map +1 -0
- package/utils/handle-component-name.js +0 -16
- package/utils/handle-component-name.js.map +1 -1
- package/utils/report-cls-client.js +1 -1
- package/utils/report-es-client.js +1 -1
- package/resource/doc/chatuikit/android/generate_UserSig.md +0 -306
- package/resource/doc/chatuikit/android/integrarte_only_tuichat_Android.md +0 -290
- package/resource/doc/chatuikit/android/quick_start_Android.md +0 -138
- package/resource/doc/chatuikit/android/show_typing_Android.md +0 -43
- package/resource/doc/chatuikit/flutter/generate_UserSig.md +0 -306
- package/resource/doc/chatuikit/flutter/integrate_tuikit_Flutter.md +0 -133
- package/resource/doc/chatuikit/iOS/generate_UserSig.md +0 -306
- package/resource/doc/chatuikit/iOS/integrate_only_tuichat_iOS.md +0 -748
- package/resource/doc/chatuikit/iOS/quick_start_iOS.md +0 -163
- package/resource/doc/chatuikit/iOS/show_typing_iOS.md +0 -52
- package/resource/doc/tuicallkit/flutter/how_to_run_flutter_callkit_demo.md +0 -101
- package/resource/doc/tuicallkit/iOS/how_to_run_iOS_callkit_demo.md +0 -98
- package/tools/definitions/get_native_live_extra_features_def.js.map +0 -1
- package/tools/definitions/get_native_live_interaction_def.js.map +0 -1
- package/tools/live/get_native_live_extra_features.js.map +0 -1
- package/tools/live/get_native_live_interaction.js.map +0 -1
- /package/resource/doc/chatuikit/android/{integrate_tuikit_Android.md → integration.md} +0 -0
- /package/resource/doc/chatuikit/{faq/native_sdk/faq.md → android/workflow.md} +0 -0
- /package/resource/doc/chatuikit/{flutter/client_api_Flutter.md → faq/flutter_sdk/client-api.md} +0 -0
- /package/resource/doc/chatuikit/iOS/{integrate_tuikit_iOS.md → integration.md} +0 -0
- /package/resource/doc/{tuicallkit/android/.gitkeep → chatuikit/iOS/workflow.md} +0 -0
- /package/resource/doc/chatuikit/react/components/{chatheader.md → chat-header.md} +0 -0
- /package/resource/doc/chatuikit/vue/components/{chatheader.md → chat-header.md} +0 -0
- /package/resource/doc/tuicallkit/android/{how_to_integrated_android_callkit.md → integration.md} +0 -0
- /package/resource/doc/tuicallkit/{android/api_TUICallObserver.md → faq/android_sdk/call-observer-api.md} +0 -0
- /package/resource/doc/tuicallkit/{android/api_TUICallKit.md → faq/android_sdk/callkit-api.md} +0 -0
- /package/resource/doc/tuicallkit/{flutter/api_TUICallDefine.md → faq/flutter_sdk/call-define-api.md} +0 -0
- /package/resource/doc/tuicallkit/{flutter/api_TUICallObserver.md → faq/flutter_sdk/call-observer-api.md} +0 -0
- /package/resource/doc/tuicallkit/{flutter/api_TUICallKit.md → faq/flutter_sdk/callkit-api.md} +0 -0
- /package/resource/doc/tuicallkit/{iOS/api_TUICallObserver.md → faq/ios_sdk/call-observer-api.md} +0 -0
- /package/resource/doc/tuicallkit/{iOS/api_TUICallKit.md → faq/ios_sdk/callkit-api.md} +0 -0
- /package/resource/doc/tuicallkit/flutter/{how_to_integrated_flutter_callkit.md → integration.md} +0 -0
- /package/resource/doc/tuicallkit/iOS/{how_to_integrated_iOS_callkit.md → integration.md} +0 -0
|
@@ -0,0 +1,1093 @@
|
|
|
1
|
+
## Overview
|
|
2
|
+
|
|
3
|
+
ContactList is a highly configurable contact list component. It supports friend list, group list, blocklist, and application management, offering core features such as group collapsing, search filtering, and custom rendering. It is suitable for contact management interfaces in instant messaging and social applications.
|
|
4
|
+
|
|
5
|
+

|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
## ContactList Props
|
|
9
|
+
<table>
|
|
10
|
+
<tr>
|
|
11
|
+
<td rowspan="1" colSpan="1" >Field</td>
|
|
12
|
+
|
|
13
|
+
<td rowspan="1" colSpan="1" >Type</td>
|
|
14
|
+
|
|
15
|
+
<td rowspan="1" colSpan="1" >Default Value</td>
|
|
16
|
+
|
|
17
|
+
<td rowspan="1" colSpan="1" >Description</td>
|
|
18
|
+
</tr>
|
|
19
|
+
|
|
20
|
+
<tr>
|
|
21
|
+
<td rowspan="1" colSpan="1" >activeContactItem</td>
|
|
22
|
+
|
|
23
|
+
<td rowspan="1" colSpan="1" >ContactGroupItem \| undefined</td>
|
|
24
|
+
|
|
25
|
+
<td rowspan="1" colSpan="1" >`undefined`</td>
|
|
26
|
+
|
|
27
|
+
<td rowspan="1" colSpan="1" >Currently active contact item</td>
|
|
28
|
+
</tr>
|
|
29
|
+
|
|
30
|
+
<tr>
|
|
31
|
+
<td rowspan="1" colSpan="1" >enableSearch</td>
|
|
32
|
+
|
|
33
|
+
<td rowspan="1" colSpan="1" >boolean</td>
|
|
34
|
+
|
|
35
|
+
<td rowspan="1" colSpan="1" >`true`</td>
|
|
36
|
+
|
|
37
|
+
<td rowspan="1" colSpan="1" >Whether to enable the search feature</td>
|
|
38
|
+
</tr>
|
|
39
|
+
|
|
40
|
+
<tr>
|
|
41
|
+
<td rowspan="1" colSpan="1" >groupConfig</td>
|
|
42
|
+
|
|
43
|
+
<td rowspan="1" colSpan="1" >Partial<Record<ContactItemType, CustomGroupConfig>></td>
|
|
44
|
+
|
|
45
|
+
<td rowspan="1" colSpan="1" >`{}`</td>
|
|
46
|
+
|
|
47
|
+
<td rowspan="1" colSpan="1" >Custom group configuration</td>
|
|
48
|
+
</tr>
|
|
49
|
+
|
|
50
|
+
<tr>
|
|
51
|
+
<td rowspan="1" colSpan="1" >className</td>
|
|
52
|
+
|
|
53
|
+
<td rowspan="1" colSpan="1" >string</td>
|
|
54
|
+
|
|
55
|
+
<td rowspan="1" colSpan="1" >`undefined`</td>
|
|
56
|
+
|
|
57
|
+
<td rowspan="1" colSpan="1" >Custom CSS class name</td>
|
|
58
|
+
</tr>
|
|
59
|
+
|
|
60
|
+
<tr>
|
|
61
|
+
<td rowspan="1" colSpan="1" >style</td>
|
|
62
|
+
|
|
63
|
+
<td rowspan="1" colSpan="1" >React.CSSProperties</td>
|
|
64
|
+
|
|
65
|
+
<td rowspan="1" colSpan="1" >`undefined`</td>
|
|
66
|
+
|
|
67
|
+
<td rowspan="1" colSpan="1" >Custom inline style</td>
|
|
68
|
+
</tr>
|
|
69
|
+
|
|
70
|
+
<tr>
|
|
71
|
+
<td rowspan="1" colSpan="1" >searchPlaceholder</td>
|
|
72
|
+
|
|
73
|
+
<td rowspan="1" colSpan="1" >string</td>
|
|
74
|
+
|
|
75
|
+
<td rowspan="1" colSpan="1" >`'Search contacts'`</td>
|
|
76
|
+
|
|
77
|
+
<td rowspan="1" colSpan="1" >search box placeholder text</td>
|
|
78
|
+
</tr>
|
|
79
|
+
|
|
80
|
+
<tr>
|
|
81
|
+
<td rowspan="1" colSpan="1" >emptyText</td>
|
|
82
|
+
|
|
83
|
+
<td rowspan="1" colSpan="1" >string</td>
|
|
84
|
+
|
|
85
|
+
<td rowspan="1" colSpan="1" >`'No contacts'`</td>
|
|
86
|
+
|
|
87
|
+
<td rowspan="1" colSpan="1" >Empty status prompt text</td>
|
|
88
|
+
</tr>
|
|
89
|
+
|
|
90
|
+
<tr>
|
|
91
|
+
<td rowspan="1" colSpan="1" >ContactItem</td>
|
|
92
|
+
|
|
93
|
+
<td rowspan="1" colSpan="1" >React.ComponentType<ContactListItemProps> \| undefined</td>
|
|
94
|
+
|
|
95
|
+
<td rowspan="1" colSpan="1" >`ContactListItem`</td>
|
|
96
|
+
|
|
97
|
+
<td rowspan="1" colSpan="1" >Custom contact person component</td>
|
|
98
|
+
</tr>
|
|
99
|
+
|
|
100
|
+
<tr>
|
|
101
|
+
<td rowspan="1" colSpan="1" >ContactSearchComponent</td>
|
|
102
|
+
|
|
103
|
+
<td rowspan="1" colSpan="1" >React.ComponentType<ContactSearchProps> \| undefined</td>
|
|
104
|
+
|
|
105
|
+
<td rowspan="1" colSpan="1" >`ContactSearch`</td>
|
|
106
|
+
|
|
107
|
+
<td rowspan="1" colSpan="1" >Custom search component</td>
|
|
108
|
+
</tr>
|
|
109
|
+
|
|
110
|
+
<tr>
|
|
111
|
+
<td rowspan="1" colSpan="1" >GroupHeader</td>
|
|
112
|
+
|
|
113
|
+
<td rowspan="1" colSpan="1" >React.ComponentType<{ data: ContactGroup }> \| undefined</td>
|
|
114
|
+
|
|
115
|
+
<td rowspan="1" colSpan="1" >Default group header</td>
|
|
116
|
+
|
|
117
|
+
<td rowspan="1" colSpan="1" >Custom group header component</td>
|
|
118
|
+
</tr>
|
|
119
|
+
|
|
120
|
+
<tr>
|
|
121
|
+
<td rowspan="1" colSpan="1" >PlaceholderEmptyList</td>
|
|
122
|
+
|
|
123
|
+
<td rowspan="1" colSpan="1" >React.ReactNode \| undefined</td>
|
|
124
|
+
|
|
125
|
+
<td rowspan="1" colSpan="1" >Default empty status</td>
|
|
126
|
+
|
|
127
|
+
<td rowspan="1" colSpan="1" >Custom empty status component</td>
|
|
128
|
+
</tr>
|
|
129
|
+
|
|
130
|
+
<tr>
|
|
131
|
+
<td rowspan="1" colSpan="1" >onContactItemClick</td>
|
|
132
|
+
|
|
133
|
+
<td rowspan="1" colSpan="1" >(item: ContactGroupItem) => void</td>
|
|
134
|
+
|
|
135
|
+
<td rowspan="1" colSpan="1" >`undefined`</td>
|
|
136
|
+
|
|
137
|
+
<td rowspan="1" colSpan="1" >Contact person item click event</td>
|
|
138
|
+
</tr>
|
|
139
|
+
|
|
140
|
+
<tr>
|
|
141
|
+
<td rowspan="1" colSpan="1" >onFriendApplicationAction</td>
|
|
142
|
+
|
|
143
|
+
<td rowspan="1" colSpan="1" >(action: 'accept' \| 'refuse', application: FriendApplication) => void</td>
|
|
144
|
+
|
|
145
|
+
<td rowspan="1" colSpan="1" >`undefined`</td>
|
|
146
|
+
|
|
147
|
+
<td rowspan="1" colSpan="1" >Friend request operation event</td>
|
|
148
|
+
</tr>
|
|
149
|
+
|
|
150
|
+
<tr>
|
|
151
|
+
<td rowspan="1" colSpan="1" >onGroupApplicationAction</td>
|
|
152
|
+
|
|
153
|
+
<td rowspan="1" colSpan="1" >(action: 'accept' \| 'refuse', application: GroupApplication) => void</td>
|
|
154
|
+
|
|
155
|
+
<td rowspan="1" colSpan="1" >`undefined`</td>
|
|
156
|
+
|
|
157
|
+
<td rowspan="1" colSpan="1" >Group request operation event</td>
|
|
158
|
+
</tr>
|
|
159
|
+
</table>
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+
## ContactInfo props
|
|
163
|
+
<table>
|
|
164
|
+
<tr>
|
|
165
|
+
<td rowspan="1" colSpan="1" >Field</td>
|
|
166
|
+
|
|
167
|
+
<td rowspan="1" colSpan="1" >Type</td>
|
|
168
|
+
|
|
169
|
+
<td rowspan="1" colSpan="1" >Default Value</td>
|
|
170
|
+
|
|
171
|
+
<td rowspan="1" colSpan="1" >Description</td>
|
|
172
|
+
</tr>
|
|
173
|
+
|
|
174
|
+
<tr>
|
|
175
|
+
<td rowspan="1" colSpan="1" >contactItem</td>
|
|
176
|
+
|
|
177
|
+
<td rowspan="1" colSpan="1" >ContactGroupItem \| undefined</td>
|
|
178
|
+
|
|
179
|
+
<td rowspan="1" colSpan="1" >`undefined`</td>
|
|
180
|
+
|
|
181
|
+
<td rowspan="1" colSpan="1" >Currently showing contact item</td>
|
|
182
|
+
</tr>
|
|
183
|
+
|
|
184
|
+
<tr>
|
|
185
|
+
<td rowspan="1" colSpan="1" >showActions</td>
|
|
186
|
+
|
|
187
|
+
<td rowspan="1" colSpan="1" >boolean</td>
|
|
188
|
+
|
|
189
|
+
<td rowspan="1" colSpan="1" >`true`</td>
|
|
190
|
+
|
|
191
|
+
<td rowspan="1" colSpan="1" >whether to display the action button</td>
|
|
192
|
+
</tr>
|
|
193
|
+
|
|
194
|
+
<tr>
|
|
195
|
+
<td rowspan="1" colSpan="1" >PlaceholderEmpty</td>
|
|
196
|
+
|
|
197
|
+
<td rowspan="1" colSpan="1" >React.ReactNode \| undefined</td>
|
|
198
|
+
|
|
199
|
+
<td rowspan="1" colSpan="1" >`undefined`</td>
|
|
200
|
+
|
|
201
|
+
<td rowspan="1" colSpan="1" >Empty status placeholder component</td>
|
|
202
|
+
</tr>
|
|
203
|
+
|
|
204
|
+
<tr>
|
|
205
|
+
<td rowspan="1" colSpan="1" >FriendInfoComponent</td>
|
|
206
|
+
|
|
207
|
+
<td rowspan="1" colSpan="1" >React.ComponentType<FriendInfoProps></td>
|
|
208
|
+
|
|
209
|
+
<td rowspan="1" colSpan="1" >`FriendInfo`</td>
|
|
210
|
+
|
|
211
|
+
<td rowspan="1" colSpan="1" >Friend information component</td>
|
|
212
|
+
</tr>
|
|
213
|
+
|
|
214
|
+
<tr>
|
|
215
|
+
<td rowspan="1" colSpan="1" >GroupInfoComponent</td>
|
|
216
|
+
|
|
217
|
+
<td rowspan="1" colSpan="1" >React.ComponentType<GroupInfoProps></td>
|
|
218
|
+
|
|
219
|
+
<td rowspan="1" colSpan="1" >`GroupInfo`</td>
|
|
220
|
+
|
|
221
|
+
<td rowspan="1" colSpan="1" >Group information component</td>
|
|
222
|
+
</tr>
|
|
223
|
+
|
|
224
|
+
<tr>
|
|
225
|
+
<td rowspan="1" colSpan="1" >BlacklistInfoComponent</td>
|
|
226
|
+
|
|
227
|
+
<td rowspan="1" colSpan="1" >React.ComponentType<BlacklistInfoProps></td>
|
|
228
|
+
|
|
229
|
+
<td rowspan="1" colSpan="1" >`BlacklistInfo`</td>
|
|
230
|
+
|
|
231
|
+
<td rowspan="1" colSpan="1" >Blocklist information component</td>
|
|
232
|
+
</tr>
|
|
233
|
+
|
|
234
|
+
<tr>
|
|
235
|
+
<td rowspan="1" colSpan="1" >FriendApplicationInfoComponent</td>
|
|
236
|
+
|
|
237
|
+
<td rowspan="1" colSpan="1" >React.ComponentType<FriendApplicationInfoProps></td>
|
|
238
|
+
|
|
239
|
+
<td rowspan="1" colSpan="1" >`FriendApplicationInfo`</td>
|
|
240
|
+
|
|
241
|
+
<td rowspan="1" colSpan="1" >Friend request information component</td>
|
|
242
|
+
</tr>
|
|
243
|
+
|
|
244
|
+
<tr>
|
|
245
|
+
<td rowspan="1" colSpan="1" >GroupApplicationInfoComponent</td>
|
|
246
|
+
|
|
247
|
+
<td rowspan="1" colSpan="1" >React.ComponentType<GroupApplicationInfoProps></td>
|
|
248
|
+
|
|
249
|
+
<td rowspan="1" colSpan="1" >`GroupApplicationInfo`</td>
|
|
250
|
+
|
|
251
|
+
<td rowspan="1" colSpan="1" >Group application information component</td>
|
|
252
|
+
</tr>
|
|
253
|
+
|
|
254
|
+
<tr>
|
|
255
|
+
<td rowspan="1" colSpan="1" >SearchGroupInfoComponent</td>
|
|
256
|
+
|
|
257
|
+
<td rowspan="1" colSpan="1" >React.ComponentType<SearchGroupInfoProps></td>
|
|
258
|
+
|
|
259
|
+
<td rowspan="1" colSpan="1" >`SearchGroupInfo`</td>
|
|
260
|
+
|
|
261
|
+
<td rowspan="1" colSpan="1" >Group information search component</td>
|
|
262
|
+
</tr>
|
|
263
|
+
|
|
264
|
+
<tr>
|
|
265
|
+
<td rowspan="1" colSpan="1" >SearchUserInfoComponent</td>
|
|
266
|
+
|
|
267
|
+
<td rowspan="1" colSpan="1" >React.ComponentType<SearchUserInfoProps></td>
|
|
268
|
+
|
|
269
|
+
<td rowspan="1" colSpan="1" >`SearchUserInfo`</td>
|
|
270
|
+
|
|
271
|
+
<td rowspan="1" colSpan="1" >User information search component</td>
|
|
272
|
+
</tr>
|
|
273
|
+
|
|
274
|
+
<tr>
|
|
275
|
+
<td rowspan="1" colSpan="1" >onClose</td>
|
|
276
|
+
|
|
277
|
+
<td rowspan="1" colSpan="1" >() => void</td>
|
|
278
|
+
|
|
279
|
+
<td rowspan="1" colSpan="1" >`undefined`</td>
|
|
280
|
+
|
|
281
|
+
<td rowspan="1" colSpan="1" >Close message panel callback</td>
|
|
282
|
+
</tr>
|
|
283
|
+
|
|
284
|
+
<tr>
|
|
285
|
+
<td rowspan="1" colSpan="1" >onSendMessage</td>
|
|
286
|
+
|
|
287
|
+
<td rowspan="1" colSpan="1" >(friend: Friend) => void</td>
|
|
288
|
+
|
|
289
|
+
<td rowspan="1" colSpan="1" >`undefined`</td>
|
|
290
|
+
|
|
291
|
+
<td rowspan="1" colSpan="1" >Message send callback</td>
|
|
292
|
+
</tr>
|
|
293
|
+
|
|
294
|
+
<tr>
|
|
295
|
+
<td rowspan="1" colSpan="1" >onDeleteFriend</td>
|
|
296
|
+
|
|
297
|
+
<td rowspan="1" colSpan="1" >(friend: Friend) => void</td>
|
|
298
|
+
|
|
299
|
+
<td rowspan="1" colSpan="1" >`undefined`</td>
|
|
300
|
+
|
|
301
|
+
<td rowspan="1" colSpan="1" >Remove friend callback</td>
|
|
302
|
+
</tr>
|
|
303
|
+
|
|
304
|
+
<tr>
|
|
305
|
+
<td rowspan="1" colSpan="1" >onUpdateFriendRemark</td>
|
|
306
|
+
|
|
307
|
+
<td rowspan="1" colSpan="1" >(friend: Friend, remark: string) => void</td>
|
|
308
|
+
|
|
309
|
+
<td rowspan="1" colSpan="1" >`undefined`</td>
|
|
310
|
+
|
|
311
|
+
<td rowspan="1" colSpan="1" >Update friend remark callback</td>
|
|
312
|
+
</tr>
|
|
313
|
+
|
|
314
|
+
<tr>
|
|
315
|
+
<td rowspan="1" colSpan="1" >onAddToBlacklist</td>
|
|
316
|
+
|
|
317
|
+
<td rowspan="1" colSpan="1" >(friend: Friend) => void</td>
|
|
318
|
+
|
|
319
|
+
<td rowspan="1" colSpan="1" >`undefined`</td>
|
|
320
|
+
|
|
321
|
+
<td rowspan="1" colSpan="1" >Add to blocklist callback</td>
|
|
322
|
+
</tr>
|
|
323
|
+
|
|
324
|
+
<tr>
|
|
325
|
+
<td rowspan="1" colSpan="1" >onRemoveFromBlacklist</td>
|
|
326
|
+
|
|
327
|
+
<td rowspan="1" colSpan="1" >(profile: UserProfile) => void</td>
|
|
328
|
+
|
|
329
|
+
<td rowspan="1" colSpan="1" >`undefined`</td>
|
|
330
|
+
|
|
331
|
+
<td rowspan="1" colSpan="1" >Remove from blocklist callback</td>
|
|
332
|
+
</tr>
|
|
333
|
+
|
|
334
|
+
<tr>
|
|
335
|
+
<td rowspan="1" colSpan="1" >onEnterGroup</td>
|
|
336
|
+
|
|
337
|
+
<td rowspan="1" colSpan="1" >(group: GroupModel) => void</td>
|
|
338
|
+
|
|
339
|
+
<td rowspan="1" colSpan="1" >`undefined`</td>
|
|
340
|
+
|
|
341
|
+
<td rowspan="1" colSpan="1" >Group entry callback</td>
|
|
342
|
+
</tr>
|
|
343
|
+
|
|
344
|
+
<tr>
|
|
345
|
+
<td rowspan="1" colSpan="1" >onLeaveGroup</td>
|
|
346
|
+
|
|
347
|
+
<td rowspan="1" colSpan="1" >(group: GroupModel) => void</td>
|
|
348
|
+
|
|
349
|
+
<td rowspan="1" colSpan="1" >`undefined`</td>
|
|
350
|
+
|
|
351
|
+
<td rowspan="1" colSpan="1" >Group exit callback</td>
|
|
352
|
+
</tr>
|
|
353
|
+
|
|
354
|
+
<tr>
|
|
355
|
+
<td rowspan="1" colSpan="1" >onDismissGroup</td>
|
|
356
|
+
|
|
357
|
+
<td rowspan="1" colSpan="1" >(group: GroupModel) => void</td>
|
|
358
|
+
|
|
359
|
+
<td rowspan="1" colSpan="1" >`undefined`</td>
|
|
360
|
+
|
|
361
|
+
<td rowspan="1" colSpan="1" >Group dismissed callback</td>
|
|
362
|
+
</tr>
|
|
363
|
+
|
|
364
|
+
<tr>
|
|
365
|
+
<td rowspan="1" colSpan="1" >onFriendApplicationAction</td>
|
|
366
|
+
|
|
367
|
+
<td rowspan="1" colSpan="1" >(action: 'accept' \| 'refuse', application: FriendApplication) => void</td>
|
|
368
|
+
|
|
369
|
+
<td rowspan="1" colSpan="1" >`undefined`</td>
|
|
370
|
+
|
|
371
|
+
<td rowspan="1" colSpan="1" >Friend request operation callback</td>
|
|
372
|
+
</tr>
|
|
373
|
+
|
|
374
|
+
<tr>
|
|
375
|
+
<td rowspan="1" colSpan="1" >onGroupApplicationAction</td>
|
|
376
|
+
|
|
377
|
+
<td rowspan="1" colSpan="1" >(action: 'accept' \| 'refuse', application: GroupApplication) => void</td>
|
|
378
|
+
|
|
379
|
+
<td rowspan="1" colSpan="1" >`undefined`</td>
|
|
380
|
+
|
|
381
|
+
<td rowspan="1" colSpan="1" >Group application operation callback</td>
|
|
382
|
+
</tr>
|
|
383
|
+
|
|
384
|
+
<tr>
|
|
385
|
+
<td rowspan="1" colSpan="1" >onAddFriend</td>
|
|
386
|
+
|
|
387
|
+
<td rowspan="1" colSpan="1" >(user: UserProfile, wording: string) => void</td>
|
|
388
|
+
|
|
389
|
+
<td rowspan="1" colSpan="1" >`undefined`</td>
|
|
390
|
+
|
|
391
|
+
<td rowspan="1" colSpan="1" >Friend request callback</td>
|
|
392
|
+
</tr>
|
|
393
|
+
|
|
394
|
+
<tr>
|
|
395
|
+
<td rowspan="1" colSpan="1" >onJoinGroup</td>
|
|
396
|
+
|
|
397
|
+
<td rowspan="1" colSpan="1" >(group: GroupModel, note: string) => void</td>
|
|
398
|
+
|
|
399
|
+
<td rowspan="1" colSpan="1" >`undefined`</td>
|
|
400
|
+
|
|
401
|
+
<td rowspan="1" colSpan="1" >Group join callback</td>
|
|
402
|
+
</tr>
|
|
403
|
+
</table>
|
|
404
|
+
|
|
405
|
+
|
|
406
|
+
## Basic Usage
|
|
407
|
+
``` tsx
|
|
408
|
+
import { ContactList, ContactInfo } from '@tencentcloud/chat-uikit-react';
|
|
409
|
+
|
|
410
|
+
function App() {
|
|
411
|
+
return (
|
|
412
|
+
<div>
|
|
413
|
+
<ContactList />
|
|
414
|
+
<ContactInfo />
|
|
415
|
+
</div>
|
|
416
|
+
);
|
|
417
|
+
}
|
|
418
|
+
```
|
|
419
|
+
|
|
420
|
+
## Custom Capabilities
|
|
421
|
+
|
|
422
|
+
### Custom Contact List Search Feature Switch
|
|
423
|
+
|
|
424
|
+
By setting the `enableSearch` parameter, you can flexibly control the display of the friend search group feature in ContactList.
|
|
425
|
+
``` typescript
|
|
426
|
+
<ContactList enableSearch={false} />
|
|
427
|
+
```
|
|
428
|
+
|
|
429
|
+
The effect is as shown below.
|
|
430
|
+
|
|
431
|
+

|
|
432
|
+
|
|
433
|
+
|
|
434
|
+
### Custom Contact List Contact Group Configuration
|
|
435
|
+
|
|
436
|
+
`groupConfig` is used for custom group configuration, including title, display sequence, hidden state, etc. The default value is `{}`.
|
|
437
|
+
|
|
438
|
+
|
|
439
|
+
|
|
440
|
+
【Custom Group Heading】
|
|
441
|
+
``` typescript
|
|
442
|
+
import React from 'react';
|
|
443
|
+
import { ContactList } from '@tencentcloud/chat-uikit-react';
|
|
444
|
+
import { ContactItemType } from '@tencentcloud/chat-uikit-react';
|
|
445
|
+
|
|
446
|
+
function CustomGroupTitlesContactList() {
|
|
447
|
+
const groupConfig = {
|
|
448
|
+
[ContactItemType.FRIEND]: {
|
|
449
|
+
title: 'My friend',
|
|
450
|
+
order: 1
|
|
451
|
+
},
|
|
452
|
+
[ContactItemType.GROUP]: {
|
|
453
|
+
title: 'My Groups',
|
|
454
|
+
order: 2
|
|
455
|
+
},
|
|
456
|
+
[ContactItemType.FRIEND_REQUEST]: {
|
|
457
|
+
title: 'Friend request',
|
|
458
|
+
order: 0
|
|
459
|
+
}
|
|
460
|
+
};
|
|
461
|
+
|
|
462
|
+
return (
|
|
463
|
+
<ContactList
|
|
464
|
+
groupConfig={groupConfig}
|
|
465
|
+
onContactItemClick={(item) => {
|
|
466
|
+
console.log('contact person click:', item);
|
|
467
|
+
}}
|
|
468
|
+
/>
|
|
469
|
+
);
|
|
470
|
+
}
|
|
471
|
+
```
|
|
472
|
+
|
|
473
|
+
The effect is as shown below.
|
|
474
|
+
|
|
475
|
+

|
|
476
|
+
|
|
477
|
+
【Hide Specific Group】
|
|
478
|
+
``` typescript
|
|
479
|
+
import React from 'react';
|
|
480
|
+
import { ContactList } from '@tencentcloud/chat-uikit-react';
|
|
481
|
+
import { ContactItemType } from '@tencentcloud/chat-uikit-react';
|
|
482
|
+
|
|
483
|
+
function HiddenGroupsContactList() {
|
|
484
|
+
const groupConfig = {
|
|
485
|
+
[ContactItemType.BLACK]: {
|
|
486
|
+
title: 'blocklist',
|
|
487
|
+
hidden: true // hide blocklist grouping
|
|
488
|
+
},
|
|
489
|
+
[ContactItemType.GROUP_REQUEST]: {
|
|
490
|
+
title: 'Group Application',
|
|
491
|
+
hidden: true // hide group application grouping
|
|
492
|
+
}
|
|
493
|
+
};
|
|
494
|
+
|
|
495
|
+
return (
|
|
496
|
+
<ContactList
|
|
497
|
+
groupConfig={groupConfig}
|
|
498
|
+
onContactItemClick={(item) => {
|
|
499
|
+
console.log('contact person click:', item);
|
|
500
|
+
}}
|
|
501
|
+
/>
|
|
502
|
+
);
|
|
503
|
+
}
|
|
504
|
+
```
|
|
505
|
+
|
|
506
|
+
The effect is as shown below.
|
|
507
|
+
|
|
508
|
+

|
|
509
|
+
|
|
510
|
+
|
|
511
|
+
### Custom Contact List Sub-Item
|
|
512
|
+
|
|
513
|
+
ContactItem is used for custom rendering component of contact person, with default value as built-in `ContactListItem` component.
|
|
514
|
+
``` typescript
|
|
515
|
+
import React from 'react';
|
|
516
|
+
import { ContactList, Avatar } from '@tencentcloud/chat-uikit-react';
|
|
517
|
+
import type { ContactListItemProps } from '@tencentcloud/chat-uikit-react';
|
|
518
|
+
|
|
519
|
+
const SimpleContactItem: React.FC<ContactListItemProps> = ({
|
|
520
|
+
contactItem,
|
|
521
|
+
onClick,
|
|
522
|
+
activeContactItem
|
|
523
|
+
}) => {
|
|
524
|
+
const isActive = activeContactItem?.data.userID === contactItem.data.userID;
|
|
525
|
+
|
|
526
|
+
return (
|
|
527
|
+
<div
|
|
528
|
+
className={`simple-contact-item ${isActive ? 'active' : ''}`}
|
|
529
|
+
onClick={() => onClick?.(contactItem.type, contactItem.data)}
|
|
530
|
+
style={{
|
|
531
|
+
padding: '8px 12px',
|
|
532
|
+
borderBottom: '1px solid #f0f0f0',
|
|
533
|
+
cursor: 'pointer',
|
|
534
|
+
backgroundColor: isActive ? '#e6f7ff' : 'transparent'
|
|
535
|
+
}}
|
|
536
|
+
>
|
|
537
|
+
<div style={{ display: 'flex', alignItems: 'center', gap: '10px' }}>
|
|
538
|
+
<Avatar src={contactItem.data.avatar} alt="avatar" />
|
|
539
|
+
<span>{contactItem.data.nick || contactItem.data.name}</span>
|
|
540
|
+
</div>
|
|
541
|
+
</div>
|
|
542
|
+
);
|
|
543
|
+
};
|
|
544
|
+
|
|
545
|
+
function ContactListWithSimpleItems() {
|
|
546
|
+
return (
|
|
547
|
+
<ContactList
|
|
548
|
+
ContactItem={SimpleContactItem}
|
|
549
|
+
onContactItemClick={(item) => {
|
|
550
|
+
console.log('contact person click:', item);
|
|
551
|
+
}}
|
|
552
|
+
/>
|
|
553
|
+
);
|
|
554
|
+
}
|
|
555
|
+
```
|
|
556
|
+
|
|
557
|
+
The effect is as shown below.
|
|
558
|
+
|
|
559
|
+

|
|
560
|
+
|
|
561
|
+
|
|
562
|
+
### Custom Contact Person Detail Action Button Switch
|
|
563
|
+
|
|
564
|
+
`showActions` specifies whether to display action buttons. The default value is `true`.
|
|
565
|
+
``` typescript
|
|
566
|
+
import React from 'react';
|
|
567
|
+
import { ContactInfo } from '@tencentcloud/chat-uikit-react';
|
|
568
|
+
|
|
569
|
+
function ReadOnlyContactInfo() {
|
|
570
|
+
const friendData = {
|
|
571
|
+
type: ContactItemType.FRIEND,
|
|
572
|
+
data: {
|
|
573
|
+
userID: 'user123',
|
|
574
|
+
nick: 'Zhang San',
|
|
575
|
+
avatar: 'https://example.com/avatar.jpg',
|
|
576
|
+
remark: 'colleague',
|
|
577
|
+
// ... other friend properties
|
|
578
|
+
},
|
|
579
|
+
};
|
|
580
|
+
|
|
581
|
+
return (
|
|
582
|
+
<ContactInfo
|
|
583
|
+
contactItem={friendData}
|
|
584
|
+
showActions={false} // Hide ALL action buttons and display information only
|
|
585
|
+
/>
|
|
586
|
+
);
|
|
587
|
+
}
|
|
588
|
+
```
|
|
589
|
+
|
|
590
|
+
The effect is as shown below.
|
|
591
|
+
|
|
592
|
+

|
|
593
|
+
|
|
594
|
+
|
|
595
|
+
### Custom Contact Person Detail Empty Status
|
|
596
|
+
|
|
597
|
+
`PlaceholderEmpty` is used for custom empty status display content, default value is `undefined`.
|
|
598
|
+
``` typescript
|
|
599
|
+
import React from 'react';
|
|
600
|
+
import { ContactInfo } from '@tencentcloud/chat-uikit-react';
|
|
601
|
+
|
|
602
|
+
function CustomEmptyState() {
|
|
603
|
+
const EmptyPlaceholder = () => (
|
|
604
|
+
<div style={{
|
|
605
|
+
width: '100%',
|
|
606
|
+
textAlign: 'center',
|
|
607
|
+
padding: '40px 20px',
|
|
608
|
+
color: '#999',
|
|
609
|
+
fontSize: '14px',
|
|
610
|
+
background: '#fff',
|
|
611
|
+
}}>
|
|
612
|
+
<div style={{ fontSize: '48px', marginBottom: '16px' }}>👤</div>
|
|
613
|
+
<div>Select one contact person to view detailed information</div>
|
|
614
|
+
<div style={{ marginTop: '8px', fontSize: '12px' }}>
|
|
615
|
+
click any item in the left-side contact list
|
|
616
|
+
</div>
|
|
617
|
+
</div>
|
|
618
|
+
);
|
|
619
|
+
|
|
620
|
+
return (
|
|
621
|
+
<ContactInfo
|
|
622
|
+
PlaceholderEmpty={<EmptyPlaceholder />}
|
|
623
|
+
/>
|
|
624
|
+
);
|
|
625
|
+
}
|
|
626
|
+
```
|
|
627
|
+
|
|
628
|
+
The effect is as shown below.
|
|
629
|
+
|
|
630
|
+

|
|
631
|
+
|
|
632
|
+
|
|
633
|
+
### Custom Contact Person Detail Component
|
|
634
|
+
|
|
635
|
+
> **Note:**
|
|
636
|
+
>
|
|
637
|
+
> - `FriendInfoComponent` for custom friend information component, default value is built-in `FriendInfo` component.
|
|
638
|
+
> - `GroupInfoComponent` for custom group information component, default value is built-in `GroupInfo` component.
|
|
639
|
+
> - `BlacklistInfoComponent` for custom blocklist information component, default value is built-in `BlacklistInfo` component.
|
|
640
|
+
> - `FriendApplicationInfoComponent` for custom Friend request information component, default value is built-in `FriendApplicationInfo` component.
|
|
641
|
+
> - `GroupApplicationInfoComponent` for custom group application information component, default value is built-in `GroupApplicationInfo` component.
|
|
642
|
+
|
|
643
|
+
|
|
644
|
+
|
|
645
|
+
|
|
646
|
+
【Custom Friend Information Component】
|
|
647
|
+
``` typescript
|
|
648
|
+
import React from 'react';
|
|
649
|
+
import { ContactInfo } from '@tencentcloud/chat-uikit-react';
|
|
650
|
+
import type { FriendInfoProps, Friend } from '@tencentcloud/chat-uikit-react';
|
|
651
|
+
import { Button } from '@tencentcloud/uikit-base-component-react';
|
|
652
|
+
|
|
653
|
+
// Custom Friend Information Component
|
|
654
|
+
const CustomFriendInfo: React.FC<FriendInfoProps> = ({
|
|
655
|
+
friend,
|
|
656
|
+
showActions,
|
|
657
|
+
onClose,
|
|
658
|
+
onSendMessage,
|
|
659
|
+
onDeleteFriend
|
|
660
|
+
}) => {
|
|
661
|
+
return (
|
|
662
|
+
<div style={{ padding: '20px', border: '1px solid #e0e0e0', borderRadius: '8px' }}>
|
|
663
|
+
<div style={{ display: 'flex', alignItems: 'center', marginBottom: '16px' }}>
|
|
664
|
+
<img
|
|
665
|
+
src={friend.avatar}
|
|
666
|
+
alt="avatar"
|
|
667
|
+
style={{ width: '60px', height: '60px', borderRadius: '50%', marginRight: '16px' }}
|
|
668
|
+
/>
|
|
669
|
+
<div>
|
|
670
|
+
<h3 style={{ margin: '0 0 4px 0' }}>{friend.nick}</h3>
|
|
671
|
+
<p style={{ margin: '0', color: '#666' }}>Remark: {friend.remark}</p>
|
|
672
|
+
</div>
|
|
673
|
+
</div>
|
|
674
|
+
|
|
675
|
+
<div style={{ display: 'flex', flexDirection: 'column', gap: '10px', marginBottom: '16px' }}>
|
|
676
|
+
<p><strong>uid:</strong> {friend.userID}</p>
|
|
677
|
+
<p><strong>Personal signature:</strong> {friend.selfSignature}</p>
|
|
678
|
+
<p><strong>Location:</strong> {friend.location}</p>
|
|
679
|
+
</div>
|
|
680
|
+
|
|
681
|
+
|
|
682
|
+
{showActions && (
|
|
683
|
+
<div style={{ display: 'flex', gap: '8px' }}>
|
|
684
|
+
<Button onClick={() => onSendMessage?.(friend)}>Send Message</Button>
|
|
685
|
+
<Button onClick={() => onDeleteFriend?.(friend)}>Remove Friend</Button>
|
|
686
|
+
<Button onClick={onClose}>Close</Button>
|
|
687
|
+
</div>
|
|
688
|
+
)}
|
|
689
|
+
</div>
|
|
690
|
+
);
|
|
691
|
+
};
|
|
692
|
+
|
|
693
|
+
function CustomFriendInfoDemo() {
|
|
694
|
+
const friendData = {
|
|
695
|
+
type: ContactItemType.FRIEND,
|
|
696
|
+
data: {
|
|
697
|
+
userID: 'user123',
|
|
698
|
+
nick: 'Zhang San',
|
|
699
|
+
avatar: 'https://example.com/avatar.jpg',
|
|
700
|
+
remark: 'colleague',
|
|
701
|
+
selfSignature: 'Love technology, love life',
|
|
702
|
+
location: 'Beijing',
|
|
703
|
+
// ... other attributes
|
|
704
|
+
},
|
|
705
|
+
};
|
|
706
|
+
|
|
707
|
+
return (
|
|
708
|
+
<ContactInfo
|
|
709
|
+
contactItem={friendData}
|
|
710
|
+
FriendInfoComponent={CustomFriendInfo}
|
|
711
|
+
onSendMessage={(friend) => console.log('Send message to:', friend.nick)}
|
|
712
|
+
onDeleteFriend={(friend) => console.log('Remove friend:', friend.nick)}
|
|
713
|
+
/>
|
|
714
|
+
);
|
|
715
|
+
}
|
|
716
|
+
```
|
|
717
|
+
|
|
718
|
+
The effect is as shown below.
|
|
719
|
+
|
|
720
|
+

|
|
721
|
+
|
|
722
|
+
|
|
723
|
+
【Custom Group Information Component】
|
|
724
|
+
``` typescript
|
|
725
|
+
import React from 'react';
|
|
726
|
+
import { ContactInfo, GroupMemberRole } from '@tencentcloud/uikit-component-react';
|
|
727
|
+
import type { GroupInfoProps, GroupModel } from '@tencentcloud/uikit-component-react';
|
|
728
|
+
import { Button } from '@tencentcloud/uikit-base-component-react';
|
|
729
|
+
|
|
730
|
+
// Custom Group Information Component
|
|
731
|
+
const CustomGroupInfo: React.FC<GroupInfoProps> = ({
|
|
732
|
+
group,
|
|
733
|
+
showActions,
|
|
734
|
+
onClose,
|
|
735
|
+
onEnterGroup,
|
|
736
|
+
onLeaveGroup,
|
|
737
|
+
onDismissGroup
|
|
738
|
+
}) => {
|
|
739
|
+
const isOwner = group.selfInfo?.role === GroupMemberRole.OWNER; // group owner
|
|
740
|
+
const isAdmin = group.selfInfo?.role === GroupMemberRole.ADMIN; // admin
|
|
741
|
+
|
|
742
|
+
return (
|
|
743
|
+
<div style={{ padding: '20px', border: '1px solid #e0e0e0', borderRadius: '8px' }}>
|
|
744
|
+
<div style={{ display: 'flex', alignItems: 'center', marginBottom: '16px' }}>
|
|
745
|
+
<img
|
|
746
|
+
src={group.avatar}
|
|
747
|
+
alt="group avatar"
|
|
748
|
+
style={{ width: '60px', height: '60px', borderRadius: '8px', marginRight: '16px' }}
|
|
749
|
+
/>
|
|
750
|
+
<div>
|
|
751
|
+
<h3 style={{ margin: '0 0 4px 0' }}>{group.name}</h3>
|
|
752
|
+
<p style={{ margin: '0', color: '#666' }}>
|
|
753
|
+
Group ID: {group.groupID}
|
|
754
|
+
</p>
|
|
755
|
+
</div>
|
|
756
|
+
</div>
|
|
757
|
+
|
|
758
|
+
<div style={{ display: 'flex', flexDirection: 'column', gap: '10px', marginBottom: '16px' }}>
|
|
759
|
+
<p><strong>Group introduction:</strong> {group.introduction}</p>
|
|
760
|
+
<p><strong>Group notice:</strong> {group.notification}</p>
|
|
761
|
+
<p><strong>Member count:</strong> {group.memberCount}/{group.maxMemberCount}</p>
|
|
762
|
+
<p><strong>My role:</strong> {
|
|
763
|
+
isOwner ? 'group owner' : isAdmin ? 'admin' : 'ordinary member'
|
|
764
|
+
}</p>
|
|
765
|
+
</div>
|
|
766
|
+
|
|
767
|
+
{showActions && (
|
|
768
|
+
<div style={{ display: 'flex', gap: '8px' }}>
|
|
769
|
+
<Button onClick={() => onEnterGroup?.(group)}>Enter group</Button>
|
|
770
|
+
<Button onClick={() => onLeaveGroup?.(group)}>Exit group</Button>
|
|
771
|
+
{isOwner && (
|
|
772
|
+
<Button onClick={() => onDismissGroup?.(group)}>Dissolve group</Button>
|
|
773
|
+
)}
|
|
774
|
+
<Button onClick={onClose}>Close</Button>
|
|
775
|
+
</div>
|
|
776
|
+
)}
|
|
777
|
+
</div>
|
|
778
|
+
);
|
|
779
|
+
};
|
|
780
|
+
|
|
781
|
+
function CustomGroupInfoDemo() {
|
|
782
|
+
const groupData = {
|
|
783
|
+
type: ContactItemType.GROUP,
|
|
784
|
+
data: {
|
|
785
|
+
groupID: 'group123',
|
|
786
|
+
name: 'technical exchange group',
|
|
787
|
+
avatar: 'https://example.com/group-avatar.jpg',
|
|
788
|
+
type: 'Public',
|
|
789
|
+
introduction: 'technical exchange and sharing',
|
|
790
|
+
notification: 'Welcome to join the technical exchange group',
|
|
791
|
+
ownerID: 'owner123',
|
|
792
|
+
memberCount: 100,
|
|
793
|
+
maxMemberCount: 200,
|
|
794
|
+
selfInfo: {
|
|
795
|
+
userID: 'currentUser',
|
|
796
|
+
role: GroupMemberRole.OWNER, // group owner
|
|
797
|
+
nameCard: 'group owner',
|
|
798
|
+
joinTime: Date.now(),
|
|
799
|
+
},
|
|
800
|
+
},
|
|
801
|
+
};
|
|
802
|
+
|
|
803
|
+
return (
|
|
804
|
+
<ContactInfo
|
|
805
|
+
contactItem={groupData}
|
|
806
|
+
GroupInfoComponent={CustomGroupInfo}
|
|
807
|
+
onEnterGroup={(group) => console.log('Enter group:', group.name)}
|
|
808
|
+
onLeaveGroup={(group) => console.log('Exit group:', group.name)}
|
|
809
|
+
onDismissGroup={(group) => console.log('Dissolve group:', group.name)}
|
|
810
|
+
/>
|
|
811
|
+
);
|
|
812
|
+
}
|
|
813
|
+
```
|
|
814
|
+
|
|
815
|
+
The effect is as shown below.
|
|
816
|
+
|
|
817
|
+

|
|
818
|
+
|
|
819
|
+
【Custom Blocklist Information Component】
|
|
820
|
+
``` typescript
|
|
821
|
+
import React from 'react';
|
|
822
|
+
import { ContactInfo } from '@tencentcloud/uikit-component-react';
|
|
823
|
+
import type { BlacklistInfoProps, UserProfile } from '@tencentcloud/uikit-component-react';
|
|
824
|
+
import { Button } from '@tencentcloud/uikit-base-component-react';
|
|
825
|
+
|
|
826
|
+
// Custom Blocklist Information Component
|
|
827
|
+
const CustomBlacklistInfo: React.FC<BlacklistInfoProps> = ({
|
|
828
|
+
profile,
|
|
829
|
+
showActions,
|
|
830
|
+
onClose,
|
|
831
|
+
onRemoveFromBlacklist
|
|
832
|
+
}) => {
|
|
833
|
+
return (
|
|
834
|
+
<div style={{ padding: '20px', border: '1px solid #e0e0e0', borderRadius: '8px' }}>
|
|
835
|
+
<div style={{ display: 'flex', alignItems: 'center', marginBottom: '16px' }}>
|
|
836
|
+
<img
|
|
837
|
+
src={profile.src}
|
|
838
|
+
alt="avatar"
|
|
839
|
+
style={{ width: '60px', height: '60px', borderRadius: '50%', marginRight: '16px' }}
|
|
840
|
+
/>
|
|
841
|
+
<div>
|
|
842
|
+
<h3 style={{ margin: '0 0 4px 0', color: '#ff4d4f' }}>{profile.nick}</h3>
|
|
843
|
+
<p style={{ margin: '0', color: '#666' }}>uid: {profile.userID}</p>
|
|
844
|
+
</div>
|
|
845
|
+
</div>
|
|
846
|
+
|
|
847
|
+
<div style={{ display: 'flex', flexDirection: 'column', gap: '10px', marginBottom: '16px' }}>
|
|
848
|
+
<p><strong>Personal signature:</strong> {profile.selfSignature}</p>
|
|
849
|
+
<p><strong>Location:</strong> {profile.location}</p>
|
|
850
|
+
<p style={{ color: '#ff4d4f', fontWeight: 'bold' }}>
|
|
851
|
+
This user has been added to the blocklist
|
|
852
|
+
</p>
|
|
853
|
+
</div>
|
|
854
|
+
|
|
855
|
+
{showActions && (
|
|
856
|
+
<div style={{ display: 'flex', gap: '8px' }}>
|
|
857
|
+
<Button
|
|
858
|
+
onClick={() => onRemoveFromBlacklist?.(profile)}
|
|
859
|
+
style={{ backgroundColor: '#52c41a', color: 'white', border: 'none' }}
|
|
860
|
+
>
|
|
861
|
+
Move from blocklist
|
|
862
|
+
</Button>
|
|
863
|
+
<Button onClick={onClose}>Close</Button>
|
|
864
|
+
</div>
|
|
865
|
+
)}
|
|
866
|
+
</div>
|
|
867
|
+
);
|
|
868
|
+
};
|
|
869
|
+
|
|
870
|
+
function CustomBlacklistInfoDemo() {
|
|
871
|
+
const blacklistData = {
|
|
872
|
+
type: ContactItemType.BLACK,
|
|
873
|
+
data: {
|
|
874
|
+
userID: 'user456',
|
|
875
|
+
nick: 'Li Si',
|
|
876
|
+
src: 'https://example.com/avatar2.jpg',
|
|
877
|
+
gender: 1,
|
|
878
|
+
birthday: 19920101,
|
|
879
|
+
location: 'Shenzhen',
|
|
880
|
+
selfSignature: 'blocklisted user',
|
|
881
|
+
allowType: 1,
|
|
882
|
+
adminForbidType: 0,
|
|
883
|
+
},
|
|
884
|
+
};
|
|
885
|
+
|
|
886
|
+
return (
|
|
887
|
+
<ContactInfo
|
|
888
|
+
contactItem={blacklistData}
|
|
889
|
+
BlacklistInfoComponent={CustomBlacklistInfo}
|
|
890
|
+
onRemoveFromBlacklist={(profile) => console.log('Removing from blocklist:', profile.nick)}
|
|
891
|
+
/>
|
|
892
|
+
);
|
|
893
|
+
}
|
|
894
|
+
```
|
|
895
|
+
|
|
896
|
+
The effect is as shown below.
|
|
897
|
+
|
|
898
|
+

|
|
899
|
+
|
|
900
|
+
【Custom Friend Request Information Component】
|
|
901
|
+
``` typescript
|
|
902
|
+
import React from 'react';
|
|
903
|
+
import { ContactInfo } from '@tencentcloud/uikit-component-react';
|
|
904
|
+
import type { FriendApplicationInfoProps, FriendApplication } from '@tencentcloud/uikit-component-react';
|
|
905
|
+
import { Button } from '@tencentcloud/uikit-base-component-react';
|
|
906
|
+
|
|
907
|
+
// Custom Friend Request Information Component
|
|
908
|
+
const CustomFriendApplicationInfo: React.FC<FriendApplicationInfoProps> = ({
|
|
909
|
+
application,
|
|
910
|
+
showActions,
|
|
911
|
+
onClose,
|
|
912
|
+
onAccept,
|
|
913
|
+
onRefuse
|
|
914
|
+
}) => {
|
|
915
|
+
const formatTime = (timestamp: number) => {
|
|
916
|
+
return new Date(timestamp).toLocaleString();
|
|
917
|
+
};
|
|
918
|
+
|
|
919
|
+
return (
|
|
920
|
+
<div style={{ padding: '20px', border: '1px solid #e0e0e0', borderRadius: '8px' }}>
|
|
921
|
+
<div style={{ display: 'flex', alignItems: 'center', marginBottom: '16px' }}>
|
|
922
|
+
<img
|
|
923
|
+
src={application.src}
|
|
924
|
+
alt="avatar"
|
|
925
|
+
style={{ width: '60px', height: '60px', borderRadius: '50%', marginRight: '16px' }}
|
|
926
|
+
/>
|
|
927
|
+
<div>
|
|
928
|
+
<h3 style={{ margin: '0 0 4px 0' }}>{application.nick}</h3>
|
|
929
|
+
<p style={{ margin: '0', color: '#666' }}>Application time: {formatTime(application.time)}</p>
|
|
930
|
+
</div>
|
|
931
|
+
</div>
|
|
932
|
+
|
|
933
|
+
<div style={{ display: 'flex', flexDirection: 'column', gap: '10px', marginBottom: '16px' }}>
|
|
934
|
+
<p><strong>Application source:</strong> {application.source}</p>
|
|
935
|
+
<p><strong>Remarks:</strong> {application.wording}</p>
|
|
936
|
+
<p style={{ color: '#1890ff', fontWeight: 'bold' }}>
|
|
937
|
+
Friend request
|
|
938
|
+
</p>
|
|
939
|
+
</div>
|
|
940
|
+
|
|
941
|
+
{showActions && (
|
|
942
|
+
<div style={{ display: 'flex', gap: '8px' }}>
|
|
943
|
+
<Button
|
|
944
|
+
onClick={() => onAccept?.(application)}
|
|
945
|
+
style={{ backgroundColor: '#52c41a', color: 'white', border: 'none' }}
|
|
946
|
+
>
|
|
947
|
+
accept application
|
|
948
|
+
</Button>
|
|
949
|
+
<Button
|
|
950
|
+
onClick={() => onRefuse?.(application)}
|
|
951
|
+
style={{ backgroundColor: '#ff4d4f', color: 'white', border: 'none' }}
|
|
952
|
+
>
|
|
953
|
+
reject application
|
|
954
|
+
</Button>
|
|
955
|
+
<Button onClick={onClose}>Close</Button>
|
|
956
|
+
</div>
|
|
957
|
+
)}
|
|
958
|
+
</div>
|
|
959
|
+
);
|
|
960
|
+
};
|
|
961
|
+
|
|
962
|
+
function CustomFriendApplicationInfoDemo() {
|
|
963
|
+
const applicationData = {
|
|
964
|
+
type: ContactItemType.FRIEND_REQUEST,
|
|
965
|
+
data: {
|
|
966
|
+
userID: 'user789',
|
|
967
|
+
nick: 'Wang Wu',
|
|
968
|
+
src: 'https://example.com/avatar3.jpg',
|
|
969
|
+
time: Date.now(),
|
|
970
|
+
source: 'search add',
|
|
971
|
+
wording: 'hello, i want to add you as a friend to discuss technology together',
|
|
972
|
+
type: 1,
|
|
973
|
+
},
|
|
974
|
+
};
|
|
975
|
+
|
|
976
|
+
return (
|
|
977
|
+
<ContactInfo
|
|
978
|
+
contactItem={applicationData}
|
|
979
|
+
FriendApplicationInfoComponent={CustomFriendApplicationInfo}
|
|
980
|
+
onFriendApplicationAction={(action, application) => {
|
|
981
|
+
if (action === 'accept') {
|
|
982
|
+
console.log('Accept friend request:', application.nick);
|
|
983
|
+
} else {
|
|
984
|
+
console.log('Refuse friend application:', application.nick);
|
|
985
|
+
}
|
|
986
|
+
}}
|
|
987
|
+
/>
|
|
988
|
+
);
|
|
989
|
+
}
|
|
990
|
+
```
|
|
991
|
+
|
|
992
|
+
The effect is as shown below.
|
|
993
|
+
|
|
994
|
+

|
|
995
|
+
|
|
996
|
+
【Custom Group Application Information Component】
|
|
997
|
+
``` typescript
|
|
998
|
+
import React from 'react';
|
|
999
|
+
import { ContactInfo } from '@tencentcloud/uikit-component-react';
|
|
1000
|
+
import type { GroupApplicationInfoProps, GroupApplication } from '@tencentcloud/uikit-component-react';
|
|
1001
|
+
import { Button } from '@tencentcloud/uikit-base-component-react';
|
|
1002
|
+
|
|
1003
|
+
// Custom Group Application Information Component
|
|
1004
|
+
const CustomGroupApplicationInfo: React.FC<GroupApplicationInfoProps> = ({
|
|
1005
|
+
application,
|
|
1006
|
+
showActions,
|
|
1007
|
+
onClose,
|
|
1008
|
+
onAccept,
|
|
1009
|
+
onRefuse
|
|
1010
|
+
}) => {
|
|
1011
|
+
const getApplicationTypeText = (type: number) => {
|
|
1012
|
+
return type === 0 ? 'user application to join' : 'invite user joined';
|
|
1013
|
+
};
|
|
1014
|
+
|
|
1015
|
+
return (
|
|
1016
|
+
<div style={{ padding: '20px', border: '1px solid #e0e0e0', borderRadius: '8px' }}>
|
|
1017
|
+
<div style={{ display: 'flex', alignItems: 'center', marginBottom: '16px' }}>
|
|
1018
|
+
<div style={{ width: '60px', height: '60px', borderRadius: '8px', marginRight: '16px', backgroundColor: '#f0f0f0', display: 'flex', alignItems: 'center', justifyContent: 'center' }}>
|
|
1019
|
+
👥
|
|
1020
|
+
</div>
|
|
1021
|
+
<div>
|
|
1022
|
+
<h3 style={{ margin: '0 0 4px 0' }}>{application.groupName}</h3>
|
|
1023
|
+
<p style={{ margin: '0', color: '#666' }}>
|
|
1024
|
+
{getApplicationTypeText(application.applicationType)}
|
|
1025
|
+
</p>
|
|
1026
|
+
</div>
|
|
1027
|
+
</div>
|
|
1028
|
+
|
|
1029
|
+
<div style={{ display: 'flex', flexDirection: 'column', gap: '10px', marginBottom: '16px' }}>
|
|
1030
|
+
<p><strong>Applicant:</strong> {application.applicantNick}</p>
|
|
1031
|
+
<p><strong>Group ID:</strong> {application.groupID}</p>
|
|
1032
|
+
<p><strong>Application remarks:</strong> {application.note}</p>
|
|
1033
|
+
<p style={{ color: '#1890ff', fontWeight: 'bold' }}>
|
|
1034
|
+
Group request pending
|
|
1035
|
+
</p>
|
|
1036
|
+
</div>
|
|
1037
|
+
|
|
1038
|
+
{showActions && (
|
|
1039
|
+
<div style={{ display: 'flex', gap: '8px' }}>
|
|
1040
|
+
<Button
|
|
1041
|
+
onClick={() => onAccept?.(application)}
|
|
1042
|
+
style={{ backgroundColor: '#52c41a', color: 'white', border: 'none' }}
|
|
1043
|
+
>
|
|
1044
|
+
Approving Applications
|
|
1045
|
+
</Button>
|
|
1046
|
+
<Button
|
|
1047
|
+
onClick={() => onRefuse?.(application)}
|
|
1048
|
+
style={{ backgroundColor: '#ff4d4f', color: 'white', border: 'none' }}
|
|
1049
|
+
>
|
|
1050
|
+
reject application
|
|
1051
|
+
</Button>
|
|
1052
|
+
<Button onClick={onClose}>Close</Button>
|
|
1053
|
+
</div>
|
|
1054
|
+
)}
|
|
1055
|
+
</div>
|
|
1056
|
+
);
|
|
1057
|
+
};
|
|
1058
|
+
|
|
1059
|
+
function CustomGroupApplicationInfoDemo() {
|
|
1060
|
+
const applicationData = {
|
|
1061
|
+
type: ContactItemType.GROUP_REQUEST,
|
|
1062
|
+
data: {
|
|
1063
|
+
applicant: 'user999',
|
|
1064
|
+
applicantNick: 'Zhao Liu',
|
|
1065
|
+
groupID: 'group456',
|
|
1066
|
+
groupName: 'product manager communication group',
|
|
1067
|
+
applicationType: 0,
|
|
1068
|
+
userID: 'user999',
|
|
1069
|
+
note: 'I want to join the product manager communication group to learn product design experience',
|
|
1070
|
+
},
|
|
1071
|
+
};
|
|
1072
|
+
|
|
1073
|
+
return (
|
|
1074
|
+
<ContactInfo
|
|
1075
|
+
contactItem={applicationData}
|
|
1076
|
+
GroupApplicationInfoComponent={CustomGroupApplicationInfo}
|
|
1077
|
+
onGroupApplicationAction={(action, application) => {
|
|
1078
|
+
if (action === 'accept') {
|
|
1079
|
+
console.log('Approve group request:', application.groupName);
|
|
1080
|
+
} else {
|
|
1081
|
+
console.log('Reject group request:', application.groupName);
|
|
1082
|
+
}
|
|
1083
|
+
}}
|
|
1084
|
+
/>
|
|
1085
|
+
);
|
|
1086
|
+
}
|
|
1087
|
+
```
|
|
1088
|
+
|
|
1089
|
+
The effect is as shown below.
|
|
1090
|
+
|
|
1091
|
+

|
|
1092
|
+
|
|
1093
|
+
##
|