@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,68 @@
|
|
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 __importDefault = (this && this.__importDefault) || function (mod) {
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
27
|
+
};
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
29
|
+
const react_1 = __importStar(require("react"));
|
30
|
+
const react_native_1 = require("react-native");
|
31
|
+
const useTranslation_1 = __importDefault(require("../../../hooks/useTranslation"));
|
32
|
+
const rn_ui_1 = require("@smart-link/rn-ui");
|
33
|
+
const useImSelector_1 = require("../../../hooks/useImSelector");
|
34
|
+
const init_1 = require("../../../init");
|
35
|
+
const im_base_1 = require("@smart-link/im-base");
|
36
|
+
const OptionGroupManage = (0, react_1.memo)(props => {
|
37
|
+
const { navigation, } = props;
|
38
|
+
const imManager = (0, init_1.getImManager)();
|
39
|
+
const { t } = (0, useTranslation_1.default)();
|
40
|
+
const { currentConversation } = (0, useImSelector_1.useConversation)();
|
41
|
+
if (!currentConversation) {
|
42
|
+
return null;
|
43
|
+
}
|
44
|
+
const { enableInviteValidate = 'off' } = currentConversation;
|
45
|
+
(0, react_1.useEffect)(() => {
|
46
|
+
navigation.setOptions({
|
47
|
+
title: t('groupMgr')
|
48
|
+
});
|
49
|
+
}, [navigation]);
|
50
|
+
const onValueChange = (0, react_1.useCallback)((value) => {
|
51
|
+
imManager.store.dispatch(im_base_1.SettingActions.settingEnableInviteValidate(value ? 'on' : 'off'));
|
52
|
+
}, []);
|
53
|
+
return (<rn_ui_1.NavigationPage scroll noPadding>
|
54
|
+
<react_native_1.ScrollView>
|
55
|
+
<rn_ui_1.Space size={'m'}/>
|
56
|
+
<rn_ui_1.ListRow title={t('groupInviteValid')} detail={<react_native_1.Switch value={enableInviteValidate === 'on'} onValueChange={onValueChange}/>} topSeparator='full' bottomSeparator='full'/>
|
57
|
+
{/*<Space size={'m'} />*/}
|
58
|
+
{/*<ListRow title={t('groupTransfer')}*/}
|
59
|
+
{/* onPress={() => {*/}
|
60
|
+
{/* navigation.navigate('GroupTransfer')*/}
|
61
|
+
{/* }}*/}
|
62
|
+
{/* topSeparator='full'*/}
|
63
|
+
{/* bottomSeparator='full'*/}
|
64
|
+
{/*/>*/}
|
65
|
+
</react_native_1.ScrollView>
|
66
|
+
</rn_ui_1.NavigationPage>);
|
67
|
+
});
|
68
|
+
exports.default = OptionGroupManage;
|
@@ -0,0 +1,124 @@
|
|
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 rn_ui_1 = require("@smart-link/rn-ui");
|
7
|
+
const useImSelector_1 = require("../../../hooks/useImSelector");
|
8
|
+
const react_1 = require("react");
|
9
|
+
const useTranslation_1 = __importDefault(require("../../../hooks/useTranslation"));
|
10
|
+
const react_native_1 = require("react-native");
|
11
|
+
const ChatAvatar_1 = __importDefault(require("../../../components/ChatAvatar"));
|
12
|
+
const default_assets_1 = require("../../../default-assets");
|
13
|
+
const im_base_1 = require("@smart-link/im-base");
|
14
|
+
const styles_1 = require("../../../components/styles");
|
15
|
+
const { OWNER, MGR, } = im_base_1.MemberLevel;
|
16
|
+
const OptionGroupMoreMember = (props) => {
|
17
|
+
const { groupDetail } = (0, useImSelector_1.useChatGroup)();
|
18
|
+
const { groupMemberList } = groupDetail;
|
19
|
+
const [keyword, setKeyword] = (0, react_1.useState)('');
|
20
|
+
const { t } = (0, useTranslation_1.default)();
|
21
|
+
const navigation = (0, rn_ui_1.useNavigation)();
|
22
|
+
(0, react_1.useEffect)(() => {
|
23
|
+
navigation.setOptions({
|
24
|
+
title: t('groupChatMember') + '(' + groupMemberList.length + ')',
|
25
|
+
});
|
26
|
+
}, [t, navigation, groupMemberList.length]);
|
27
|
+
const listLineComponent = groupMemberList.length === 0 ? null : <react_native_1.View style={styles.listLine}/>;
|
28
|
+
const itemSeparatorComponent = () => <react_native_1.View style={[styles.separator]}/>;
|
29
|
+
const keyExtractor = (member) => member.userId;
|
30
|
+
const renderItem = ({ item }) => {
|
31
|
+
const { userId, chatGroupId, memberName, memberLevel, } = item;
|
32
|
+
const adminSource = memberLevel === OWNER ? default_assets_1.defaultAvatars.GROUP_OWNER : memberLevel === MGR ? default_assets_1.defaultAvatars.GROUP_MGR : null;
|
33
|
+
return (<react_native_1.TouchableOpacity activeOpacity={0.5} style={styles.row} onPress={() => {
|
34
|
+
// onPressUserAvatars && onPressUserAvatars(userId)
|
35
|
+
navigation.navigate('UserDetail', {
|
36
|
+
userId: userId,
|
37
|
+
});
|
38
|
+
}} onLongPress={() => {
|
39
|
+
// if (!isMgr) {
|
40
|
+
// return;
|
41
|
+
// }
|
42
|
+
//
|
43
|
+
// if (!imGroupId || !memberLevel || memberLevel === OWNER) {
|
44
|
+
// return;
|
45
|
+
// }
|
46
|
+
//
|
47
|
+
// onLongPressUserAvatars && onLongPressUserAvatars({
|
48
|
+
// imGroupId,
|
49
|
+
// userId,
|
50
|
+
// userName:memberName,
|
51
|
+
// memberLevel,
|
52
|
+
// })
|
53
|
+
}}>
|
54
|
+
<ChatAvatar_1.default id={userId} disabled size={(0, rn_ui_1.dp)(40)} name={memberName}/>
|
55
|
+
<react_native_1.View style={styles.w15}/>
|
56
|
+
<react_native_1.View>
|
57
|
+
<react_native_1.Text style={styles.userName} numberOfLines={1}>{memberName}</react_native_1.Text>
|
58
|
+
</react_native_1.View>
|
59
|
+
{adminSource &&
|
60
|
+
<react_native_1.Image source={adminSource} style={styles.admin} resizeMode={'contain'}/>}
|
61
|
+
</react_native_1.TouchableOpacity>);
|
62
|
+
};
|
63
|
+
const list = (0, react_1.useMemo)(() => {
|
64
|
+
return groupMemberList.slice().reverse().filter((item) => {
|
65
|
+
if (keyword) {
|
66
|
+
return item.memberName.indexOf(keyword) > -1;
|
67
|
+
}
|
68
|
+
return true;
|
69
|
+
});
|
70
|
+
}, [groupMemberList, keyword]);
|
71
|
+
return (<rn_ui_1.NavigationPage noPadding>
|
72
|
+
<rn_ui_1.SearchInput value={keyword} onChange={(txt) => {
|
73
|
+
setKeyword(txt);
|
74
|
+
}}/>
|
75
|
+
<react_native_1.FlatList contentContainerStyle={styles.list} ItemSeparatorComponent={itemSeparatorComponent} ListHeaderComponent={listLineComponent} ListFooterComponent={listLineComponent} numColumns={1} initialNumToRender={15} data={list} keyboardShouldPersistTaps={'handled'} keyExtractor={keyExtractor} renderItem={renderItem}/>
|
76
|
+
</rn_ui_1.NavigationPage>);
|
77
|
+
};
|
78
|
+
const styles = react_native_1.StyleSheet.create({
|
79
|
+
moreMember: {
|
80
|
+
backgroundColor: '#fff',
|
81
|
+
flex: 1
|
82
|
+
},
|
83
|
+
list: {
|
84
|
+
backgroundColor: '#fff',
|
85
|
+
borderColor: '#eeeeee'
|
86
|
+
},
|
87
|
+
search: Object.assign({ backgroundColor: '#eee' }, styles_1.shadowStyle),
|
88
|
+
heightSpace: {
|
89
|
+
height: (0, rn_ui_1.dp)(5)
|
90
|
+
},
|
91
|
+
row: {
|
92
|
+
paddingHorizontal: (0, rn_ui_1.dp)(15),
|
93
|
+
flexDirection: 'row',
|
94
|
+
alignItems: 'center',
|
95
|
+
height: (0, rn_ui_1.dp)(50)
|
96
|
+
},
|
97
|
+
listLine: {
|
98
|
+
marginVertical: 5,
|
99
|
+
height: (0, rn_ui_1.dp)(1),
|
100
|
+
backgroundColor: '#ececec'
|
101
|
+
},
|
102
|
+
separator: {
|
103
|
+
marginLeft: (0, rn_ui_1.dp)(75),
|
104
|
+
marginVertical: (0, rn_ui_1.dp)(5),
|
105
|
+
height: (0, rn_ui_1.dp)(1),
|
106
|
+
backgroundColor: '#ececec'
|
107
|
+
},
|
108
|
+
w15: {
|
109
|
+
width: (0, rn_ui_1.dp)(15),
|
110
|
+
},
|
111
|
+
admin: {
|
112
|
+
height: (0, rn_ui_1.dp)(18),
|
113
|
+
width: (0, rn_ui_1.dp)(18),
|
114
|
+
right: (15),
|
115
|
+
position: 'absolute',
|
116
|
+
},
|
117
|
+
userName: {
|
118
|
+
width: (0, rn_ui_1.dp)(230),
|
119
|
+
color: '#333',
|
120
|
+
lineHeight: (0, rn_ui_1.dp)(20),
|
121
|
+
fontSize: (0, rn_ui_1.dp)(15),
|
122
|
+
},
|
123
|
+
});
|
124
|
+
exports.default = OptionGroupMoreMember;
|
@@ -0,0 +1,6 @@
|
|
1
|
+
import React from "react";
|
2
|
+
import { NativeStackScreenProps } from "@react-navigation/native-stack/lib/typescript/src/types";
|
3
|
+
import { IMPageParamList } from "../../../pages";
|
4
|
+
type OptionGroupNameOrNoticeEditProps = NativeStackScreenProps<IMPageParamList, 'OptionGroupNameOrNoticeEdit'>;
|
5
|
+
declare const OptionGroupNameOrNoticeEditPage: React.NamedExoticComponent<OptionGroupNameOrNoticeEditProps>;
|
6
|
+
export default OptionGroupNameOrNoticeEditPage;
|
@@ -0,0 +1,149 @@
|
|
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 react_1 = __importStar(require("react"));
|
39
|
+
const react_native_1 = require("react-native");
|
40
|
+
const useTranslation_1 = __importDefault(require("../../../hooks/useTranslation"));
|
41
|
+
const im_base_1 = require("@smart-link/im-base");
|
42
|
+
const rn_ui_1 = require("@smart-link/rn-ui");
|
43
|
+
const useImSelector_1 = require("../../../hooks/useImSelector");
|
44
|
+
const init_1 = require("../../../init");
|
45
|
+
const { OWNER, MGR, MEMBER, } = im_base_1.MemberLevel;
|
46
|
+
const OptionGroupNameEdit = (0, react_1.memo)(props => {
|
47
|
+
const { type, memberLevel, groupNameEdit, groupNoticeEdit, setGroupNameEdit, setGroupNoticeEdit, } = props;
|
48
|
+
const { t } = (0, useTranslation_1.default)();
|
49
|
+
console.log('OptionGroupNameEdit: ', props);
|
50
|
+
// @ts-ignore
|
51
|
+
const isOwner = memberLevel === OWNER || memberLevel === MGR;
|
52
|
+
if (type === 'groupNotice') {
|
53
|
+
return <react_native_1.ScrollView contentContainerStyle={styles.noticeContentContainerStyle}>
|
54
|
+
<react_native_1.View style={styles.noticeInput}>
|
55
|
+
<react_native_1.TextInput style={styles.textInput} autoFocus={isOwner} value={groupNoticeEdit} maxLength={1000} multiline={true} editable={isOwner} underlineColorAndroid='transparent' onChangeText={setGroupNoticeEdit}/>
|
56
|
+
</react_native_1.View>
|
57
|
+
</react_native_1.ScrollView>;
|
58
|
+
}
|
59
|
+
else {
|
60
|
+
return <react_native_1.ScrollView contentContainerStyle={styles.contentContainerStyle}>
|
61
|
+
<react_native_1.Text>{t('groupChatName')}:</react_native_1.Text>
|
62
|
+
<react_native_1.View style={styles.input}>
|
63
|
+
<react_native_1.TextInput autoFocus={isOwner} value={groupNameEdit} maxLength={120} editable={isOwner} returnKeyType={'done'} underlineColorAndroid='transparent' onChangeText={setGroupNameEdit} clearButtonMode={'while-editing'}/>
|
64
|
+
</react_native_1.View>
|
65
|
+
</react_native_1.ScrollView>;
|
66
|
+
}
|
67
|
+
});
|
68
|
+
const OptionGroupNameOrNoticeEditPage = (0, react_1.memo)(props => {
|
69
|
+
const { navigation, route: { params: { type } } } = props;
|
70
|
+
const { t } = (0, useTranslation_1.default)();
|
71
|
+
const { currentConversation } = (0, useImSelector_1.useConversation)();
|
72
|
+
const { groupNameEdit, groupNoticeEdit } = (0, useImSelector_1.useSetting)();
|
73
|
+
const imManager = (0, init_1.getImManager)();
|
74
|
+
console.log('OptionGroupNameOrNoticeEditPage', groupNameEdit, groupNoticeEdit);
|
75
|
+
if (!currentConversation) {
|
76
|
+
return null;
|
77
|
+
}
|
78
|
+
const isEditGroupName = type === 'groupName';
|
79
|
+
const setGroupNameEdit = (value) => {
|
80
|
+
imManager.store.dispatch(im_base_1.SettingActions.setGroupNameEdit(value));
|
81
|
+
};
|
82
|
+
const setGroupNoticeEdit = (value) => {
|
83
|
+
imManager.store.dispatch(im_base_1.SettingActions.setGroupNoticeEdit(value));
|
84
|
+
};
|
85
|
+
const { memberLevel } = currentConversation;
|
86
|
+
// console.log('OptionGroupNameOrNoticeEditPage', currentConversation, memberLevel)
|
87
|
+
(0, react_1.useEffect)(() => {
|
88
|
+
if (isEditGroupName) {
|
89
|
+
setGroupNameEdit(currentConversation.name);
|
90
|
+
}
|
91
|
+
else {
|
92
|
+
setGroupNoticeEdit(currentConversation.notice);
|
93
|
+
}
|
94
|
+
const confirm = () => __awaiter(void 0, void 0, void 0, function* () {
|
95
|
+
if (isEditGroupName) {
|
96
|
+
const toast = rn_ui_1.Toast.loading();
|
97
|
+
yield imManager.store.dispatch(im_base_1.SettingActions.updateChatGroupName(imManager));
|
98
|
+
toast.close();
|
99
|
+
}
|
100
|
+
else {
|
101
|
+
const toast = rn_ui_1.Toast.loading();
|
102
|
+
yield imManager.store.dispatch(im_base_1.SettingActions.updateChatGroupNotice());
|
103
|
+
toast.close();
|
104
|
+
}
|
105
|
+
react_native_1.Keyboard.dismiss();
|
106
|
+
navigation.pop();
|
107
|
+
});
|
108
|
+
navigation.setOptions({
|
109
|
+
title: isEditGroupName ? t('groupChatName') : t('groupNotice'),
|
110
|
+
headerRight: (memberLevel === MGR || memberLevel === OWNER) ? () => <react_native_1.TouchableOpacity style={{
|
111
|
+
flexDirection: 'row',
|
112
|
+
alignItems: 'center',
|
113
|
+
padding: (0, rn_ui_1.dp)(8),
|
114
|
+
}} onPress={confirm}>
|
115
|
+
<react_native_1.Text style={{ color: '#fff', fontSize: (0, rn_ui_1.dp)(14) }}>{t('confirm')}</react_native_1.Text>
|
116
|
+
</react_native_1.TouchableOpacity> : undefined
|
117
|
+
});
|
118
|
+
}, [navigation, currentConversation, type, memberLevel]);
|
119
|
+
return (<rn_ui_1.NavigationPage noPadding>
|
120
|
+
<OptionGroupNameEdit type={type} setGroupNameEdit={setGroupNameEdit} setGroupNoticeEdit={setGroupNoticeEdit} groupNameEdit={groupNameEdit} groupNoticeEdit={groupNoticeEdit} memberLevel={memberLevel}/>
|
121
|
+
</rn_ui_1.NavigationPage>);
|
122
|
+
});
|
123
|
+
const styles = react_native_1.StyleSheet.create({
|
124
|
+
contentContainerStyle: {
|
125
|
+
padding: (0, rn_ui_1.dp)(15)
|
126
|
+
},
|
127
|
+
input: {
|
128
|
+
marginTop: (0, rn_ui_1.dp)(10),
|
129
|
+
padding: (0, rn_ui_1.dp)(8),
|
130
|
+
backgroundColor: '#fff',
|
131
|
+
},
|
132
|
+
noticeContentContainerStyle: {
|
133
|
+
margin: (0, rn_ui_1.dp)(15)
|
134
|
+
},
|
135
|
+
noticeInput: {
|
136
|
+
flex: 1,
|
137
|
+
backgroundColor: '#fff',
|
138
|
+
},
|
139
|
+
textInput: {
|
140
|
+
flex: 1,
|
141
|
+
padding: 10,
|
142
|
+
fontSize: (0, rn_ui_1.dp)(16),
|
143
|
+
minHeight: (0, rn_ui_1.dp)(400),
|
144
|
+
lineHeight: (0, rn_ui_1.dp)(20),
|
145
|
+
textAlignVertical: 'top',
|
146
|
+
color: '#000',
|
147
|
+
}
|
148
|
+
});
|
149
|
+
exports.default = OptionGroupNameOrNoticeEditPage;
|
@@ -0,0 +1,6 @@
|
|
1
|
+
/// <reference types="react" />
|
2
|
+
import { NativeStackScreenProps } from '@react-navigation/native-stack/lib/typescript/src/types';
|
3
|
+
import { IMPageParamList } from '../../../pages';
|
4
|
+
type ConversationSettingProps = NativeStackScreenProps<IMPageParamList, 'ConversationSetting'>;
|
5
|
+
declare const ConversationSetting: ({ navigation }: ConversationSettingProps) => import("react").JSX.Element | null;
|
6
|
+
export default ConversationSetting;
|
@@ -0,0 +1,184 @@
|
|
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 im_base_1 = require("@smart-link/im-base");
|
7
|
+
const rn_ui_1 = require("@smart-link/rn-ui");
|
8
|
+
const react_1 = require("react");
|
9
|
+
const useImSelector_1 = require("../../../hooks/useImSelector");
|
10
|
+
const useTranslation_1 = __importDefault(require("../../../hooks/useTranslation"));
|
11
|
+
const OptionAvatars_1 = __importDefault(require("./OptionAvatars"));
|
12
|
+
const OptionConversation_1 = __importDefault(require("./OptionConversation"));
|
13
|
+
const common_action_sheet_1 = require("../../../utils/common-action-sheet");
|
14
|
+
const init_1 = require("../../../init");
|
15
|
+
const react_native_1 = require("react-native");
|
16
|
+
const OptionGroup_1 = __importDefault(require("../../../pages/conversation/setting/OptionGroup"));
|
17
|
+
const OptionCancelGroup_1 = __importDefault(require("../../../pages/conversation/setting/OptionCancelGroup"));
|
18
|
+
const contact_slice_1 = require("../../../slice/contact/contact.slice");
|
19
|
+
const native_1 = require("@react-navigation/native");
|
20
|
+
const { MEMBER, MGR, OWNER } = im_base_1.MemberLevel;
|
21
|
+
const { LIAISON } = im_base_1.GroupType;
|
22
|
+
// 最大显示人数
|
23
|
+
const MAX_SHOW_MEMBER_COUNT = 23;
|
24
|
+
const ConversationSetting = ({ navigation }) => {
|
25
|
+
var _a;
|
26
|
+
const { t } = (0, useTranslation_1.default)();
|
27
|
+
const { currentConversation } = (0, useImSelector_1.useConversation)();
|
28
|
+
const { groupDetail } = (0, useImSelector_1.useChatGroup)();
|
29
|
+
const title = t('chatSetting');
|
30
|
+
// 设置标题
|
31
|
+
(0, react_1.useEffect)(() => {
|
32
|
+
let newTitle = title;
|
33
|
+
if ((currentConversation === null || currentConversation === void 0 ? void 0 : currentConversation.type) === im_base_1.ConversationType.C2G && (currentConversation === null || currentConversation === void 0 ? void 0 : currentConversation.memberTotalCount)) {
|
34
|
+
newTitle += `(${currentConversation.memberTotalCount})`;
|
35
|
+
}
|
36
|
+
navigation.setOptions({
|
37
|
+
title: newTitle,
|
38
|
+
});
|
39
|
+
}, [title, navigation, currentConversation]);
|
40
|
+
if (!currentConversation) {
|
41
|
+
return null;
|
42
|
+
}
|
43
|
+
const imManager = (0, init_1.getImManager)();
|
44
|
+
const settingEnableNoDisturb = (value) => {
|
45
|
+
imManager.store.dispatch(im_base_1.ConversationActions.settingEnableNoDisturb(imManager, value));
|
46
|
+
};
|
47
|
+
const settingEnableTop = (value) => {
|
48
|
+
imManager.store.dispatch(im_base_1.ConversationActions.settingEnableTop(imManager, value));
|
49
|
+
};
|
50
|
+
const toSearchMessage = () => {
|
51
|
+
navigation.navigate('SearchChatRecords', {
|
52
|
+
conversation: currentConversation,
|
53
|
+
});
|
54
|
+
};
|
55
|
+
const clearMessage = () => {
|
56
|
+
(0, common_action_sheet_1.ConfirmActionSheet)(t('clearChatRecords'), () => {
|
57
|
+
imManager.clearMessages(currentConversation.id);
|
58
|
+
}, t);
|
59
|
+
};
|
60
|
+
const { id, type, name, avatars, enableNoDisturb = 'off', enableTop = 'off', notice = '', enableInviteValidate = 'off', memberLevel = MEMBER, memberTotalCount = 0, groupType, } = currentConversation;
|
61
|
+
const groupMemberList = (_a = groupDetail === null || groupDetail === void 0 ? void 0 : groupDetail.groupMemberList.slice().reverse()) !== null && _a !== void 0 ? _a : [];
|
62
|
+
console.log('type: ', type, '[memberLevel]', memberLevel);
|
63
|
+
const isMgr = memberLevel === MGR || memberLevel === OWNER;
|
64
|
+
// 离开群组
|
65
|
+
const leaveGroup = () => {
|
66
|
+
(0, common_action_sheet_1.ConfirmActionSheets)({
|
67
|
+
title: t('leaveGroup'),
|
68
|
+
confirm: () => {
|
69
|
+
imManager.store.dispatch(im_base_1.ConversationActions.doLeaveGroup(imManager, { chatGroupId: id }, () => {
|
70
|
+
navigation.dispatch(native_1.StackActions.popToTop());
|
71
|
+
}, () => {
|
72
|
+
rn_ui_1.Toast.error(t('leaveGroupFail'));
|
73
|
+
}));
|
74
|
+
},
|
75
|
+
t,
|
76
|
+
});
|
77
|
+
};
|
78
|
+
// 编辑群组名称或群组公告
|
79
|
+
const toEditGroupNameOrNotice = (type) => {
|
80
|
+
navigation.navigate('OptionGroupNameOrNoticeEdit', { type });
|
81
|
+
};
|
82
|
+
// 群组转让
|
83
|
+
const toGroupTransfer = () => {
|
84
|
+
// navigation.navigate('OptionGroupTransferPage');
|
85
|
+
};
|
86
|
+
// 群组管理
|
87
|
+
const toGroupMgr = () => {
|
88
|
+
navigation.navigate('OptionGroupManage');
|
89
|
+
};
|
90
|
+
// 设置聊天背景
|
91
|
+
const toImageBackground = () => {
|
92
|
+
navigation.navigate('SettingChatBg');
|
93
|
+
};
|
94
|
+
// 文件管理
|
95
|
+
const toSearchFile = () => {
|
96
|
+
navigation.navigate('SearchFile', { conversationId: id });
|
97
|
+
};
|
98
|
+
// 图片管理
|
99
|
+
const toSearchPicture = () => {
|
100
|
+
navigation.navigate('SearchPicturePage', { conversationId: id });
|
101
|
+
};
|
102
|
+
// 搜索管理
|
103
|
+
const toSearchManagePage = () => {
|
104
|
+
navigation.navigate('SearchManager', {
|
105
|
+
conversation: currentConversation,
|
106
|
+
});
|
107
|
+
};
|
108
|
+
// 群组设置
|
109
|
+
const removeUser = () => {
|
110
|
+
navigation.navigate('ChooseMember', {
|
111
|
+
removeMember: true,
|
112
|
+
});
|
113
|
+
};
|
114
|
+
let content = null;
|
115
|
+
switch (type) {
|
116
|
+
case im_base_1.ConversationType.C2C:
|
117
|
+
content = (<>
|
118
|
+
<OptionAvatars_1.default list={id ? [
|
119
|
+
{
|
120
|
+
userId: id,
|
121
|
+
userName: name,
|
122
|
+
avatars,
|
123
|
+
},
|
124
|
+
] : []} showAdd={true} showDelete={false} showMore={false} addUser={() => {
|
125
|
+
(0, init_1.getImManager)().store.dispatch((0, contact_slice_1.startCreateGroup)());
|
126
|
+
navigation.navigate('ChooseContact', {
|
127
|
+
chooseOrg: true,
|
128
|
+
checkMode: 'multi',
|
129
|
+
checkedIds: [id],
|
130
|
+
});
|
131
|
+
}}/>
|
132
|
+
<rn_ui_1.Space size={'m'}/>
|
133
|
+
<OptionConversation_1.default enableNoDisturb={enableNoDisturb} enableTop={enableTop} settingEnableNoDisturb={settingEnableNoDisturb} settingEnableTop={settingEnableTop} toImageBackground={toImageBackground} clearMessage={clearMessage} toSearchMessage={toSearchMessage} showBackgroundSetting toSearchFile={toSearchFile} toSearchPicture={toSearchPicture} toSearchManagePage={toSearchManagePage}/>
|
134
|
+
<rn_ui_1.Space size={'m'}/>
|
135
|
+
</>);
|
136
|
+
break;
|
137
|
+
case im_base_1.ConversationType.C2G:
|
138
|
+
const avatarList = groupMemberList
|
139
|
+
.map(item => {
|
140
|
+
var _a;
|
141
|
+
return {
|
142
|
+
userId: item.userId,
|
143
|
+
userName: (_a = item.memberName) !== null && _a !== void 0 ? _a : '',
|
144
|
+
avatars: item.memberAvatars,
|
145
|
+
memberLevel: item.memberLevel,
|
146
|
+
};
|
147
|
+
})
|
148
|
+
.splice(0, MAX_SHOW_MEMBER_COUNT);
|
149
|
+
content = (<>
|
150
|
+
<OptionAvatars_1.default list={avatarList} showTitle showAdd showMore={isMgr ? avatarList.length > 8 : avatarList.length > 9} isMgr={isMgr} addUser={() => {
|
151
|
+
// 添加成员
|
152
|
+
(0, init_1.getImManager)().store.dispatch((0, contact_slice_1.startAddMember)());
|
153
|
+
navigation.navigate('ChooseContact', {
|
154
|
+
chooseOrg: true,
|
155
|
+
checkMode: 'multi',
|
156
|
+
});
|
157
|
+
}} removeUser={removeUser} toMoreMember={() => {
|
158
|
+
navigation.navigate('OptionGroupMoreMember');
|
159
|
+
}}/>
|
160
|
+
<rn_ui_1.Space size={'m'}/>
|
161
|
+
<OptionGroup_1.default id={id} name={name} memberLevel={memberLevel} avatars={avatars} notice={notice} enableInviteValidate={enableInviteValidate} toEditGroupName={() => toEditGroupNameOrNotice('groupName')} toEditGroupNotice={() => toEditGroupNameOrNotice('groupNotice')} toGroupMgr={toGroupMgr}/>
|
162
|
+
<rn_ui_1.Space size={'m'}/>
|
163
|
+
<OptionConversation_1.default enableNoDisturb={enableNoDisturb} enableTop={enableTop} settingEnableNoDisturb={settingEnableNoDisturb} settingEnableTop={settingEnableTop} toImageBackground={toImageBackground} clearMessage={clearMessage} toSearchMessage={toSearchMessage} toSearchFile={toSearchFile} toSearchPicture={toSearchPicture} toSearchManagePage={toSearchManagePage}/>
|
164
|
+
<rn_ui_1.Space size={'m'}/>
|
165
|
+
{groupType !== LIAISON && <OptionCancelGroup_1.default leaveGroup={leaveGroup}/>}
|
166
|
+
</>);
|
167
|
+
break;
|
168
|
+
case im_base_1.ConversationType.B2C:
|
169
|
+
content = (<OptionConversation_1.default enableNoDisturb={enableNoDisturb} enableTop={enableTop} showSearch={false} showBackgroundSetting={false} settingEnableNoDisturb={settingEnableNoDisturb} settingEnableTop={settingEnableTop} toImageBackground={toImageBackground} clearMessage={clearMessage} toSearchMessage={toSearchMessage}/>);
|
170
|
+
break;
|
171
|
+
default:
|
172
|
+
break;
|
173
|
+
}
|
174
|
+
return (<rn_ui_1.NavigationPage scroll noPadding>
|
175
|
+
<rn_ui_1.Space size="m"/>
|
176
|
+
{content}
|
177
|
+
</rn_ui_1.NavigationPage>);
|
178
|
+
};
|
179
|
+
const styles = react_native_1.StyleSheet.create({
|
180
|
+
setting: {
|
181
|
+
paddingVertical: (0, rn_ui_1.dp)(15),
|
182
|
+
},
|
183
|
+
});
|
184
|
+
exports.default = ConversationSetting;
|
@@ -0,0 +1,6 @@
|
|
1
|
+
import { IMPageParamList } from '../../../pages/types';
|
2
|
+
import { NativeStackScreenProps } from '@react-navigation/native-stack';
|
3
|
+
import React from 'react';
|
4
|
+
export type SettingChatBgProps = NativeStackScreenProps<IMPageParamList, 'SettingChatBg'>;
|
5
|
+
declare const SettingChatBg: React.FC<SettingChatBgProps>;
|
6
|
+
export default SettingChatBg;
|
@@ -0,0 +1,95 @@
|
|
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 useImSelector_1 = require("../../../hooks/useImSelector");
|
39
|
+
const useTranslation_1 = __importDefault(require("../../../hooks/useTranslation"));
|
40
|
+
const init_1 = require("../../../init");
|
41
|
+
const upload_1 = __importDefault(require("../../../utils/upload"));
|
42
|
+
const native_1 = require("@react-navigation/native");
|
43
|
+
const im_base_1 = require("@smart-link/im-base");
|
44
|
+
const rn_ui_1 = require("@smart-link/rn-ui");
|
45
|
+
const react_1 = __importStar(require("react"));
|
46
|
+
const react_native_image_crop_picker_1 = __importDefault(require("react-native-image-crop-picker"));
|
47
|
+
const SettingChatBg = ({ navigation }) => {
|
48
|
+
const { t } = (0, useTranslation_1.default)();
|
49
|
+
const { currentConversation } = (0, useImSelector_1.useConversation)();
|
50
|
+
(0, react_1.useEffect)(() => {
|
51
|
+
navigation.setOptions({ title: t('selectChatBackground') });
|
52
|
+
}, [navigation, t]);
|
53
|
+
const openAlbum = () => __awaiter(void 0, void 0, void 0, function* () {
|
54
|
+
let toast;
|
55
|
+
try {
|
56
|
+
const image = yield react_native_image_crop_picker_1.default.openPicker({
|
57
|
+
mediaType: 'photo',
|
58
|
+
multiple: false,
|
59
|
+
compressImageQuality: 0.7,
|
60
|
+
compressImageMaxWidth: 1080,
|
61
|
+
});
|
62
|
+
toast = rn_ui_1.Toast.loading();
|
63
|
+
const fileId = yield (0, upload_1.default)(image.path, image.mime);
|
64
|
+
yield (0, im_base_1.updateOptionSetting)({
|
65
|
+
type: currentConversation === null || currentConversation === void 0 ? void 0 : currentConversation.type,
|
66
|
+
conversationId: currentConversation.id,
|
67
|
+
optionKey: 'imageBackground',
|
68
|
+
optionValue: fileId,
|
69
|
+
});
|
70
|
+
const imManager = (0, init_1.getImManager)();
|
71
|
+
imManager.store.dispatch(im_base_1.ConversationActions.setCurrentConversation(Object.assign(Object.assign({}, currentConversation), { imageBackground: fileId })));
|
72
|
+
imManager.store.dispatch(im_base_1.ConversationActions.updateConversation({
|
73
|
+
id: currentConversation.id,
|
74
|
+
imageBackground: fileId,
|
75
|
+
}));
|
76
|
+
// 更新本地资源存储
|
77
|
+
yield imManager.updateResource({
|
78
|
+
url: fileId,
|
79
|
+
localPath: image.path,
|
80
|
+
});
|
81
|
+
toast.close();
|
82
|
+
navigation.dispatch(native_1.StackActions.pop(2));
|
83
|
+
}
|
84
|
+
catch (e) {
|
85
|
+
console.log(e);
|
86
|
+
toast === null || toast === void 0 ? void 0 : toast.close();
|
87
|
+
rn_ui_1.Toast.error(t('settingFail'));
|
88
|
+
}
|
89
|
+
});
|
90
|
+
return (<rn_ui_1.NavigationPage noPadding>
|
91
|
+
<rn_ui_1.Space size="m"/>
|
92
|
+
<rn_ui_1.ListRow title={t('chooseFromAlbum')} onPress={openAlbum} accessory="none"/>
|
93
|
+
</rn_ui_1.NavigationPage>);
|
94
|
+
};
|
95
|
+
exports.default = SettingChatBg;
|
@@ -0,0 +1,8 @@
|
|
1
|
+
import { conversationRoutes } from './conversation/conversation.routes';
|
2
|
+
import { messageRoutes } from './message/message.routes';
|
3
|
+
import { searchRoutes } from './search/search.routes';
|
4
|
+
import { collectRoutes } from './collection/collection.routes';
|
5
|
+
import addressListRoutes from './address-list/addressList.routes';
|
6
|
+
export type ImRoute = (typeof conversationRoutes)[number] | (typeof messageRoutes)[number] | (typeof searchRoutes)[number] | (typeof collectRoutes)[number] | (typeof addressListRoutes)[number];
|
7
|
+
export declare const imRoutes: ImRoute[];
|
8
|
+
export * from './types';
|