whyuzeim 1.0.0

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.
Files changed (247) hide show
  1. package/README.md +11 -0
  2. package/cjs/AddMember/image/ic_close.svg.js +5 -0
  3. package/cjs/AddMember/index.d.ts +7 -0
  4. package/cjs/AddMember/index.js +107 -0
  5. package/cjs/AddMember/style/index.scss +47 -0
  6. package/cjs/ChatBox/JoinGroupDialog/index.d.ts +10 -0
  7. package/cjs/ChatBox/JoinGroupDialog/index.js +102 -0
  8. package/cjs/ChatBox/JoinGroupDialog/style/index.scss +4 -0
  9. package/cjs/ChatBox/image/ic_chat_back.svg.js +5 -0
  10. package/cjs/ChatBox/image/ic_more.svg.js +5 -0
  11. package/cjs/ChatBox/index.d.ts +10 -0
  12. package/cjs/ChatBox/index.js +557 -0
  13. package/cjs/ChatBox/style/index.scss +26 -0
  14. package/cjs/ContactList/index.d.ts +24 -0
  15. package/cjs/ContactList/index.js +64 -0
  16. package/cjs/ContactList/style/index.scss +5 -0
  17. package/cjs/CustomChatView/index.d.ts +9 -0
  18. package/cjs/CustomChatView/index.js +389 -0
  19. package/cjs/Exit/index.d.ts +3 -0
  20. package/cjs/Exit/index.js +17 -0
  21. package/cjs/GroupDetail/GroupDetailEditView/index.d.ts +8 -0
  22. package/cjs/GroupDetail/GroupDetailEditView/index.js +269 -0
  23. package/cjs/GroupDetail/GroupShareView/index.d.ts +10 -0
  24. package/cjs/GroupDetail/GroupShareView/index.js +151 -0
  25. package/cjs/GroupDetail/image/ic_close.svg.js +5 -0
  26. package/cjs/GroupDetail/image/ic_group_edit.svg.js +5 -0
  27. package/cjs/GroupDetail/image/ic_messages.svg.js +5 -0
  28. package/cjs/GroupDetail/image/ic_share.svg.js +5 -0
  29. package/cjs/GroupDetail/image/icon_translation.svg.js +5 -0
  30. package/cjs/GroupDetail/index.d.ts +26 -0
  31. package/cjs/GroupDetail/index.js +265 -0
  32. package/cjs/GroupDetail/style/index.scss +66 -0
  33. package/cjs/IM/DefaultIMLayout/MobileHeader/index.d.ts +11 -0
  34. package/cjs/IM/DefaultIMLayout/MobileHeader/index.js +29 -0
  35. package/cjs/IM/DefaultIMLayout/MobileHeader/style/index.scss +11 -0
  36. package/cjs/IM/DefaultIMLayout/index.d.ts +3 -0
  37. package/cjs/IM/DefaultIMLayout/index.js +29 -0
  38. package/cjs/IM/DefaultIMLayout/style/index.scss +0 -0
  39. package/cjs/IM/MainContent/index.d.ts +8 -0
  40. package/cjs/IM/MainContent/index.js +87 -0
  41. package/cjs/IM/MainContent/style/index.scss +22 -0
  42. package/cjs/IM/MobileHeader/index.d.ts +11 -0
  43. package/cjs/IM/MobileHeader/index.js +29 -0
  44. package/cjs/IM/MobileHeader/style/index.scss +11 -0
  45. package/cjs/IM/context.d.ts +21 -0
  46. package/cjs/IM/context.js +14 -0
  47. package/cjs/IM/encryption.d.ts +22 -0
  48. package/cjs/IM/encryption.js +38 -0
  49. package/cjs/IM/hooks/useGetAgoraToken.d.ts +2 -0
  50. package/cjs/IM/hooks/useGetAgoraToken.js +61 -0
  51. package/cjs/IM/index.d.ts +20 -0
  52. package/cjs/IM/index.js +130 -0
  53. package/cjs/IM/style/index.scss +119 -0
  54. package/cjs/NoData/image/no-data.svg.js +5 -0
  55. package/cjs/NoData/index.d.ts +8 -0
  56. package/cjs/NoData/index.js +22 -0
  57. package/cjs/NoData/style/index.scss +3 -0
  58. package/cjs/Panelbar/index.d.ts +7 -0
  59. package/cjs/Panelbar/style/index.scss +3 -0
  60. package/cjs/Sharebox/index.d.ts +7 -0
  61. package/cjs/Sharebox/index.js +14 -0
  62. package/cjs/Sharebox/style/index.scss +0 -0
  63. package/cjs/Sidebar/CreateGroup/index.d.ts +21 -0
  64. package/cjs/Sidebar/CreateGroup/index.js +188 -0
  65. package/cjs/Sidebar/CreateGroup/style/index.scss +65 -0
  66. package/cjs/Sidebar/CustomConversationItem/OperateBtn/image/delete.svg.js +5 -0
  67. package/cjs/Sidebar/CustomConversationItem/OperateBtn/image/logout.svg.js +5 -0
  68. package/cjs/Sidebar/CustomConversationItem/OperateBtn/image/more.svg.js +5 -0
  69. package/cjs/Sidebar/CustomConversationItem/OperateBtn/image/muted.svg.js +5 -0
  70. package/cjs/Sidebar/CustomConversationItem/OperateBtn/index.d.ts +10 -0
  71. package/cjs/Sidebar/CustomConversationItem/OperateBtn/index.js +210 -0
  72. package/cjs/Sidebar/CustomConversationItem/OperateBtn/style/index.scss +14 -0
  73. package/cjs/Sidebar/CustomConversationItem/index.d.ts +9 -0
  74. package/cjs/Sidebar/CustomConversationItem/index.js +105 -0
  75. package/cjs/Sidebar/CustomConversationItem/style/index.scss +15 -0
  76. package/cjs/Sidebar/GroupList/OperateBtn/image/delete.svg.js +5 -0
  77. package/cjs/Sidebar/GroupList/OperateBtn/image/logout.svg.js +5 -0
  78. package/cjs/Sidebar/GroupList/OperateBtn/image/more.svg.js +5 -0
  79. package/cjs/Sidebar/GroupList/OperateBtn/image/muted.svg.js +5 -0
  80. package/cjs/Sidebar/GroupList/OperateBtn/index.d.ts +11 -0
  81. package/cjs/Sidebar/GroupList/OperateBtn/index.js +238 -0
  82. package/cjs/Sidebar/GroupList/OperateBtn/style/index.scss +14 -0
  83. package/cjs/Sidebar/GroupList/index.d.ts +7 -0
  84. package/cjs/Sidebar/GroupList/index.js +142 -0
  85. package/cjs/Sidebar/GroupList/style/index.scss +40 -0
  86. package/cjs/Sidebar/MobileCreateGroup/index.d.ts +27 -0
  87. package/cjs/Sidebar/MobileCreateGroup/index.js +171 -0
  88. package/cjs/Sidebar/MobileCreateGroup/style/index.scss +14 -0
  89. package/cjs/Sidebar/Searchbox/image/ic_messages.svg.js +5 -0
  90. package/cjs/Sidebar/Searchbox/index.d.ts +31 -0
  91. package/cjs/Sidebar/Searchbox/index.js +152 -0
  92. package/cjs/Sidebar/Searchbox/style/index.scss +29 -0
  93. package/cjs/Sidebar/image/create.svg.js +5 -0
  94. package/cjs/Sidebar/image/group.svg.js +5 -0
  95. package/cjs/Sidebar/image/ic_close.svg.js +5 -0
  96. package/cjs/Sidebar/image/ic_menu.svg.js +5 -0
  97. package/cjs/Sidebar/image/ic_search.svg.js +5 -0
  98. package/cjs/Sidebar/image/message.svg.js +5 -0
  99. package/cjs/Sidebar/image/mobile_create.svg.js +5 -0
  100. package/cjs/Sidebar/index.d.ts +9 -0
  101. package/cjs/Sidebar/index.js +268 -0
  102. package/cjs/Sidebar/style/index.scss +82 -0
  103. package/cjs/TypeItem/OperateBtn/image/admin.svg.js +5 -0
  104. package/cjs/TypeItem/OperateBtn/image/ban.svg.js +5 -0
  105. package/cjs/TypeItem/OperateBtn/image/block.svg.js +5 -0
  106. package/cjs/TypeItem/OperateBtn/image/logout.svg.js +5 -0
  107. package/cjs/TypeItem/OperateBtn/image/more.svg.js +5 -0
  108. package/cjs/TypeItem/OperateBtn/index.d.ts +13 -0
  109. package/cjs/TypeItem/OperateBtn/index.js +198 -0
  110. package/cjs/TypeItem/OperateBtn/style/index.scss +0 -0
  111. package/cjs/TypeItem/index.d.ts +24 -0
  112. package/cjs/TypeItem/index.js +84 -0
  113. package/cjs/TypeItem/style/index.scss +67 -0
  114. package/cjs/UserProfile/image/ic_close.svg.js +5 -0
  115. package/cjs/UserProfile/image/ic_share.svg.js +5 -0
  116. package/cjs/UserProfile/image/icon_translation.svg.js +5 -0
  117. package/cjs/UserProfile/index.d.ts +8 -0
  118. package/cjs/UserProfile/index.js +170 -0
  119. package/cjs/UserProfile/style/index.scss +50 -0
  120. package/cjs/index.d.ts +16 -0
  121. package/cjs/index.js +23 -0
  122. package/cjs/type.d.ts +7 -0
  123. package/cjs/type.js +61 -0
  124. package/es/AddMember/image/ic_close.svg.js +3 -0
  125. package/es/AddMember/index.d.ts +7 -0
  126. package/es/AddMember/index.js +105 -0
  127. package/es/AddMember/style/index.scss +47 -0
  128. package/es/ChatBox/JoinGroupDialog/index.d.ts +10 -0
  129. package/es/ChatBox/JoinGroupDialog/index.js +100 -0
  130. package/es/ChatBox/JoinGroupDialog/style/index.scss +4 -0
  131. package/es/ChatBox/image/ic_chat_back.svg.js +3 -0
  132. package/es/ChatBox/image/ic_more.svg.js +3 -0
  133. package/es/ChatBox/index.d.ts +10 -0
  134. package/es/ChatBox/index.js +555 -0
  135. package/es/ChatBox/style/index.scss +26 -0
  136. package/es/ContactList/index.d.ts +24 -0
  137. package/es/ContactList/index.js +62 -0
  138. package/es/ContactList/style/index.scss +5 -0
  139. package/es/CustomChatView/index.d.ts +9 -0
  140. package/es/CustomChatView/index.js +387 -0
  141. package/es/Exit/index.d.ts +3 -0
  142. package/es/Exit/index.js +15 -0
  143. package/es/GroupDetail/GroupDetailEditView/index.d.ts +8 -0
  144. package/es/GroupDetail/GroupDetailEditView/index.js +267 -0
  145. package/es/GroupDetail/GroupShareView/index.d.ts +10 -0
  146. package/es/GroupDetail/GroupShareView/index.js +149 -0
  147. package/es/GroupDetail/image/ic_close.svg.js +3 -0
  148. package/es/GroupDetail/image/ic_group_edit.svg.js +3 -0
  149. package/es/GroupDetail/image/ic_messages.svg.js +3 -0
  150. package/es/GroupDetail/image/ic_share.svg.js +3 -0
  151. package/es/GroupDetail/image/icon_translation.svg.js +3 -0
  152. package/es/GroupDetail/index.d.ts +26 -0
  153. package/es/GroupDetail/index.js +263 -0
  154. package/es/GroupDetail/style/index.scss +66 -0
  155. package/es/IM/DefaultIMLayout/MobileHeader/index.d.ts +11 -0
  156. package/es/IM/DefaultIMLayout/MobileHeader/index.js +27 -0
  157. package/es/IM/DefaultIMLayout/MobileHeader/style/index.scss +11 -0
  158. package/es/IM/DefaultIMLayout/index.d.ts +3 -0
  159. package/es/IM/DefaultIMLayout/index.js +27 -0
  160. package/es/IM/DefaultIMLayout/style/index.scss +0 -0
  161. package/es/IM/MainContent/index.d.ts +8 -0
  162. package/es/IM/MainContent/index.js +85 -0
  163. package/es/IM/MainContent/style/index.scss +22 -0
  164. package/es/IM/MobileHeader/index.d.ts +11 -0
  165. package/es/IM/MobileHeader/index.js +27 -0
  166. package/es/IM/MobileHeader/style/index.scss +11 -0
  167. package/es/IM/context.d.ts +21 -0
  168. package/es/IM/context.js +12 -0
  169. package/es/IM/encryption.d.ts +22 -0
  170. package/es/IM/encryption.js +34 -0
  171. package/es/IM/hooks/useGetAgoraToken.d.ts +2 -0
  172. package/es/IM/hooks/useGetAgoraToken.js +59 -0
  173. package/es/IM/index.d.ts +20 -0
  174. package/es/IM/index.js +128 -0
  175. package/es/IM/style/index.scss +119 -0
  176. package/es/NoData/image/no-data.svg.js +3 -0
  177. package/es/NoData/index.d.ts +8 -0
  178. package/es/NoData/index.js +20 -0
  179. package/es/NoData/style/index.scss +3 -0
  180. package/es/Panelbar/index.d.ts +7 -0
  181. package/es/Panelbar/style/index.scss +3 -0
  182. package/es/Sharebox/index.d.ts +7 -0
  183. package/es/Sharebox/index.js +12 -0
  184. package/es/Sharebox/style/index.scss +0 -0
  185. package/es/Sidebar/CreateGroup/index.d.ts +21 -0
  186. package/es/Sidebar/CreateGroup/index.js +186 -0
  187. package/es/Sidebar/CreateGroup/style/index.scss +65 -0
  188. package/es/Sidebar/CustomConversationItem/OperateBtn/image/delete.svg.js +3 -0
  189. package/es/Sidebar/CustomConversationItem/OperateBtn/image/logout.svg.js +3 -0
  190. package/es/Sidebar/CustomConversationItem/OperateBtn/image/more.svg.js +3 -0
  191. package/es/Sidebar/CustomConversationItem/OperateBtn/image/muted.svg.js +3 -0
  192. package/es/Sidebar/CustomConversationItem/OperateBtn/index.d.ts +10 -0
  193. package/es/Sidebar/CustomConversationItem/OperateBtn/index.js +208 -0
  194. package/es/Sidebar/CustomConversationItem/OperateBtn/style/index.scss +14 -0
  195. package/es/Sidebar/CustomConversationItem/index.d.ts +9 -0
  196. package/es/Sidebar/CustomConversationItem/index.js +103 -0
  197. package/es/Sidebar/CustomConversationItem/style/index.scss +15 -0
  198. package/es/Sidebar/GroupList/OperateBtn/image/delete.svg.js +3 -0
  199. package/es/Sidebar/GroupList/OperateBtn/image/logout.svg.js +3 -0
  200. package/es/Sidebar/GroupList/OperateBtn/image/more.svg.js +3 -0
  201. package/es/Sidebar/GroupList/OperateBtn/image/muted.svg.js +3 -0
  202. package/es/Sidebar/GroupList/OperateBtn/index.d.ts +11 -0
  203. package/es/Sidebar/GroupList/OperateBtn/index.js +236 -0
  204. package/es/Sidebar/GroupList/OperateBtn/style/index.scss +14 -0
  205. package/es/Sidebar/GroupList/index.d.ts +7 -0
  206. package/es/Sidebar/GroupList/index.js +140 -0
  207. package/es/Sidebar/GroupList/style/index.scss +40 -0
  208. package/es/Sidebar/MobileCreateGroup/index.d.ts +27 -0
  209. package/es/Sidebar/MobileCreateGroup/index.js +169 -0
  210. package/es/Sidebar/MobileCreateGroup/style/index.scss +14 -0
  211. package/es/Sidebar/Searchbox/image/ic_messages.svg.js +3 -0
  212. package/es/Sidebar/Searchbox/index.d.ts +31 -0
  213. package/es/Sidebar/Searchbox/index.js +150 -0
  214. package/es/Sidebar/Searchbox/style/index.scss +29 -0
  215. package/es/Sidebar/image/create.svg.js +3 -0
  216. package/es/Sidebar/image/group.svg.js +3 -0
  217. package/es/Sidebar/image/ic_close.svg.js +3 -0
  218. package/es/Sidebar/image/ic_menu.svg.js +3 -0
  219. package/es/Sidebar/image/ic_search.svg.js +3 -0
  220. package/es/Sidebar/image/message.svg.js +3 -0
  221. package/es/Sidebar/image/mobile_create.svg.js +3 -0
  222. package/es/Sidebar/index.d.ts +9 -0
  223. package/es/Sidebar/index.js +266 -0
  224. package/es/Sidebar/style/index.scss +82 -0
  225. package/es/TypeItem/OperateBtn/image/admin.svg.js +3 -0
  226. package/es/TypeItem/OperateBtn/image/ban.svg.js +3 -0
  227. package/es/TypeItem/OperateBtn/image/block.svg.js +3 -0
  228. package/es/TypeItem/OperateBtn/image/logout.svg.js +3 -0
  229. package/es/TypeItem/OperateBtn/image/more.svg.js +3 -0
  230. package/es/TypeItem/OperateBtn/index.d.ts +13 -0
  231. package/es/TypeItem/OperateBtn/index.js +196 -0
  232. package/es/TypeItem/OperateBtn/style/index.scss +0 -0
  233. package/es/TypeItem/index.d.ts +24 -0
  234. package/es/TypeItem/index.js +82 -0
  235. package/es/TypeItem/style/index.scss +67 -0
  236. package/es/UserProfile/image/ic_close.svg.js +3 -0
  237. package/es/UserProfile/image/ic_share.svg.js +3 -0
  238. package/es/UserProfile/image/icon_translation.svg.js +3 -0
  239. package/es/UserProfile/index.d.ts +8 -0
  240. package/es/UserProfile/index.js +168 -0
  241. package/es/UserProfile/style/index.scss +50 -0
  242. package/es/index.d.ts +16 -0
  243. package/es/index.js +9 -0
  244. package/es/type.d.ts +7 -0
  245. package/es/type.js +58 -0
  246. package/package.json +33 -0
  247. package/types/global.d.ts +10 -0
