@smart-link/rn-im 1.0.1
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/README.md +34 -0
- package/assets/avatars-busi-notify.png +0 -0
- package/assets/avatars-empty.png +0 -0
- package/assets/avatars-group.jpg +0 -0
- package/assets/avatars-man.jpg +0 -0
- package/assets/avatars-woman.jpg +0 -0
- package/assets/cloud-backup-begin.png +0 -0
- package/assets/cloud-backup.png +0 -0
- package/assets/group-mgr.png +0 -0
- package/assets/group-owner.png +0 -0
- package/assets/hook-black-double.png +0 -0
- package/assets/hook-black.png +0 -0
- package/assets/hook-blue-double.png +0 -0
- package/assets/hook-blue.png +0 -0
- package/assets/hook-green.png +0 -0
- package/assets/no_message.png +0 -0
- package/assets/share.jpeg +0 -0
- package/assets/voice-left-playing.gif +0 -0
- package/assets/voice-left.png +0 -0
- package/dist/api/addressList.d.ts +27 -0
- package/dist/api/addressList.js +18 -0
- package/dist/api/backup.d.ts +18 -0
- package/dist/api/backup.js +29 -0
- package/dist/api/file.d.ts +4 -0
- package/dist/api/file.js +49 -0
- package/dist/api/user.d.ts +8 -0
- package/dist/api/user.js +16 -0
- package/dist/components/CachedImage.d.ts +11 -0
- package/dist/components/CachedImage.js +48 -0
- package/dist/components/Camera/Camera.d.ts +10 -0
- package/dist/components/Camera/Camera.js +100 -0
- package/dist/components/Camera/CameraCapture.d.ts +32 -0
- package/dist/components/Camera/CameraCapture.js +360 -0
- package/dist/components/Camera/CameraResult.d.ts +11 -0
- package/dist/components/Camera/CameraResult.js +102 -0
- package/dist/components/ChatAvatar/ChatAvatar.d.ts +15 -0
- package/dist/components/ChatAvatar/ChatAvatar.js +134 -0
- package/dist/components/ChatAvatar/ChatAvatarId.d.ts +8 -0
- package/dist/components/ChatAvatar/ChatAvatarId.js +92 -0
- package/dist/components/ChatAvatar/ChatAvatarLocal.d.ts +9 -0
- package/dist/components/ChatAvatar/ChatAvatarLocal.js +76 -0
- package/dist/components/ChatAvatar/index.d.ts +2 -0
- package/dist/components/ChatAvatar/index.js +23 -0
- package/dist/components/Favicon.d.ts +7 -0
- package/dist/components/Favicon.js +74 -0
- package/dist/components/FormatTimeText.d.ts +8 -0
- package/dist/components/FormatTimeText.js +24 -0
- package/dist/components/Highlighter.d.ts +9 -0
- package/dist/components/Highlighter.js +42 -0
- package/dist/components/IndicatorText.d.ts +10 -0
- package/dist/components/IndicatorText.js +47 -0
- package/dist/components/LocalImage.d.ts +10 -0
- package/dist/components/LocalImage.js +37 -0
- package/dist/components/NetworkUnconnected.d.ts +3 -0
- package/dist/components/NetworkUnconnected.js +55 -0
- package/dist/components/PopoverWrapper.d.ts +13 -0
- package/dist/components/PopoverWrapper.js +78 -0
- package/dist/components/VideoPlayer.d.ts +13 -0
- package/dist/components/VideoPlayer.js +288 -0
- package/dist/components/styles.d.ts +19 -0
- package/dist/components/styles.js +23 -0
- package/dist/default-assets.d.ts +18 -0
- package/dist/default-assets.js +22 -0
- package/dist/hooks/useFormatMsgTime.d.ts +4 -0
- package/dist/hooks/useFormatMsgTime.js +53 -0
- package/dist/hooks/useImSelector.d.ts +15 -0
- package/dist/hooks/useImSelector.js +48 -0
- package/dist/hooks/useTranslation.d.ts +13 -0
- package/dist/hooks/useTranslation.js +12 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +28 -0
- package/dist/init.d.ts +17 -0
- package/dist/init.js +116 -0
- package/dist/interface.d.ts +47 -0
- package/dist/interface.js +2 -0
- package/dist/locales/en/addressList.d.ts +3 -0
- package/dist/locales/en/addressList.js +31 -0
- package/dist/locales/index.d.ts +4 -0
- package/dist/locales/index.js +27 -0
- package/dist/locales/lao/addressList.d.ts +3 -0
- package/dist/locales/lao/addressList.js +31 -0
- package/dist/locales/zh/addressList.d.ts +30 -0
- package/dist/locales/zh/addressList.js +32 -0
- package/dist/pages/address-list/AddressList.d.ts +6 -0
- package/dist/pages/address-list/AddressList.js +158 -0
- package/dist/pages/address-list/CardInfo.d.ts +15 -0
- package/dist/pages/address-list/CardInfo.js +42 -0
- package/dist/pages/address-list/ChooseContact.d.ts +6 -0
- package/dist/pages/address-list/ChooseContact.js +197 -0
- package/dist/pages/address-list/Icons.d.ts +5 -0
- package/dist/pages/address-list/Icons.js +16 -0
- package/dist/pages/address-list/Organization.d.ts +13 -0
- package/dist/pages/address-list/Organization.js +221 -0
- package/dist/pages/address-list/UserDetail.d.ts +6 -0
- package/dist/pages/address-list/UserDetail.js +131 -0
- package/dist/pages/address-list/UserJobs.d.ts +6 -0
- package/dist/pages/address-list/UserJobs.js +50 -0
- package/dist/pages/address-list/UserSearch.d.ts +6 -0
- package/dist/pages/address-list/UserSearch.js +82 -0
- package/dist/pages/address-list/addressList.routes.d.ts +50 -0
- package/dist/pages/address-list/addressList.routes.js +50 -0
- package/dist/pages/collection/Collection.d.ts +3 -0
- package/dist/pages/collection/Collection.js +136 -0
- package/dist/pages/collection/ContentFactory.d.ts +6 -0
- package/dist/pages/collection/ContentFactory.js +167 -0
- package/dist/pages/collection/collection.routes.d.ts +9 -0
- package/dist/pages/collection/collection.routes.js +17 -0
- package/dist/pages/conversation/ForwardToConversation.d.ts +6 -0
- package/dist/pages/conversation/ForwardToConversation.js +172 -0
- package/dist/pages/conversation/List.d.ts +6 -0
- package/dist/pages/conversation/List.js +204 -0
- package/dist/pages/conversation/components/ConversationCard.d.ts +12 -0
- package/dist/pages/conversation/components/ConversationCard.js +142 -0
- package/dist/pages/conversation/components/ConversationOption.d.ts +11 -0
- package/dist/pages/conversation/components/ConversationOption.js +99 -0
- package/dist/pages/conversation/conversation.routes.d.ts +2 -0
- package/dist/pages/conversation/conversation.routes.js +74 -0
- package/dist/pages/conversation/setting/GroupTransfer.d.ts +6 -0
- package/dist/pages/conversation/setting/GroupTransfer.js +88 -0
- package/dist/pages/conversation/setting/OptionAvatars.d.ts +22 -0
- package/dist/pages/conversation/setting/OptionAvatars.js +152 -0
- package/dist/pages/conversation/setting/OptionCancelGroup.d.ts +6 -0
- package/dist/pages/conversation/setting/OptionCancelGroup.js +49 -0
- package/dist/pages/conversation/setting/OptionConversation.d.ts +19 -0
- package/dist/pages/conversation/setting/OptionConversation.js +71 -0
- package/dist/pages/conversation/setting/OptionGroup.d.ts +17 -0
- package/dist/pages/conversation/setting/OptionGroup.js +76 -0
- package/dist/pages/conversation/setting/OptionGroupManage.d.ts +6 -0
- package/dist/pages/conversation/setting/OptionGroupManage.js +68 -0
- package/dist/pages/conversation/setting/OptionGroupMoreMember.d.ts +4 -0
- package/dist/pages/conversation/setting/OptionGroupMoreMember.js +124 -0
- package/dist/pages/conversation/setting/OptionGroupNameOrNoticeEdit.d.ts +6 -0
- package/dist/pages/conversation/setting/OptionGroupNameOrNoticeEdit.js +149 -0
- package/dist/pages/conversation/setting/Setting.d.ts +6 -0
- package/dist/pages/conversation/setting/Setting.js +184 -0
- package/dist/pages/conversation/setting/SettingChatBg.d.ts +6 -0
- package/dist/pages/conversation/setting/SettingChatBg.js +95 -0
- package/dist/pages/index.d.ts +8 -0
- package/dist/pages/index.js +27 -0
- package/dist/pages/message/ChooseMember.d.ts +6 -0
- package/dist/pages/message/ChooseMember.js +185 -0
- package/dist/pages/message/MessageBackup/Bar.d.ts +8 -0
- package/dist/pages/message/MessageBackup/Bar.js +77 -0
- package/dist/pages/message/MessageBackup/MessageBackup.d.ts +10 -0
- package/dist/pages/message/MessageBackup/MessageBackup.js +133 -0
- package/dist/pages/message/MessageBackup/RestoreBackupPage.d.ts +6 -0
- package/dist/pages/message/MessageBackup/RestoreBackupPage.js +135 -0
- package/dist/pages/message/MessageBackup/StartBackupPage.d.ts +6 -0
- package/dist/pages/message/MessageBackup/StartBackupPage.js +135 -0
- package/dist/pages/message/MessageBackup/index.d.ts +3 -0
- package/dist/pages/message/MessageBackup/index.js +12 -0
- package/dist/pages/message/MessageBackup/utils.d.ts +46 -0
- package/dist/pages/message/MessageBackup/utils.js +239 -0
- package/dist/pages/message/MessageList.d.ts +6 -0
- package/dist/pages/message/MessageList.js +175 -0
- package/dist/pages/message/MessageRecord.d.ts +6 -0
- package/dist/pages/message/MessageRecord.js +97 -0
- package/dist/pages/message/components/BusiNotifyCard.d.ts +6 -0
- package/dist/pages/message/components/BusiNotifyCard.js +132 -0
- package/dist/pages/message/components/ChatBg.d.ts +7 -0
- package/dist/pages/message/components/ChatBg.js +65 -0
- package/dist/pages/message/components/MessageItem.d.ts +16 -0
- package/dist/pages/message/components/MessageItem.js +205 -0
- package/dist/pages/message/components/MessageItemQuote.d.ts +7 -0
- package/dist/pages/message/components/MessageItemQuote.js +83 -0
- package/dist/pages/message/components/MessageItemTips.d.ts +9 -0
- package/dist/pages/message/components/MessageItemTips.js +67 -0
- package/dist/pages/message/components/MessageOption.d.ts +11 -0
- package/dist/pages/message/components/MessageOption.js +360 -0
- package/dist/pages/message/components/MessagePayload.d.ts +14 -0
- package/dist/pages/message/components/MessagePayload.js +96 -0
- package/dist/pages/message/components/MessagePictureAlbum.d.ts +10 -0
- package/dist/pages/message/components/MessagePictureAlbum.js +105 -0
- package/dist/pages/message/components/MessageReceiptStatus.d.ts +6 -0
- package/dist/pages/message/components/MessageReceiptStatus.js +61 -0
- package/dist/pages/message/components/MessageUndo.d.ts +10 -0
- package/dist/pages/message/components/MessageUndo.js +75 -0
- package/dist/pages/message/components/MultipleBar/index.d.ts +5 -0
- package/dist/pages/message/components/MultipleBar/index.js +116 -0
- package/dist/pages/message/components/Payload/PayloadContact.d.ts +4 -0
- package/dist/pages/message/components/Payload/PayloadContact.js +86 -0
- package/dist/pages/message/components/Payload/PayloadFile.d.ts +4 -0
- package/dist/pages/message/components/Payload/PayloadFile.js +115 -0
- package/dist/pages/message/components/Payload/PayloadMultiple.d.ts +4 -0
- package/dist/pages/message/components/Payload/PayloadMultiple.js +102 -0
- package/dist/pages/message/components/Payload/PayloadNotify.d.ts +9 -0
- package/dist/pages/message/components/Payload/PayloadNotify.js +92 -0
- package/dist/pages/message/components/Payload/PayloadPicture.d.ts +7 -0
- package/dist/pages/message/components/Payload/PayloadPicture.js +69 -0
- package/dist/pages/message/components/Payload/PayloadShare.d.ts +4 -0
- package/dist/pages/message/components/Payload/PayloadShare.js +100 -0
- package/dist/pages/message/components/Payload/PayloadText.d.ts +4 -0
- package/dist/pages/message/components/Payload/PayloadText.js +128 -0
- package/dist/pages/message/components/Payload/PayloadVideo.d.ts +4 -0
- package/dist/pages/message/components/Payload/PayloadVideo.js +78 -0
- package/dist/pages/message/components/Payload/PayloadVoice.d.ts +6 -0
- package/dist/pages/message/components/Payload/PayloadVoice.js +155 -0
- package/dist/pages/message/components/Payload/PayloadWrapper.d.ts +12 -0
- package/dist/pages/message/components/Payload/PayloadWrapper.js +73 -0
- package/dist/pages/message/components/Payload/type.d.ts +9 -0
- package/dist/pages/message/components/Payload/type.js +2 -0
- package/dist/pages/message/components/ReceiptBack.d.ts +7 -0
- package/dist/pages/message/components/ReceiptBack.js +82 -0
- package/dist/pages/message/components/TextMixMessage.d.ts +9 -0
- package/dist/pages/message/components/TextMixMessage.js +62 -0
- package/dist/pages/message/components/TextMixQuote.d.ts +61 -0
- package/dist/pages/message/components/TextMixQuote.js +276 -0
- package/dist/pages/message/components/TextMixQuoteMessage.d.ts +14 -0
- package/dist/pages/message/components/TextMixQuoteMessage.js +74 -0
- package/dist/pages/message/components/UploadProgress.d.ts +9 -0
- package/dist/pages/message/components/UploadProgress.js +51 -0
- package/dist/pages/message/components/messageBar/EmojiPanel.d.ts +11 -0
- package/dist/pages/message/components/messageBar/EmojiPanel.js +101 -0
- package/dist/pages/message/components/messageBar/Icons.d.ts +18 -0
- package/dist/pages/message/components/messageBar/Icons.js +88 -0
- package/dist/pages/message/components/messageBar/MessageBar.d.ts +12 -0
- package/dist/pages/message/components/messageBar/MessageBar.js +273 -0
- package/dist/pages/message/components/messageBar/MessageInput.d.ts +21 -0
- package/dist/pages/message/components/messageBar/MessageInput.js +203 -0
- package/dist/pages/message/components/messageBar/OptionPanel.d.ts +8 -0
- package/dist/pages/message/components/messageBar/OptionPanel.js +240 -0
- package/dist/pages/message/components/messageBar/VoiceBar.d.ts +3 -0
- package/dist/pages/message/components/messageBar/VoiceBar.js +272 -0
- package/dist/pages/message/components/messageBar/index.d.ts +2 -0
- package/dist/pages/message/components/messageBar/index.js +23 -0
- package/dist/pages/message/message.routes.d.ts +2 -0
- package/dist/pages/message/message.routes.js +79 -0
- package/dist/pages/search/Search.d.ts +6 -0
- package/dist/pages/search/Search.js +84 -0
- package/dist/pages/search/SearchChatRecords.d.ts +3 -0
- package/dist/pages/search/SearchChatRecords.js +173 -0
- package/dist/pages/search/SearchFile.d.ts +3 -0
- package/dist/pages/search/SearchFile.js +202 -0
- package/dist/pages/search/SearchManager.d.ts +6 -0
- package/dist/pages/search/SearchManager.js +111 -0
- package/dist/pages/search/SearchPicturePage.d.ts +6 -0
- package/dist/pages/search/SearchPicturePage.js +56 -0
- package/dist/pages/search/components/ChatRecords.d.ts +6 -0
- package/dist/pages/search/components/ChatRecords.js +151 -0
- package/dist/pages/search/components/MyGroupChat.d.ts +6 -0
- package/dist/pages/search/components/MyGroupChat.js +128 -0
- package/dist/pages/search/components/PictureMulipleBar.d.ts +10 -0
- package/dist/pages/search/components/PictureMulipleBar.js +105 -0
- package/dist/pages/search/components/SearchFileList.d.ts +7 -0
- package/dist/pages/search/components/SearchFileList.js +173 -0
- package/dist/pages/search/components/SearchPictures.d.ts +8 -0
- package/dist/pages/search/components/SearchPictures.js +220 -0
- package/dist/pages/search/components/SearchShareLinkList.d.ts +7 -0
- package/dist/pages/search/components/SearchShareLinkList.js +112 -0
- package/dist/pages/search/components/SearchUser.d.ts +6 -0
- package/dist/pages/search/components/SearchUser.js +83 -0
- package/dist/pages/search/components/useSearchMessage.d.ts +11 -0
- package/dist/pages/search/components/useSearchMessage.js +68 -0
- package/dist/pages/search/search.routes.d.ts +2 -0
- package/dist/pages/search/search.routes.js +48 -0
- package/dist/pages/search/utils.d.ts +12 -0
- package/dist/pages/search/utils.js +42 -0
- package/dist/pages/types.d.ts +70 -0
- package/dist/pages/types.js +2 -0
- package/dist/slice/contact/contact.action.d.ts +1 -0
- package/dist/slice/contact/contact.action.js +2 -0
- package/dist/slice/contact/contact.slice.d.ts +12 -0
- package/dist/slice/contact/contact.slice.js +60 -0
- package/dist/slice/index.d.ts +9 -0
- package/dist/slice/index.js +15 -0
- package/dist/slice/panel/panel.slice.d.ts +8 -0
- package/dist/slice/panel/panel.slice.js +19 -0
- package/dist/slice/video/video.action.d.ts +5 -0
- package/dist/slice/video/video.action.js +65 -0
- package/dist/slice/video/video.slice.d.ts +17 -0
- package/dist/slice/video/video.slice.js +40 -0
- package/dist/utils/color.d.ts +1 -0
- package/dist/utils/color.js +9 -0
- package/dist/utils/common-action-sheet.d.ts +8 -0
- package/dist/utils/common-action-sheet.js +45 -0
- package/dist/utils/cookie.d.ts +1 -0
- package/dist/utils/cookie.js +29 -0
- package/dist/utils/emoji.d.ts +9 -0
- package/dist/utils/emoji.js +627 -0
- package/dist/utils/file-icon.d.ts +7 -0
- package/dist/utils/file-icon.js +80 -0
- package/dist/utils/file-operate.d.ts +1 -0
- package/dist/utils/file-operate.js +4 -0
- package/dist/utils/file.d.ts +23 -0
- package/dist/utils/file.js +255 -0
- package/dist/utils/golden-rectangle.d.ts +4 -0
- package/dist/utils/golden-rectangle.js +34 -0
- package/dist/utils/phone.d.ts +2 -0
- package/dist/utils/phone.js +24 -0
- package/dist/utils/request.d.ts +34 -0
- package/dist/utils/request.js +67 -0
- package/dist/utils/scroll.d.ts +1 -0
- package/dist/utils/scroll.js +12 -0
- package/dist/utils/summary.d.ts +2 -0
- package/dist/utils/summary.js +42 -0
- package/dist/utils/take-camera.d.ts +2 -0
- package/dist/utils/take-camera.js +41 -0
- package/dist/utils/text-mix.d.ts +9 -0
- package/dist/utils/text-mix.js +82 -0
- package/dist/utils/upload.d.ts +5 -0
- package/dist/utils/upload.js +80 -0
- package/package.json +79 -0
@@ -0,0 +1,112 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
|
+
};
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
+
const styles_1 = require("../../../components/styles");
|
7
|
+
const rn_ui_1 = require("@smart-link/rn-ui");
|
8
|
+
const react_native_1 = require("react-native");
|
9
|
+
const ChatAvatar_1 = __importDefault(require("../../../components/ChatAvatar"));
|
10
|
+
const dayjs_1 = __importDefault(require("dayjs"));
|
11
|
+
const react_1 = require("react");
|
12
|
+
const Favicon_1 = __importDefault(require("../../../components/Favicon"));
|
13
|
+
const useSearchMessage_1 = require("./useSearchMessage");
|
14
|
+
const useTranslation_1 = __importDefault(require("../../../hooks/useTranslation"));
|
15
|
+
const backgroundColor = '#fff';
|
16
|
+
const size = (0, rn_ui_1.dp)(45);
|
17
|
+
const SearchShareLinkList = ({ keyword, conversationId }) => {
|
18
|
+
const { t } = (0, useTranslation_1.default)();
|
19
|
+
const { data, onLoadMore } = (0, useSearchMessage_1.useSearchMessage)({
|
20
|
+
conversationId,
|
21
|
+
keyword,
|
22
|
+
payloadType: 'share',
|
23
|
+
});
|
24
|
+
if (data.length === 0) {
|
25
|
+
return <react_native_1.View style={styles.empty}>
|
26
|
+
<react_native_1.Text>{t('noSearchResult')}</react_native_1.Text>
|
27
|
+
</react_native_1.View>;
|
28
|
+
}
|
29
|
+
const keyExtractor = (item) => item.messageSeq;
|
30
|
+
const renderSectionHeader = ({ section }) => {
|
31
|
+
return (<react_native_1.Text style={styles.dateTxt}>{section.date}</react_native_1.Text>);
|
32
|
+
};
|
33
|
+
const renderItem = ({ item }) => {
|
34
|
+
const { messageFrom, messageFromName, payload = {}, } = item;
|
35
|
+
return (<react_native_1.TouchableOpacity style={[styles.item, { backgroundColor }]} activeOpacity={0.5} onPress={() => {
|
36
|
+
if (payload.url) {
|
37
|
+
react_native_1.Linking.openURL(payload.url);
|
38
|
+
}
|
39
|
+
}}>
|
40
|
+
<react_native_1.View style={styles.itemTop}>
|
41
|
+
<ChatAvatar_1.default disabled={true} id={messageFrom} name={messageFromName} size={(0, rn_ui_1.dp)(24)}/>
|
42
|
+
<react_native_1.Text style={styles.name} numberOfLines={1}>{messageFromName}</react_native_1.Text>
|
43
|
+
<react_native_1.Text style={styles.time}>{(0, dayjs_1.default)(item.messageTime).format("YYYY-MM-DD")}</react_native_1.Text>
|
44
|
+
</react_native_1.View>
|
45
|
+
<react_native_1.View style={styles.link}>
|
46
|
+
<react_native_1.View style={styles.linkInfo}>
|
47
|
+
<react_native_1.Text style={styles.title} numberOfLines={1} ellipsizeMode={'middle'}>{payload.title || payload.description}</react_native_1.Text>
|
48
|
+
<react_native_1.Text style={styles.description} numberOfLines={2} ellipsizeMode={'middle'}>{payload.description}</react_native_1.Text>
|
49
|
+
</react_native_1.View>
|
50
|
+
<Favicon_1.default url={payload.url} size={size}/>
|
51
|
+
</react_native_1.View>
|
52
|
+
</react_native_1.TouchableOpacity>);
|
53
|
+
};
|
54
|
+
return (<react_native_1.SectionList style={styles.view} sections={data} renderItem={renderItem} renderSectionHeader={renderSectionHeader} keyExtractor={keyExtractor} initialNumToRender={10} progressViewOffset={100} onEndReached={onLoadMore} onEndReachedThreshold={0.2}/>);
|
55
|
+
};
|
56
|
+
const styles = react_native_1.StyleSheet.create({
|
57
|
+
view: {
|
58
|
+
backgroundColor: "#F5F5F5"
|
59
|
+
},
|
60
|
+
empty: {
|
61
|
+
flex: 1,
|
62
|
+
alignItems: 'center',
|
63
|
+
justifyContent: 'center'
|
64
|
+
},
|
65
|
+
dateTxt: {
|
66
|
+
paddingVertical: (0, rn_ui_1.dp)(5),
|
67
|
+
paddingHorizontal: (0, rn_ui_1.dp)(12),
|
68
|
+
marginBottom: (0, rn_ui_1.dp)(5),
|
69
|
+
borderTopWidth: 1 / react_native_1.PixelRatio.get(),
|
70
|
+
borderBottomWidth: 1 / react_native_1.PixelRatio.get(),
|
71
|
+
borderColor: "#E3E3E3",
|
72
|
+
backgroundColor: "#EDEDED"
|
73
|
+
},
|
74
|
+
item: Object.assign(Object.assign({ marginBottom: (0, rn_ui_1.dp)(5), marginHorizontal: (0, rn_ui_1.dp)(12), paddingVertical: (0, rn_ui_1.dp)(12), paddingHorizontal: (0, rn_ui_1.dp)(20) }, styles_1.borderStyle), { borderWidth: 0 }),
|
75
|
+
itemTop: {
|
76
|
+
flex: 1,
|
77
|
+
flexDirection: "row",
|
78
|
+
alignItems: "center",
|
79
|
+
position: "relative"
|
80
|
+
},
|
81
|
+
name: {
|
82
|
+
paddingLeft: (0, rn_ui_1.dp)(10)
|
83
|
+
},
|
84
|
+
time: {
|
85
|
+
position: "absolute",
|
86
|
+
top: (0, rn_ui_1.dp)(5),
|
87
|
+
right: 0,
|
88
|
+
fontSize: (0, rn_ui_1.dp)(12),
|
89
|
+
color: '#a2a2a2'
|
90
|
+
},
|
91
|
+
link: {
|
92
|
+
flexDirection: 'row',
|
93
|
+
marginTop: (0, rn_ui_1.dp)(10)
|
94
|
+
},
|
95
|
+
linkInfo: {
|
96
|
+
flex: 1,
|
97
|
+
paddingRight: (0, rn_ui_1.dp)(10),
|
98
|
+
justifyContent: 'center'
|
99
|
+
},
|
100
|
+
title: {
|
101
|
+
fontSize: (0, rn_ui_1.dp)(15),
|
102
|
+
lineHeight: (0, rn_ui_1.dp)(20),
|
103
|
+
color: '#010101'
|
104
|
+
},
|
105
|
+
description: {
|
106
|
+
marginTop: (0, rn_ui_1.dp)(5),
|
107
|
+
fontSize: (0, rn_ui_1.dp)(12),
|
108
|
+
lineHeight: (0, rn_ui_1.dp)(14),
|
109
|
+
color: '#a2a2a2'
|
110
|
+
},
|
111
|
+
});
|
112
|
+
exports.default = (0, react_1.memo)(SearchShareLinkList);
|
@@ -0,0 +1,83 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
3
|
+
if (k2 === undefined) k2 = k;
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
7
|
+
}
|
8
|
+
Object.defineProperty(o, k2, desc);
|
9
|
+
}) : (function(o, m, k, k2) {
|
10
|
+
if (k2 === undefined) k2 = k;
|
11
|
+
o[k2] = m[k];
|
12
|
+
}));
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
15
|
+
}) : function(o, v) {
|
16
|
+
o["default"] = v;
|
17
|
+
});
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
19
|
+
if (mod && mod.__esModule) return mod;
|
20
|
+
var result = {};
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
22
|
+
__setModuleDefault(result, mod);
|
23
|
+
return result;
|
24
|
+
};
|
25
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
26
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
27
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
28
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
29
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
30
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
31
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
32
|
+
});
|
33
|
+
};
|
34
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
35
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
36
|
+
};
|
37
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
38
|
+
const rn_ui_1 = require("@smart-link/rn-ui");
|
39
|
+
const react_1 = __importStar(require("react"));
|
40
|
+
const react_native_1 = require("react-native");
|
41
|
+
const user_1 = require("../../../api/user");
|
42
|
+
const ChatAvatar_1 = __importDefault(require("../../../components/ChatAvatar/ChatAvatar"));
|
43
|
+
const Highlighter_1 = __importDefault(require("../../../components/Highlighter"));
|
44
|
+
const useTranslation_1 = __importDefault(require("../../../hooks/useTranslation"));
|
45
|
+
const init_1 = require("../../../init");
|
46
|
+
const RenderUserItem = (props) => {
|
47
|
+
return (<react_native_1.View style={{ flexDirection: 'row', alignItems: 'center' }}>
|
48
|
+
<ChatAvatar_1.default priority="outside" id={props.data.userId} url={props.data.avatars} name={props.data.userName}/>
|
49
|
+
<Highlighter_1.default style={{ marginLeft: (0, rn_ui_1.dp)(10), flex: 1 }} searchWord={props.keyword} textToHighlight={props.data.userName}/>
|
50
|
+
</react_native_1.View>);
|
51
|
+
};
|
52
|
+
const SearchUser = ({ keyword }) => {
|
53
|
+
const navigation = (0, rn_ui_1.useNavigation)();
|
54
|
+
const { t } = (0, useTranslation_1.default)();
|
55
|
+
const [userList, setUserList] = (0, react_1.useState)([]);
|
56
|
+
(0, react_1.useEffect)(() => {
|
57
|
+
if (!keyword || keyword === '') {
|
58
|
+
return;
|
59
|
+
}
|
60
|
+
(0, user_1.searchUser)({
|
61
|
+
searchKey: keyword,
|
62
|
+
}).then(({ data }) => {
|
63
|
+
setUserList(data);
|
64
|
+
});
|
65
|
+
}, [keyword]);
|
66
|
+
if (userList.length === 0) {
|
67
|
+
return (<react_native_1.View style={{
|
68
|
+
flex: 1,
|
69
|
+
justifyContent: 'center',
|
70
|
+
alignItems: 'center',
|
71
|
+
}}>
|
72
|
+
<react_native_1.Text>{t('noSearchResult')}</react_native_1.Text>
|
73
|
+
</react_native_1.View>);
|
74
|
+
}
|
75
|
+
return (<react_native_1.ScrollView style={{ flex: 1 }}>
|
76
|
+
{userList.map((item) => (<rn_ui_1.ListRow key={item.userId} onPress={() => __awaiter(void 0, void 0, void 0, function* () {
|
77
|
+
console.log('item', item);
|
78
|
+
yield (0, init_1.getImManager)().initUserConversation(item);
|
79
|
+
navigation.navigate('MessageList');
|
80
|
+
})} title={<RenderUserItem keyword={keyword} data={item}/>} topSeparator="full"/>))}
|
81
|
+
</react_native_1.ScrollView>);
|
82
|
+
};
|
83
|
+
exports.default = (0, react_1.memo)(SearchUser);
|
@@ -0,0 +1,11 @@
|
|
1
|
+
import { PayloadType } from "@smart-link/im-base";
|
2
|
+
export declare function useSearchMessage({ conversationId, payloadType, keyword, normalData }: {
|
3
|
+
conversationId: string;
|
4
|
+
keyword: string;
|
5
|
+
payloadType: PayloadType;
|
6
|
+
normalData?: boolean;
|
7
|
+
}): {
|
8
|
+
data: any[];
|
9
|
+
onLoadMore: () => Promise<void>;
|
10
|
+
reload: () => void;
|
11
|
+
};
|
@@ -0,0 +1,68 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
9
|
+
});
|
10
|
+
};
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
12
|
+
exports.useSearchMessage = void 0;
|
13
|
+
const init_1 = require("../../../init");
|
14
|
+
const react_1 = require("react");
|
15
|
+
const utils_1 = require("../../../pages/search/utils");
|
16
|
+
function useSearchMessage({ conversationId, payloadType, keyword, normalData = true }) {
|
17
|
+
const imManager = (0, init_1.getImManager)();
|
18
|
+
const [data, setData] = (0, react_1.useState)([]);
|
19
|
+
const fileOffset = (0, react_1.useRef)(0);
|
20
|
+
const noMore = (0, react_1.useRef)(false);
|
21
|
+
const reloadFlag = (0, react_1.useRef)(false);
|
22
|
+
const loadSearch = () => __awaiter(this, void 0, void 0, function* () {
|
23
|
+
if (noMore.current)
|
24
|
+
return;
|
25
|
+
const limit = 20;
|
26
|
+
let tList = [];
|
27
|
+
try {
|
28
|
+
tList = yield imManager.db.searchMessages({
|
29
|
+
keyword,
|
30
|
+
payloadType,
|
31
|
+
conversationId,
|
32
|
+
limit,
|
33
|
+
offset: fileOffset.current * limit,
|
34
|
+
});
|
35
|
+
}
|
36
|
+
catch (e) {
|
37
|
+
console.warn('loadSearchFiles', e);
|
38
|
+
}
|
39
|
+
if (tList.length < limit) {
|
40
|
+
noMore.current = true;
|
41
|
+
}
|
42
|
+
else {
|
43
|
+
fileOffset.current++;
|
44
|
+
}
|
45
|
+
setData(prevState => {
|
46
|
+
if (reloadFlag.current) {
|
47
|
+
reloadFlag.current = false;
|
48
|
+
return normalData ? (0, utils_1.normalFilesData)([], tList) : tList;
|
49
|
+
}
|
50
|
+
return normalData ? (0, utils_1.normalFilesData)(prevState, tList) : prevState.concat(tList);
|
51
|
+
});
|
52
|
+
});
|
53
|
+
const reload = () => {
|
54
|
+
noMore.current = false;
|
55
|
+
fileOffset.current = 0;
|
56
|
+
reloadFlag.current = true;
|
57
|
+
loadSearch();
|
58
|
+
};
|
59
|
+
(0, react_1.useEffect)(() => {
|
60
|
+
reload();
|
61
|
+
}, [keyword, conversationId]);
|
62
|
+
return {
|
63
|
+
data,
|
64
|
+
onLoadMore: loadSearch,
|
65
|
+
reload
|
66
|
+
};
|
67
|
+
}
|
68
|
+
exports.useSearchMessage = useSearchMessage;
|
@@ -0,0 +1,48 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
|
+
};
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
+
exports.searchRoutes = void 0;
|
7
|
+
const Search_1 = __importDefault(require("./Search"));
|
8
|
+
const SearchChatRecords_1 = __importDefault(require("./SearchChatRecords"));
|
9
|
+
const SearchFile_1 = __importDefault(require("./SearchFile"));
|
10
|
+
const SearchPicturePage_1 = __importDefault(require("./SearchPicturePage"));
|
11
|
+
const SearchManager_1 = __importDefault(require("./SearchManager"));
|
12
|
+
exports.searchRoutes = [
|
13
|
+
{
|
14
|
+
name: 'Search',
|
15
|
+
component: Search_1.default,
|
16
|
+
options: {
|
17
|
+
animation: 'fade',
|
18
|
+
headerShown: false,
|
19
|
+
},
|
20
|
+
},
|
21
|
+
{
|
22
|
+
name: 'SearchChatRecords',
|
23
|
+
component: SearchChatRecords_1.default,
|
24
|
+
options: {
|
25
|
+
animation: 'fade',
|
26
|
+
headerShown: false,
|
27
|
+
},
|
28
|
+
},
|
29
|
+
{
|
30
|
+
name: 'SearchFile',
|
31
|
+
component: SearchFile_1.default,
|
32
|
+
options: {
|
33
|
+
headerShown: false,
|
34
|
+
},
|
35
|
+
},
|
36
|
+
{
|
37
|
+
name: 'SearchPicture',
|
38
|
+
component: SearchPicturePage_1.default,
|
39
|
+
},
|
40
|
+
{
|
41
|
+
name: 'SearchManager',
|
42
|
+
component: SearchManager_1.default,
|
43
|
+
options: {
|
44
|
+
title: '',
|
45
|
+
headerShown: false,
|
46
|
+
},
|
47
|
+
},
|
48
|
+
];
|
@@ -0,0 +1,12 @@
|
|
1
|
+
import { IMessage } from "@smart-link/im-base";
|
2
|
+
export declare function normalFilesData(files: {
|
3
|
+
date: string;
|
4
|
+
data: IMessage[];
|
5
|
+
}[], data: IMessage[]): {
|
6
|
+
date: string;
|
7
|
+
data: IMessage[];
|
8
|
+
}[];
|
9
|
+
export declare function filesDataToList(map: Record<string, IMessage[]>): {
|
10
|
+
date: string;
|
11
|
+
data: IMessage[];
|
12
|
+
}[];
|
@@ -0,0 +1,42 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
|
+
};
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
+
exports.filesDataToList = exports.normalFilesData = void 0;
|
7
|
+
const dayjs_1 = __importDefault(require("dayjs"));
|
8
|
+
function normalFilesData(files, data) {
|
9
|
+
let mapData = {};
|
10
|
+
if (!data)
|
11
|
+
return [];
|
12
|
+
files.map(item => {
|
13
|
+
if (mapData[item.date]) {
|
14
|
+
mapData[item.date].push(...item.data);
|
15
|
+
}
|
16
|
+
else {
|
17
|
+
mapData[item.date] = [...item.data];
|
18
|
+
}
|
19
|
+
});
|
20
|
+
data.map(item => {
|
21
|
+
const date = (0, dayjs_1.default)(item.messageTime).format("YYYY/MM");
|
22
|
+
if (mapData[date]) {
|
23
|
+
mapData[date].push(item);
|
24
|
+
}
|
25
|
+
else {
|
26
|
+
mapData[date] = [item];
|
27
|
+
}
|
28
|
+
});
|
29
|
+
return filesDataToList(mapData);
|
30
|
+
}
|
31
|
+
exports.normalFilesData = normalFilesData;
|
32
|
+
function filesDataToList(map) {
|
33
|
+
const list = [];
|
34
|
+
for (let key in map) {
|
35
|
+
list.push({
|
36
|
+
date: key,
|
37
|
+
data: map[key]
|
38
|
+
});
|
39
|
+
}
|
40
|
+
return list;
|
41
|
+
}
|
42
|
+
exports.filesDataToList = filesDataToList;
|
@@ -0,0 +1,70 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { IConversation, IMessage } from '@smart-link/im-base';
|
3
|
+
import { IGroupCategory } from '../interface';
|
4
|
+
type StackAnimationTypes = 'default' | 'fade' | 'fade_from_bottom' | 'flip' | 'none' | 'simple_push' | 'slide_from_bottom' | 'slide_from_right' | 'slide_from_left';
|
5
|
+
export type IMPageParamList = {
|
6
|
+
ScanCode: undefined;
|
7
|
+
ConversationList: undefined;
|
8
|
+
MessageList: undefined;
|
9
|
+
MessageBackup: undefined;
|
10
|
+
StartBackupPage: undefined;
|
11
|
+
RestoreBackupPage: undefined;
|
12
|
+
ConversationSetting: undefined;
|
13
|
+
Search: undefined;
|
14
|
+
Collection: undefined;
|
15
|
+
ForwardToConversation: undefined;
|
16
|
+
SettingChatBg: undefined;
|
17
|
+
AddressList: undefined;
|
18
|
+
GroupTransfer: undefined;
|
19
|
+
OptionGroupMoreMember: undefined;
|
20
|
+
ChooseMember: {
|
21
|
+
atOther?: boolean;
|
22
|
+
removeMember?: boolean;
|
23
|
+
};
|
24
|
+
SearchPicturePage: {
|
25
|
+
conversationId: string;
|
26
|
+
};
|
27
|
+
SearchFile: {
|
28
|
+
conversationId: string;
|
29
|
+
};
|
30
|
+
Organization: IGroupCategory;
|
31
|
+
UserSearch: {
|
32
|
+
checkable?: boolean;
|
33
|
+
};
|
34
|
+
UserDetail: {
|
35
|
+
userId: string;
|
36
|
+
userAccount?: string;
|
37
|
+
};
|
38
|
+
SearchChatRecords: {
|
39
|
+
conversation: IConversation;
|
40
|
+
keyword?: string;
|
41
|
+
};
|
42
|
+
SearchManager: {
|
43
|
+
conversation: IConversation;
|
44
|
+
};
|
45
|
+
ChooseContact: {
|
46
|
+
chooseOrg?: boolean;
|
47
|
+
canCheckSelf?: boolean;
|
48
|
+
checkMode: 'single' | 'multi';
|
49
|
+
checkedIds?: string[];
|
50
|
+
};
|
51
|
+
OptionGroupNameOrNoticeEdit: {
|
52
|
+
type: 'groupName' | 'groupNotice';
|
53
|
+
};
|
54
|
+
OptionGroupManage: undefined;
|
55
|
+
MessageRecord: {
|
56
|
+
messages: IMessage[];
|
57
|
+
title: string;
|
58
|
+
};
|
59
|
+
};
|
60
|
+
export type RouteConfig = {
|
61
|
+
name: string;
|
62
|
+
component: React.ComponentType<any>;
|
63
|
+
options?: {
|
64
|
+
title?: string;
|
65
|
+
headerShown?: boolean;
|
66
|
+
animation?: StackAnimationTypes;
|
67
|
+
animationDuration?: number;
|
68
|
+
};
|
69
|
+
};
|
70
|
+
export {};
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -0,0 +1,12 @@
|
|
1
|
+
import { IGroup } from "../../interface";
|
2
|
+
import { IUser } from "@smart-link/im-base";
|
3
|
+
export interface ContactState {
|
4
|
+
selectUsers: Record<string, IUser>;
|
5
|
+
selectGroups: Record<string, IGroup>;
|
6
|
+
checkMode: 'single' | 'multiple';
|
7
|
+
currentRoot: 'organization' | 'role' | 'none';
|
8
|
+
choosePurpose: 'createGroup' | 'contact' | 'addMember' | 'none';
|
9
|
+
}
|
10
|
+
export declare const setSelectUsers: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "chat/contact/setSelectUsers">, setSelectGroups: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "chat/contact/setSelectGroups">, setCurrentRoot: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "chat/contact/setCurrentRoot">, onSelectUser: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "chat/contact/onSelectUser">, startCreateGroup: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"chat/contact/startCreateGroup">, startAddMember: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"chat/contact/startAddMember">, resetState: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"chat/contact/resetState">, startSendContact: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"chat/contact/startSendContact">, onDefaultCheckedUser: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "chat/contact/onDefaultCheckedUser">;
|
11
|
+
declare const _default: import("@reduxjs/toolkit").Reducer<ContactState>;
|
12
|
+
export default _default;
|
@@ -0,0 +1,60 @@
|
|
1
|
+
"use strict";
|
2
|
+
var _a;
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
4
|
+
exports.onDefaultCheckedUser = exports.startSendContact = exports.resetState = exports.startAddMember = exports.startCreateGroup = exports.onSelectUser = exports.setCurrentRoot = exports.setSelectGroups = exports.setSelectUsers = void 0;
|
5
|
+
const toolkit_1 = require("@reduxjs/toolkit");
|
6
|
+
const initialState = {
|
7
|
+
selectUsers: {},
|
8
|
+
selectGroups: {},
|
9
|
+
currentRoot: 'none',
|
10
|
+
choosePurpose: 'none',
|
11
|
+
checkMode: 'multiple',
|
12
|
+
};
|
13
|
+
const contactSlice = (0, toolkit_1.createSlice)({
|
14
|
+
name: 'chat/contact',
|
15
|
+
initialState,
|
16
|
+
reducers: {
|
17
|
+
resetState(state) {
|
18
|
+
Object.assign(state, initialState);
|
19
|
+
},
|
20
|
+
setSelectUsers(state, action) {
|
21
|
+
state.selectUsers = action.payload;
|
22
|
+
},
|
23
|
+
setSelectGroups(state, action) {
|
24
|
+
state.selectGroups = action.payload;
|
25
|
+
},
|
26
|
+
setCurrentRoot(state, action) {
|
27
|
+
state.currentRoot = action.payload;
|
28
|
+
},
|
29
|
+
onDefaultCheckedUser(state, action) {
|
30
|
+
const users = action.payload;
|
31
|
+
users.forEach(user => {
|
32
|
+
state.selectUsers[user.userId] = user;
|
33
|
+
});
|
34
|
+
},
|
35
|
+
onSelectUser(state, action) {
|
36
|
+
const user = action.payload;
|
37
|
+
if (state.checkMode === 'single') {
|
38
|
+
state.selectUsers = {};
|
39
|
+
}
|
40
|
+
if (state.selectUsers[user.userId]) {
|
41
|
+
delete state.selectUsers[user.userId];
|
42
|
+
}
|
43
|
+
else {
|
44
|
+
state.selectUsers[user.userId] = user;
|
45
|
+
}
|
46
|
+
},
|
47
|
+
startCreateGroup(state) {
|
48
|
+
state.choosePurpose = 'createGroup';
|
49
|
+
},
|
50
|
+
startAddMember(state) {
|
51
|
+
state.choosePurpose = 'addMember';
|
52
|
+
},
|
53
|
+
startSendContact(state) {
|
54
|
+
state.choosePurpose = 'contact';
|
55
|
+
state.checkMode = 'single';
|
56
|
+
},
|
57
|
+
},
|
58
|
+
});
|
59
|
+
_a = contactSlice.actions, exports.setSelectUsers = _a.setSelectUsers, exports.setSelectGroups = _a.setSelectGroups, exports.setCurrentRoot = _a.setCurrentRoot, exports.onSelectUser = _a.onSelectUser, exports.startCreateGroup = _a.startCreateGroup, exports.startAddMember = _a.startAddMember, exports.resetState = _a.resetState, exports.startSendContact = _a.startSendContact, exports.onDefaultCheckedUser = _a.onDefaultCheckedUser;
|
60
|
+
exports.default = contactSlice.reducer;
|
@@ -0,0 +1,9 @@
|
|
1
|
+
import { VideoState } from './video/video.slice';
|
2
|
+
import { ContactState } from './contact/contact.slice';
|
3
|
+
import { PanelState } from './panel/panel.slice';
|
4
|
+
export declare const chatReducers: {
|
5
|
+
'chat/video': import("@reduxjs/toolkit").Reducer<VideoState>;
|
6
|
+
'chat/contact': import("@reduxjs/toolkit").Reducer<ContactState>;
|
7
|
+
'chat/panel': import("@reduxjs/toolkit").Reducer<PanelState>;
|
8
|
+
};
|
9
|
+
export type { VideoState, ContactState, PanelState };
|
@@ -0,0 +1,15 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
|
+
};
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
+
exports.chatReducers = void 0;
|
7
|
+
const video_slice_1 = __importDefault(require("./video/video.slice"));
|
8
|
+
const contact_slice_1 = __importDefault(require("./contact/contact.slice"));
|
9
|
+
const panel_slice_1 = __importDefault(require("./panel/panel.slice"));
|
10
|
+
// @ts-ignore
|
11
|
+
exports.chatReducers = {
|
12
|
+
'chat/video': video_slice_1.default,
|
13
|
+
'chat/contact': contact_slice_1.default,
|
14
|
+
'chat/panel': panel_slice_1.default,
|
15
|
+
};
|
@@ -0,0 +1,8 @@
|
|
1
|
+
export interface PanelState {
|
2
|
+
show: boolean;
|
3
|
+
type: 'emoji' | 'option' | 'voice';
|
4
|
+
messageBarHeight: number;
|
5
|
+
}
|
6
|
+
export declare const setMessageBarHeight: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "chat/panel/setMessageBarHeight">;
|
7
|
+
declare const _default: import("@reduxjs/toolkit").Reducer<PanelState>;
|
8
|
+
export default _default;
|
@@ -0,0 +1,19 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.setMessageBarHeight = void 0;
|
4
|
+
const toolkit_1 = require("@reduxjs/toolkit");
|
5
|
+
const panelSlice = (0, toolkit_1.createSlice)({
|
6
|
+
name: 'chat/panel',
|
7
|
+
initialState: {
|
8
|
+
show: false,
|
9
|
+
type: 'emoji',
|
10
|
+
messageBarHeight: 0,
|
11
|
+
},
|
12
|
+
reducers: {
|
13
|
+
setMessageBarHeight(state, action) {
|
14
|
+
state.messageBarHeight = action.payload;
|
15
|
+
},
|
16
|
+
}
|
17
|
+
});
|
18
|
+
exports.setMessageBarHeight = panelSlice.actions.setMessageBarHeight;
|
19
|
+
exports.default = panelSlice.reducer;
|