@@ -0,0 +1,34 @@
1
+ import '@babel/runtime-corejs3/helpers/esm/typeof';
2
+ import '@babel/runtime-corejs3/core-js-stable/json/stringify';
3
+ import CryptoJS from 'crypto-js';
4
+ import JSEncrypt from 'jsencrypt';
5
+
6
+ new JSEncrypt();
7
+ // 生成 AESKEY
8
+ var aesKey = createAesKey();
9
+ function createAesKey() {
10
+ var expect = 16;
11
+ var str = Math.random().toString(36).substr(2);
12
+ while (str.length < expect) {
13
+ str += Math.random().toString(36).substr(2);
14
+ }
15
+ str = str.substr(0, 16);
16
+ return str;
17
+ }
18
+ /**
19
+ * AES 解密
20
+ * @param word 待解密数据
21
+ * @param keyStr 解密 key
22
+ * @returns {string} 返回解密字符串
23
+ */
24
+ function aesDecrypt(word, keyStr) {
25
+ keyStr = keyStr || aesKey;
26
+ var key = CryptoJS.enc.Utf8.parse(keyStr);
27
+ var decrypt = CryptoJS.AES.decrypt(word, key, {
28
+ mode: CryptoJS.mode.ECB,
29
+ padding: CryptoJS.pad.Pkcs7
30
+ });
31
+ return decrypt.toString(CryptoJS.enc.Utf8);
32
+ }
33
+
34
+ export { aesDecrypt, aesKey, createAesKey };
@@ -0,0 +1,2 @@
1
+ import { AxiosInstance } from "axios";
2
+ export declare const useGetAgoraToken: (http: AxiosInstance, uid?: string) => string;
@@ -0,0 +1,59 @@
1
+ import _asyncToGenerator from '@babel/runtime-corejs3/helpers/esm/asyncToGenerator';
2
+ import _slicedToArray from '@babel/runtime-corejs3/helpers/esm/slicedToArray';
3
+ import _regeneratorRuntime from '@babel/runtime-corejs3/regenerator';
4
+ import { useState, useCallback, useEffect } from 'react';
5
+ import jsrsasign from 'jsrsasign';
6
+ import { aesDecrypt, aesKey } from '../encryption.js';
7
+
8
+ var useGetAgoraToken = function useGetAgoraToken(http, uid) {
9
+ var _useState = useState(""),
10
+ _useState2 = _slicedToArray(_useState, 2),
11
+ agoraToken = _useState2[0],
12
+ setAgoraToken = _useState2[1];
13
+ var handleGetToken = useCallback(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
14
+ var result1, publickey, publicPemKey, pub, enc, result2, token;
15
+ return _regeneratorRuntime.wrap(function _callee$(_context) {
16
+ while (1) switch (_context.prev = _context.next) {
17
+ case 0:
18
+ if (uid) {
19
+ _context.next = 2;
20
+ break;
21
+ }
22
+ return _context.abrupt("return");
23
+ case 2:
24
+ _context.next = 4;
25
+ return http.get("/capi/account/imuser/getkeypair", {
26
+ params: {
27
+ type: 2
28
+ }
29
+ });
30
+ case 4:
31
+ result1 = _context.sent;
32
+ publickey = result1.data.data.publickey; // const rsaStr = encryption.rsaEncrypt(this.aesKey, publickey)
33
+ publicPemKey = "-----BEGIN PUBLIC KEY-----\n" + publickey + "\n-----END PUBLIC KEY-----";
34
+ pub = jsrsasign.KEYUTIL.getKey(publicPemKey);
35
+ enc = jsrsasign.KJUR.crypto.Cipher.encrypt(aesKey, pub, "RSAOAEP");
36
+ _context.next = 11;
37
+ return http.get("/capi/account/imuser/getutoken", {
38
+ params: {
39
+ type: 2,
40
+ token: jsrsasign.hextob64(enc)
41
+ }
42
+ });
43
+ case 11:
44
+ result2 = _context.sent;
45
+ token = aesDecrypt(result2.data.data.utoken, aesKey);
46
+ setAgoraToken(token);
47
+ case 14:
48
+ case "end":
49
+ return _context.stop();
50
+ }
51
+ }, _callee);
52
+ })), [http, uid]);
53
+ useEffect(function () {
54
+ handleGetToken();
55
+ }, [handleGetToken]);
56
+ return agoraToken;
57
+ };
58
+
59
+ export { useGetAgoraToken };
@@ -0,0 +1,20 @@
1
+ import React from "react";
2
+ import { AxiosInstance } from "axios";
3
+ import { IUserInfo } from "./context";
4
+ import "agora-chat-uikit/style.css";
5
+ import "./style/index.scss";
6
+ export type IIMProps = {
7
+ children?: React.ReactNode;
8
+ theme?: "dark" | "light" | "custom";
9
+ http: AxiosInstance;
10
+ appKey: string;
11
+ conversationId?: string;
12
+ sidebarExpand?: boolean;
13
+ userInfo: IUserInfo;
14
+ className?: string;
15
+ style?: React.CSSProperties;
16
+ mobile?: boolean;
17
+ onChatIconClick?: () => void;
18
+ };
19
+ declare const IM: React.FC<IIMProps>;
20
+ export default IM;
package/es/IM/index.js ADDED
@@ -0,0 +1,128 @@
1
+ import _slicedToArray from '@babel/runtime-corejs3/helpers/esm/slicedToArray';
2
+ import React, { useState } from 'react';
3
+ import classNames from 'classnames';
4
+ import { UIKitProvider } from 'agora-chat-uikit';
5
+ import { Context } from './context.js';
6
+ import { useGetAgoraToken } from './hooks/useGetAgoraToken.js';
7
+ import Exit from '../Exit/index.js';
8
+ import 'agora-chat-uikit/style.css';
9
+ import './style/index.scss';
10
+ import Chatbox from '../ChatBox/index.js';
11
+ import GroupDetail from '../GroupDetail/index.js';
12
+ import UserProfile from '../UserProfile/index.js';
13
+
14
+ var IM = function IM(props) {
15
+ var _props$theme = props.theme,
16
+ theme = _props$theme === void 0 ? "light" : _props$theme,
17
+ appKey = props.appKey,
18
+ userInfo = props.userInfo,
19
+ http = props.http,
20
+ _props$sidebarExpand = props.sidebarExpand,
21
+ sidebarExpand = _props$sidebarExpand === void 0 ? false : _props$sidebarExpand,
22
+ children = props.children,
23
+ className = props.className,
24
+ _props$style = props.style,
25
+ style = _props$style === void 0 ? {} : _props$style,
26
+ _props$mobile = props.mobile,
27
+ mobile = _props$mobile === void 0 ? false : _props$mobile,
28
+ onChatIconClick = props.onChatIconClick;
29
+ var agoraToken = useGetAgoraToken(http, userInfo.uid);
30
+ var _useState = useState(),
31
+ _useState2 = _slicedToArray(_useState, 2),
32
+ rightComponent = _useState2[0],
33
+ setRightComponent = _useState2[1];
34
+ var _useState3 = useState(),
35
+ _useState4 = _slicedToArray(_useState3, 2),
36
+ midComponent = _useState4[0],
37
+ setMidComponent = _useState4[1];
38
+ var _useState5 = useState(sidebarExpand),
39
+ _useState6 = _slicedToArray(_useState5, 2),
40
+ isidebarExpand = _useState6[0],
41
+ setIsidebarExpand = _useState6[1];
42
+ // if (!(userInfo.uid && appKey && agoraToken)) {
43
+ // return <></>;
44
+ // }
45
+ var renderMidComponent = function renderMidComponent() {
46
+ setMidComponent(/*#__PURE__*/React.createElement(Chatbox, {
47
+ onClickHeaderBack: function onClickHeaderBack(cvs) {
48
+ if (cvs.chatType === "groupChat") {
49
+ setRightComponent(/*#__PURE__*/React.createElement(GroupDetail, {
50
+ onClickClose: function onClickClose() {
51
+ return setRightComponent(undefined);
52
+ },
53
+ userId: userInfo.uid
54
+ }));
55
+ } else {
56
+ setRightComponent(/*#__PURE__*/React.createElement(UserProfile, {
57
+ onClickClose: function onClickClose() {
58
+ return setRightComponent && setRightComponent(undefined);
59
+ },
60
+ userId: userInfo.uid
61
+ }));
62
+ }
63
+ }
64
+ }));
65
+ };
66
+ return /*#__PURE__*/React.createElement("div", {
67
+ className: classNames("im-".concat(theme), className),
68
+ style: style
69
+ }, /*#__PURE__*/React.createElement(Context.Provider, {
70
+ value: {
71
+ rightComponent: rightComponent,
72
+ setRightComponent: setRightComponent,
73
+ midComponent: midComponent,
74
+ renderMidComponent: renderMidComponent,
75
+ setMidComponent: setMidComponent,
76
+ http: http,
77
+ userInfo: userInfo,
78
+ sidebarExpand: isidebarExpand,
79
+ setSidebarExpand: setIsidebarExpand,
80
+ mobile: mobile,
81
+ onChatIconClick: onChatIconClick
82
+ }
83
+ }, /*#__PURE__*/React.createElement(UIKitProvider, {
84
+ initConfig: {
85
+ userId: userInfo.uid.toString(),
86
+ appKey: appKey,
87
+ token: agoraToken
88
+ },
89
+ theme: {
90
+ mode: theme === "dark" ? "dark" : "light"
91
+ },
92
+ features: {
93
+ conversationList: {
94
+ item: {
95
+ moreAction: true,
96
+ deleteConversation: true,
97
+ presence: true,
98
+ pinConversation: true
99
+ }
100
+ },
101
+ chat: {
102
+ message: {
103
+ thread: false,
104
+ reaction: false,
105
+ moreAction: false,
106
+ reply: true,
107
+ "delete": true,
108
+ recall: true,
109
+ translate: true,
110
+ edit: true,
111
+ select: false,
112
+ forward: false,
113
+ report: false,
114
+ pin: false
115
+ },
116
+ messageInput: {
117
+ typing: true,
118
+ contactCard: false,
119
+ moreAction: true,
120
+ record: false,
121
+ file: true
122
+ }
123
+ }
124
+ }
125
+ }, /*#__PURE__*/React.createElement(Exit, null), children)));
126
+ };
127
+
128
+ export { IM as default };
@@ -0,0 +1,119 @@
1
+ .im-light {
2
+ --im-test-color: green;
3
+
4
+ --im-main-fontColor: #000;
5
+ --im-second-fontColor: rgba(0, 0, 0, 0.55);
6
+ --im-third-fontColor: rgba(0, 0, 0, 0.4);
7
+ --im-six-fontColor: rgba(255, 255, 255, 0.9);
8
+ --im-seven-fontColor: rgba(0, 0, 0, 0.6);
9
+
10
+ --im-group-edit-input-bg: rgba(255, 255, 255, 0.1);
11
+ --im-group-edit-placeholder: rgba(255, 255, 255, 0.4);
12
+ --im-green: #9cff1e;
13
+ --im-main-bg-five: rgba(0, 0, 0, 0.05);
14
+ --im-main-bg-ten: rgba(0, 0, 0, 0.1);
15
+ --im-group-join-cancel-line: rgba(0, 0, 0 0.9);
16
+
17
+ //override
18
+ --im-msg-bubble-color-left: rgba(255, 255, 255, 1);
19
+ --im-msg-bubble-color-right: rgba(156, 255, 30.1);
20
+ --im-msg-bubble-font-color: rgba(0, 0, 0, 0.7);
21
+ }
22
+ .im-dark {
23
+ --im-main-backgroundColor: #1e2329;
24
+ --im-message-backgroundColor: #00540a;
25
+ --im-notice-backgorund: #f5222d;
26
+ --im-modal-backgroundColor: #1e2329;
27
+ --im-checkbox-backgroundColor: #e1342c;
28
+
29
+ --im-delete-fontColor:rgba(233, 67, 89, 1);
30
+ --im-conversationItem-noticeColor:rgba(245, 34, 45, 1);
31
+
32
+ --im-mainContent-left-borderColor: #2c2b2b;
33
+
34
+ --im-conversation-active: rgba(255, 255, 255, 0.1);
35
+
36
+ --im-main-fontColor: #fff;
37
+ --im-second-fontColor: rgba(255, 255, 255, 0.55);
38
+ --im-third-fontColor: rgba(255, 255, 255, 0.4);
39
+ --im-four-fontColor: rgba(255, 255, 255, 0.22);
40
+ --im-five-fontColor: rgba(255, 255, 255, 0.9);
41
+ --im-six-fontColor: rgba(0, 0, 0, 0.9);
42
+ --im-seven-fontColor: rgba(255, 255, 255, 0.6);
43
+
44
+ --im-tab-active-fontColor: green;
45
+ --im-member-remark-fontColor: rgba(0, 0, 0, 0.9);
46
+ --im-member-remark-owner-backgroundColor: #9cff1e;
47
+ --im-member-remark-admin-backgroundColor: #f67c24;
48
+
49
+ --im-group-edit-input-bg: rgba(0, 0, 0 0.1);
50
+ --im-group-edit-placeholder: rgba(255, 255, 255, 0.4);
51
+ --im-green: #9cff1e;
52
+ --im-main-bg-five: rgba(255, 255, 255, 0.05);
53
+ --im-main-bg-ten: rgba(255, 255, 255, 0.1);
54
+ --im-group-join-cancel-line: #595959;
55
+
56
+ //override
57
+ --im-msg-bubble-color-left: rgba(255, 255, 255, 0.05);
58
+ --im-msg-bubble-color-right: #00540a;
59
+ --im-msg-bubble-font-color: rgba(255, 255, 255, 1);
60
+
61
+ .cui-chat-dark {
62
+ background-color: var(--im-main-backgroundColor);
63
+ }
64
+
65
+ --im-main-buttonColor: rgba(156, 255, 30, 1);
66
+ --im-main-switchColor: rgba(0, 200, 5, 1);
67
+ }
68
+
69
+ .cui-message-base-right {
70
+ .cui-avatar {
71
+ display: none;
72
+ }
73
+ }
74
+
75
+ .cui-message-base-nickname {
76
+ color: var(--im-third-fontColor);
77
+ }
78
+
79
+ .ellipsis {
80
+ overflow: hidden; //超出的文本隐藏
81
+ text-overflow: ellipsis; //溢出用省略号显示
82
+ white-space: nowrap; //溢出不换行
83
+ }
84
+
85
+ .ant-modal-confirm {
86
+ .ant-modal-content {
87
+ background-color: #1e2329;
88
+ border: solid 1px rgba(255, 255, 255, 0.1);
89
+ .anticon-exclamation-circle {
90
+ font-size: 50px;
91
+ margin-bottom: 20px;
92
+ }
93
+ .ant-modal-confirm-body {
94
+ display: flex;
95
+ flex-direction: column;
96
+ align-items: center;
97
+ .ant-modal-confirm-title {
98
+ display: none;
99
+ }
100
+ .ant-modal-confirm-content {
101
+ span {
102
+ color: rgba(255, 255, 255, 0.55) !important;
103
+ }
104
+ }
105
+ }
106
+ .yuze-confirm-footer {
107
+ button {
108
+ &:nth-child(1) {
109
+ background-color: transparent !important;
110
+ color: #fff !important;
111
+ }
112
+ &:nth-child(2) {
113
+ background-color: rgba(156, 255, 30, 1) !important;
114
+ color: rgba(255, 255, 255, 0.9) !important;
115
+ }
116
+ }
117
+ }
118
+ }
119
+ }
@@ -0,0 +1,3 @@
1
+ var img = "data:image/svg+xml,%3csvg width='71' height='57' viewBox='0 0 71 57' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M58.4199 33.9273L58.1051 33.9034L57.8058 33.8354L57.5184 33.7234L57.2513 33.5683L57.0116 33.3775L56.7957 33.1462L54.3595 30.0934L54.1782 29.8287L54.0387 29.5401H37.1186L36.4962 29.5091L35.8808 29.4173L35.2786 29.2635L34.6919 29.05L34.147 28.7877L33.6366 28.4776L33.1584 28.1211L32.71 27.7144L32.3034 27.2661L31.9468 26.7879L31.6368 26.2775L31.3744 25.7325L31.161 25.1458L31.0072 24.5436L30.9153 23.9283L30.8843 23.3046V6.23429L30.9153 5.61181L31.0072 4.99649L31.161 4.39429L31.3744 3.80759L31.6368 3.26262L31.9456 2.75224L32.3034 2.27406L32.71 1.82569L33.1584 1.41905L33.6366 1.0625L34.147 0.752455L34.6919 0.490108L35.2786 0.276656L35.8808 0.122825L36.4962 0.029812L37.1186 0H64.4324L65.0549 0.029812L65.6702 0.122825L66.2724 0.276656L66.8591 0.490108L67.4041 0.752455L67.9144 1.06131L68.3926 1.41905L68.841 1.82569L69.2476 2.27406L69.6054 2.75224L69.9142 3.26262L70.1766 3.80759L70.3912 4.3931L70.5438 4.99649L70.6369 5.61062L70.6667 6.23429V23.3046L70.6369 23.9283L70.5438 24.5424L70.3912 25.1458L70.1766 25.7313L69.9142 26.2763L69.6054 26.7867L69.2476 27.2649L68.841 27.7132L68.3926 28.1199L67.9144 28.4776L67.4041 28.7865L66.8591 29.0488L66.2724 29.2623L65.6702 29.4161L65.0549 29.5079L64.4324 29.5389H62.8011L62.6616 29.8275L62.4803 30.0934L60.0441 33.145L59.8294 33.3763L59.5897 33.5683L59.3226 33.7222L59.0352 33.8354L58.7359 33.9034L58.4199 33.9273Z' fill='%2368B308'/%3e%3crect x='37.1311' y='5.84473' width='27.7096' height='4.22688' rx='2.11344' fill='%23355F00'/%3e%3crect x='52.6296' y='12.8896' width='12.211' height='4.22688' rx='2.11344' fill='%23355F00'/%3e%3cpath d='M33.1593 55.021L30.0422 51.1157L29.8096 50.777L29.632 50.4061H7.97889L7.27413 50.3751L6.58488 50.2833L5.90874 50.133L5.24691 49.9244L4.61013 49.6596L3.99481 49.34L3.4093 48.968L2.85718 48.5458L2.33726 48.07L1.86146 47.5489L1.43813 46.998L1.06608 46.4125L0.746494 45.7972L0.482957 45.1604L0.274273 44.4986L0.122825 43.8224L0.0321993 43.1332L0 42.4284V20.5822L0.0321993 19.8786L0.122825 19.1894L0.273079 18.512L0.482957 17.8502L0.746494 17.2134L1.06608 16.5981L1.43813 16.0126L1.86146 15.4617L2.33726 14.9406L2.85718 14.4648L3.4093 14.0414L3.99481 13.6706L4.61013 13.3498L5.24691 13.0863L5.90874 12.8776L6.58488 12.7273L7.27413 12.6355L7.97889 12.6045H42.9317L43.6353 12.6355L44.3245 12.7273L45.0018 12.8776L45.6637 13.0863L46.3004 13.351L46.9158 13.6706L47.5013 14.0426L48.0522 14.4648L48.5733 14.9406L49.0491 15.4617L49.4712 16.0138L49.8433 16.5981L50.1641 17.2134L50.4276 17.8514L50.6363 18.512L50.7877 19.1894L50.8784 19.8786L50.9094 20.5822V42.4284L50.882 43.0914L50.8044 43.7306L50.678 44.3495L50.5027 44.9505L50.2797 45.5372L50.0174 46.0977L49.7145 46.6307L49.3699 47.1399L48.9871 47.6217L48.5721 48.07L48.1249 48.4838L47.6432 48.8666L47.134 49.2113L46.5998 49.5141L46.0405 49.7765L45.4526 49.9995L44.8528 50.1736L44.2339 50.3L43.5935 50.3775L42.9317 50.4061H40.8448L40.666 50.7758L40.4334 51.1157L37.3163 55.021L37.0408 55.3168L36.7332 55.5612L36.3909 55.758L36.0236 55.9023L35.6409 55.9905L35.2378 56.0215L34.8347 55.9905L34.452 55.9023L34.0847 55.758L33.7424 55.5612L33.4348 55.3168L33.1593 55.021Z' fill='url(%23paint0_linear_348_28783)'/%3e%3cpath d='M15.4892 31.932L15.4523 32.4651L15.3497 32.9671L15.1839 33.4429L14.9574 33.8937L14.6807 34.3039L14.3516 34.6771L13.9783 35.0051L13.5681 35.2817L13.1174 35.5083L12.6416 35.6752L12.1395 35.7766L11.6065 35.8136L11.0735 35.7766L10.5714 35.6752L10.0956 35.5083L9.64487 35.2817L9.23466 35.0051L8.86141 34.6771L8.53348 34.3039L8.25682 33.8937L8.03025 33.4429L7.8633 32.9671L7.76194 32.4651L7.72498 31.932L7.76194 31.399L7.8633 30.897L8.03025 30.4212L8.25682 29.9704L8.53348 29.5602L8.86141 29.1869L9.23466 28.8578L9.64487 28.5812L10.0956 28.3546L10.5714 28.1888L11.0735 28.0863L11.6065 28.0493L12.1395 28.0863L12.6416 28.1888L13.1174 28.3546L13.5681 28.5812L13.9783 28.8578L14.3516 29.1869L14.6807 29.5602L14.9574 29.9704L15.1839 30.4212L15.3497 30.897L15.4523 31.399L15.4892 31.932Z' fill='%2324262B'/%3e%3cpath d='M29.4136 31.932L29.3755 32.4651L29.2717 32.9671L29.1024 33.4429L28.871 33.8925L28.5884 34.3027L28.2533 34.6771L27.8729 35.0051L27.4544 35.2817L26.9941 35.5083L26.5087 35.6752L25.996 35.7766L25.4522 35.8136L24.9072 35.7766L24.3957 35.6752L23.9103 35.5083L23.45 35.2817L23.0315 35.0051L22.6511 34.6771L22.3148 34.3027L22.0322 33.8925L21.802 33.4429L21.6327 32.9671L21.5278 32.4651L21.4908 31.932L21.5278 31.399L21.6327 30.897L21.802 30.4212L22.0322 29.9704L22.3148 29.5602L22.6511 29.1869L23.0315 28.8578L23.45 28.5812L23.9103 28.3546L24.3957 28.1888L24.9072 28.0863L25.4522 28.0493L25.996 28.0863L26.5087 28.1888L26.9941 28.3546L27.4544 28.5812L27.8729 28.8578L28.2533 29.1869L28.5884 29.5602L28.871 29.9704L29.1024 30.4212L29.2717 30.897L29.3755 31.399L29.4136 31.932Z' fill='%2324262B'/%3e%3cpath d='M43.1859 31.932L43.1489 32.4651L43.0475 32.9671L42.8806 33.4429L42.654 33.8937L42.3774 34.3039L42.0494 34.6771L41.6762 35.0051L41.266 35.2817L40.8152 35.5083L40.3394 35.6752L39.8374 35.7766L39.3043 35.8136L38.7701 35.7766L38.2681 35.6752L37.7923 35.5083L37.3427 35.2817L36.9325 35.0051L36.5593 34.6771L36.2301 34.3039L35.9535 33.8937L35.7269 33.4429L35.5611 32.9671L35.4586 32.4651L35.4216 31.932L35.4586 31.399L35.5611 30.897L35.7269 30.4212L35.9535 29.9704L36.2301 29.5602L36.5593 29.1869L36.9325 28.8578L37.3427 28.5812L37.7923 28.3546L38.2681 28.1888L38.7701 28.0863L39.3043 28.0493L39.8374 28.0863L40.3394 28.1888L40.8152 28.3546L41.266 28.5812L41.6762 28.8578L42.0494 29.1869L42.3774 29.5602L42.654 29.9704L42.8806 30.4212L43.0475 30.897L43.1489 31.399L43.1859 31.932Z' fill='%2324262B'/%3e%3cdefs%3e%3clinearGradient id='paint0_linear_348_28783' x1='0' y1='34.313' x2='50.9094' y2='34.313' gradientUnits='userSpaceOnUse'%3e%3cstop stop-color='%239CFF1E'/%3e%3cstop offset='0.5' stop-color='%239CFF1E'/%3e%3cstop offset='1' stop-color='%239CFF1E'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e";
2
+
3
+ export { img as default };
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ import "./style/index.scss";
3
+ interface INoData {
4
+ className?: string;
5
+ style?: React.CSSProperties;
6
+ }
7
+ declare const NoData: React.FC<INoData>;
8
+ export default NoData;
@@ -0,0 +1,20 @@
1
+ import React from 'react';
2
+ import img from './image/no-data.svg.js';
3
+ import './style/index.scss';
4
+ import classNames from 'classnames';
5
+
6
+ /* eslint-disable jsx-a11y/alt-text */
7
+ /* eslint-disable @next/next/no-img-element */
8
+ var NoData = function NoData(props) {
9
+ var className = props.className,
10
+ _props$style = props.style,
11
+ style = _props$style === void 0 ? {} : _props$style;
12
+ return /*#__PURE__*/React.createElement("div", {
13
+ className: classNames("yuze-im-noData flex justify-center items-center h-full", className),
14
+ style: style
15
+ }, /*#__PURE__*/React.createElement("img", {
16
+ src: img
17
+ }));
18
+ };
19
+
20
+ export { NoData as default };
@@ -0,0 +1,3 @@
1
+ .yuze-im-noData{
2
+
3
+ }
@@ -0,0 +1,7 @@
1
+ import React from "react";
2
+ import "./style/index.scss";
3
+ export interface IPanelBar {
4
+ name?: string;
5
+ }
6
+ declare const Panelbar: React.FC<IPanelBar>;
7
+ export default Panelbar;
@@ -0,0 +1,3 @@
1
+ div {
2
+ color: var(--im-test-color);
3
+ }
@@ -0,0 +1,7 @@
1
+ import React from "react";
2
+ import "./style/index.scss";
3
+ export interface ISharebox {
4
+ name?: string;
5
+ }
6
+ declare const Sharebox: React.FC<ISharebox>;
7
+ export default Sharebox;
@@ -0,0 +1,12 @@
1
+ import React from 'react';
2
+ import classNames from 'classnames';
3
+ import './style/index.scss';
4
+
5
+ var Sharebox = function Sharebox(props) {
6
+ var name = props.name;
7
+ return /*#__PURE__*/React.createElement("div", {
8
+ className: classNames("yuze-shareBox")
9
+ }, name);
10
+ };
11
+
12
+ export { Sharebox as default };
File without changes
@@ -0,0 +1,21 @@
1
+ import React from "react";
2
+ import "./style/index.scss";
3
+ export interface ICreateGroup {
4
+ name?: string;
5
+ onClose?: () => void;
6
+ open?: boolean;
7
+ }
8
+ export interface IUserData {
9
+ walletaddress: string;
10
+ headimgurl: string;
11
+ nickname: string;
12
+ name: string;
13
+ id: string;
14
+ type: number;
15
+ userid: string;
16
+ username: string;
17
+ certification: number;
18
+ status: number;
19
+ }
20
+ declare const CreateGroup: React.FC<ICreateGroup>;
21
+ export default CreateGroup;
@@ -0,0 +1,186 @@
1
+ import _toConsumableArray from '@babel/runtime-corejs3/helpers/esm/toConsumableArray';
2
+ import _asyncToGenerator from '@babel/runtime-corejs3/helpers/esm/asyncToGenerator';
3
+ import _slicedToArray from '@babel/runtime-corejs3/helpers/esm/slicedToArray';
4
+ import _mapInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/map';
5
+ import _findInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/find';
6
+ import _concatInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/concat';
7
+ import _filterInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/filter';
8
+ import _regeneratorRuntime from '@babel/runtime-corejs3/regenerator';
9
+ import React, { useContext, useState, useEffect } from 'react';
10
+ import { Modal, Input, Avatar } from 'agora-chat-uikit';
11
+ import { Button } from 'antd';
12
+ import TypeItem from '../../TypeItem/index.js';
13
+ import { Context } from '../../IM/context.js';
14
+ import { useDebounceCallback } from 'usehooks-ts';
15
+ import img from '../image/ic_close.svg.js';
16
+ import './style/index.scss';
17
+
18
+ var CreateGroup = function CreateGroup(props) {
19
+ var onClose = props.onClose,
20
+ _props$open = props.open,
21
+ open = _props$open === void 0 ? false : _props$open;
22
+ var _useContext = useContext(Context),
23
+ http = _useContext.http;
24
+ var _useState = useState([]),
25
+ _useState2 = _slicedToArray(_useState, 2),
26
+ list = _useState2[0],
27
+ setList = _useState2[1];
28
+ var _useState3 = useState([]),
29
+ _useState4 = _slicedToArray(_useState3, 2),
30
+ member = _useState4[0],
31
+ setMember = _useState4[1];
32
+ var handleGetFrindList = /*#__PURE__*/function () {
33
+ var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(keyword) {
34
+ var result, list;
35
+ return _regeneratorRuntime.wrap(function _callee$(_context) {
36
+ while (1) switch (_context.prev = _context.next) {
37
+ case 0:
38
+ _context.next = 2;
39
+ return http.post("/capi/account/imsearch/findpage", {
40
+ keyword: keyword,
41
+ type: 2,
42
+ userid: "fpn467kwz4rgzynyytb7enhqnjanggswe1hy5q8cja8",
43
+ size: 10,
44
+ page: 1
45
+ });
46
+ case 2:
47
+ result = _context.sent;
48
+ list = result.data.data.list;
49
+ setList(list);
50
+ case 5:
51
+ case "end":
52
+ return _context.stop();
53
+ }
54
+ }, _callee);
55
+ }));
56
+ return function handleGetFrindList(_x) {
57
+ return _ref.apply(this, arguments);
58
+ };
59
+ }();
60
+ var handleDebounceGetFrindList = useDebounceCallback(handleGetFrindList, 100);
61
+ var handleCreateGroup = /*#__PURE__*/function () {
62
+ var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
63
+ var _result2$data;
64
+ var result1, data, result2;
65
+ return _regeneratorRuntime.wrap(function _callee2$(_context2) {
66
+ while (1) switch (_context2.prev = _context2.next) {
67
+ case 0:
68
+ _context2.next = 2;
69
+ return http.get("/capi/account/imchannel/imchannelconfig");
70
+ case 2:
71
+ result1 = _context2.sent;
72
+ data = {
73
+ name: _mapInstanceProperty(member).call(member, function (item) {
74
+ return item.name;
75
+ }).join(","),
76
+ customtype: "chat_group",
77
+ headimgurl: result1.data.data.headimgurl,
78
+ memberids: _mapInstanceProperty(member).call(member, function (item) {
79
+ return item.userid;
80
+ })
81
+ };
82
+ _context2.next = 6;
83
+ return http.post("/capi/account/imchannel/save", data);
84
+ case 6:
85
+ result2 = _context2.sent;
86
+ if ((_result2$data = result2.data) !== null && _result2$data !== void 0 && (_result2$data = _result2$data.data) !== null && _result2$data !== void 0 && _result2$data.sendbirdid) {
87
+ onClose && onClose();
88
+ }
89
+ case 8:
90
+ case "end":
91
+ return _context2.stop();
92
+ }
93
+ }, _callee2);
94
+ }));
95
+ return function handleCreateGroup() {
96
+ return _ref2.apply(this, arguments);
97
+ };
98
+ }();
99
+ var handleDebounceCreateGroup = useDebounceCallback(handleCreateGroup, 100);
100
+ useEffect(function () {
101
+ handleGetFrindList();
102
+ }, []);
103
+ return /*#__PURE__*/React.createElement(Modal, {
104
+ open: open,
105
+ footer: /*#__PURE__*/React.createElement(React.Fragment, null),
106
+ className: "yuze-createGroup",
107
+ width: 820
108
+ }, /*#__PURE__*/React.createElement("div", {
109
+ className: "yuze-createGroup-left flex-1 flex flex-col items-center"
110
+ }, /*#__PURE__*/React.createElement("div", {
111
+ className: "yuze-createGroup-left-title"
112
+ }, /*#__PURE__*/React.createElement("span", {
113
+ className: "text-lg"
114
+ }, "New Group")), /*#__PURE__*/React.createElement(Input, {
115
+ className: "my-3",
116
+ onChange: function onChange(e) {
117
+ handleDebounceGetFrindList(e.target.value);
118
+ }
119
+ }), /*#__PURE__*/React.createElement("div", {
120
+ className: "yuze-createGroup-left-list w-full overflow-auto"
121
+ }, _mapInstanceProperty(list).call(list, function (item) {
122
+ return /*#__PURE__*/React.createElement(TypeItem, {
123
+ isSelectable: true,
124
+ name: item.name,
125
+ isChecked: !!_findInstanceProperty(member).call(member, function (child) {
126
+ return child.id === item.id;
127
+ }),
128
+ key: item.id,
129
+ avatar: item.headimgurl,
130
+ onSelected: function onSelected() {
131
+ var _context3;
132
+ setMember(_concatInstanceProperty(_context3 = []).call(_context3, _toConsumableArray(member), [item]));
133
+ },
134
+ onCancel: function onCancel() {
135
+ var filterMember = _filterInstanceProperty(member).call(member, function (child) {
136
+ return child.id !== item.id;
137
+ });
138
+ setMember(filterMember);
139
+ }
140
+ });
141
+ }))), /*#__PURE__*/React.createElement("div", {
142
+ className: "yuze-createGroup-right flex-1 ml-2"
143
+ }, /*#__PURE__*/React.createElement("div", {
144
+ className: "yuze-createGroup-right-title"
145
+ }, /*#__PURE__*/React.createElement("span", {
146
+ className: "text-sm"
147
+ }, "Group Member(2/2000)")), /*#__PURE__*/React.createElement("div", {
148
+ className: "yuze-createGroup-right-list flex flex-row gap-5 py-4 flex-wrap overflow-auto"
149
+ }, _mapInstanceProperty(member).call(member, function (item) {
150
+ return /*#__PURE__*/React.createElement("div", {
151
+ className: "yuze-createGroup-right-list-member relative",
152
+ key: item.id,
153
+ onClick: function onClick() {
154
+ var filterMember = _filterInstanceProperty(member).call(member, function (child) {
155
+ return child.id !== item.id;
156
+ });
157
+ setMember(filterMember);
158
+ }
159
+ }, /*#__PURE__*/React.createElement(Avatar, {
160
+ src: item.headimgurl
161
+ }), /*#__PURE__*/React.createElement("div", {
162
+ className: "yuze-createGroup-right-list-member-close absolute"
163
+ }, /*#__PURE__*/React.createElement("img", {
164
+ src: img
165
+ })));
166
+ })), /*#__PURE__*/React.createElement("div", {
167
+ className: "yuze-createGroup-right-button flex justify-center gap-5 px-5"
168
+ }, /*#__PURE__*/React.createElement(Button, {
169
+ type: "default",
170
+ className: "flex-1 bg-transparent",
171
+ size: "large",
172
+ onClick: function onClick() {
173
+ setMember([]);
174
+ onClose && onClose();
175
+ }
176
+ }, "Close"), /*#__PURE__*/React.createElement(Button, {
177
+ type: "primary",
178
+ className: "flex-1",
179
+ size: "large",
180
+ onClick: function onClick() {
181
+ handleDebounceCreateGroup();
182
+ }
183
+ }, "Create"))));
184
+ };
185
+
186
+ export { CreateGroup as default };