@smart-link/rn-im 1.0.23 → 1.0.24
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/dist/api/addressList.js +6 -17
- package/dist/api/backup.js +8 -20
- package/dist/api/file.js +6 -35
- package/dist/api/user.js +6 -16
- package/dist/components/CachedImage.js +14 -42
- package/dist/components/Camera/Camera.js +26 -54
- package/dist/components/Camera/CameraCapture.js +99 -128
- package/dist/components/Camera/CameraResult.js +33 -61
- package/dist/components/ChatAvatar/ChatAvatar.d.ts +1 -1
- package/dist/components/ChatAvatar/ChatAvatar.js +34 -62
- package/dist/components/ChatAvatar/ChatAvatarId.d.ts +2 -2
- package/dist/components/ChatAvatar/ChatAvatarId.js +26 -51
- package/dist/components/ChatAvatar/ChatAvatarLocal.d.ts +2 -2
- package/dist/components/ChatAvatar/ChatAvatarLocal.js +23 -25
- package/dist/components/ChatAvatar/index.js +2 -23
- package/dist/components/Favicon.js +6 -34
- package/dist/components/FormatTimeText.js +5 -10
- package/dist/components/Highlighter.js +9 -34
- package/dist/components/IndicatorText.js +14 -39
- package/dist/components/LocalImage.js +7 -32
- package/dist/components/NetworkUnconnected.js +14 -42
- package/dist/components/PopoverWrapper.js +22 -47
- package/dist/components/VideoPlayer.js +111 -138
- package/dist/components/styles.js +10 -13
- package/dist/default-assets.d.ts +1 -0
- package/dist/default-assets.js +8 -10
- package/dist/hooks/useDownloadSource.js +7 -12
- package/dist/hooks/useFormatMsgTime.js +5 -13
- package/dist/hooks/useImReady.js +7 -10
- package/dist/hooks/useImSelector.js +34 -48
- package/dist/hooks/useTranslation.js +5 -10
- package/dist/index.d.ts +1 -0
- package/dist/index.js +8 -28
- package/dist/init.js +30 -40
- package/dist/interface.js +1 -2
- package/dist/locales/en/addressList.js +1 -3
- package/dist/locales/index.js +4 -27
- package/dist/locales/lao/addressList.js +1 -3
- package/dist/locales/zh/addressList.js +1 -3
- package/dist/pages/address-list/AddressList.js +33 -61
- package/dist/pages/address-list/CardInfo.js +10 -18
- package/dist/pages/address-list/ChooseContact.js +50 -78
- package/dist/pages/address-list/Icons.js +7 -14
- package/dist/pages/address-list/Organization.js +59 -89
- package/dist/pages/address-list/UserDetail.js +55 -83
- package/dist/pages/address-list/UserJobs.js +31 -33
- package/dist/pages/address-list/UserSearch.js +29 -54
- package/dist/pages/address-list/addressList.routes.js +11 -16
- package/dist/pages/collection/Collection.js +53 -81
- package/dist/pages/collection/ContentFactory.js +53 -82
- package/dist/pages/collection/collection.routes.js +3 -9
- package/dist/pages/conversation/ForwardToConversation.js +63 -91
- package/dist/pages/conversation/List.js +74 -102
- package/dist/pages/conversation/components/ConversationCard.js +46 -74
- package/dist/pages/conversation/components/ConversationOption.js +27 -55
- package/dist/pages/conversation/conversation.routes.js +17 -23
- package/dist/pages/conversation/setting/GroupTransfer.js +32 -60
- package/dist/pages/conversation/setting/OptionAvatars.js +62 -90
- package/dist/pages/conversation/setting/OptionCancelGroup.js +14 -42
- package/dist/pages/conversation/setting/OptionConversation.js +20 -48
- package/dist/pages/conversation/setting/OptionGroup.js +20 -48
- package/dist/pages/conversation/setting/OptionGroupManage.js +21 -49
- package/dist/pages/conversation/setting/OptionGroupMoreMember.js +48 -53
- package/dist/pages/conversation/setting/OptionGroupNameOrNoticeEdit.js +49 -77
- package/dist/pages/conversation/setting/Setting.js +49 -54
- package/dist/pages/conversation/setting/SettingChatBg.js +26 -54
- package/dist/pages/index.js +7 -27
- package/dist/pages/message/ChooseMember.js +56 -84
- package/dist/pages/message/MessageBackup/Bar.js +18 -43
- package/dist/pages/message/MessageBackup/MessageBackup.js +42 -72
- package/dist/pages/message/MessageBackup/RestoreBackupPage.js +48 -76
- package/dist/pages/message/MessageBackup/StartBackupPage.js +48 -76
- package/dist/pages/message/MessageBackup/index.js +3 -12
- package/dist/pages/message/MessageBackup/utils.js +14 -22
- package/dist/pages/message/MessageList.js +141 -135
- package/dist/pages/message/MessageRecord.js +49 -73
- package/dist/pages/message/components/BusiNotifyCard.js +60 -85
- package/dist/pages/message/components/ChatBg.js +11 -36
- package/dist/pages/message/components/MessageItem.js +82 -110
- package/dist/pages/message/components/MessageItemQuote.js +30 -58
- package/dist/pages/message/components/MessageItemTips.js +27 -55
- package/dist/pages/message/components/MessageOption.js +96 -120
- package/dist/pages/message/components/MessagePayload.js +36 -64
- package/dist/pages/message/components/MessagePictureAlbum.js +32 -60
- package/dist/pages/message/components/MessageReceiptStatus.js +18 -43
- package/dist/pages/message/components/MessageUndo.js +18 -48
- package/dist/pages/message/components/MultipleBar/index.js +48 -76
- package/dist/pages/message/components/Payload/PayloadContact.js +30 -58
- package/dist/pages/message/components/Payload/PayloadFile.js +41 -65
- package/dist/pages/message/components/Payload/PayloadMultiple.js +38 -66
- package/dist/pages/message/components/Payload/PayloadNotify.js +28 -56
- package/dist/pages/message/components/Payload/PayloadPicture.js +21 -49
- package/dist/pages/message/components/Payload/PayloadShare.js +39 -67
- package/dist/pages/message/components/Payload/PayloadText.js +39 -67
- package/dist/pages/message/components/Payload/PayloadVideo.js +28 -56
- package/dist/pages/message/components/Payload/PayloadVoice.js +80 -93
- package/dist/pages/message/components/Payload/PayloadWrapper.js +18 -43
- package/dist/pages/message/components/Payload/type.js +1 -2
- package/dist/pages/message/components/ReceiptBack.js +31 -61
- package/dist/pages/message/components/TextMixMessage.js +13 -38
- package/dist/pages/message/components/TextMixQuote.js +129 -158
- package/dist/pages/message/components/TextMixQuoteMessage.js +16 -44
- package/dist/pages/message/components/UploadProgress.js +12 -37
- package/dist/pages/message/components/messageBar/EmojiPanel.js +25 -50
- package/dist/pages/message/components/messageBar/Icons.js +56 -74
- package/dist/pages/message/components/messageBar/MessageBar.js +84 -115
- package/dist/pages/message/components/messageBar/MessageInput.js +30 -55
- package/dist/pages/message/components/messageBar/OptionPanel.js +54 -82
- package/dist/pages/message/components/messageBar/VoiceBar.js +122 -100
- package/dist/pages/message/components/messageBar/index.js +2 -23
- package/dist/pages/message/message.routes.js +11 -40
- package/dist/pages/search/Search.js +38 -66
- package/dist/pages/search/SearchChatRecords.js +64 -92
- package/dist/pages/search/SearchFile.js +68 -96
- package/dist/pages/search/SearchManager.js +60 -65
- package/dist/pages/search/SearchPicturePage.js +16 -44
- package/dist/pages/search/components/ChatRecords.js +46 -74
- package/dist/pages/search/components/MyGroupChat.js +41 -69
- package/dist/pages/search/components/PictureMulipleBar.js +35 -63
- package/dist/pages/search/components/SearchFileList.js +59 -64
- package/dist/pages/search/components/SearchPictures.js +68 -98
- package/dist/pages/search/components/SearchShareLinkList.js +50 -55
- package/dist/pages/search/components/SearchUser.js +25 -53
- package/dist/pages/search/components/useSearchMessage.js +12 -16
- package/dist/pages/search/search.routes.js +11 -17
- package/dist/pages/search/utils.js +4 -12
- package/dist/pages/types.js +1 -2
- package/dist/slice/contact/contact.action.js +1 -2
- package/dist/slice/contact/contact.slice.js +4 -8
- package/dist/slice/index.js +7 -13
- package/dist/slice/panel/panel.slice.d.ts +2 -1
- package/dist/slice/panel/panel.slice.js +8 -7
- package/dist/slice/video/video.action.d.ts +1 -0
- package/dist/slice/video/video.action.js +56 -38
- package/dist/slice/video/video.slice.d.ts +1 -1
- package/dist/slice/video/video.slice.js +7 -8
- package/dist/utils/audio.d.ts +3 -0
- package/dist/utils/audio.js +10 -0
- package/dist/utils/color.js +2 -9
- package/dist/utils/common-action-sheet.js +9 -14
- package/dist/utils/cookie.js +6 -14
- package/dist/utils/emoji.js +9 -12
- package/dist/utils/file-icon.js +33 -60
- package/dist/utils/file-operate.js +1 -2
- package/dist/utils/file.d.ts +1 -1
- package/dist/utils/file.js +74 -87
- package/dist/utils/golden-rectangle.js +3 -7
- package/dist/utils/phone.js +13 -22
- package/dist/utils/request.js +7 -15
- package/dist/utils/scroll.js +5 -9
- package/dist/utils/summary.js +4 -11
- package/dist/utils/take-camera.js +12 -19
- package/dist/utils/text-mix.js +4 -11
- package/dist/utils/upload.js +20 -41
- package/package.json +6 -7
@@ -1,49 +1,43 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
const
|
10
|
-
const ForwardToConversation_1 = __importDefault(require("./ForwardToConversation"));
|
11
|
-
const OptionGroupNameOrNoticeEdit_1 = __importDefault(require("./setting/OptionGroupNameOrNoticeEdit"));
|
12
|
-
const OptionGroupManage_1 = __importDefault(require("./setting/OptionGroupManage"));
|
13
|
-
const GroupTransfer_1 = __importDefault(require("./setting/GroupTransfer"));
|
14
|
-
const OptionGroupMoreMember_1 = __importDefault(require("../../pages/conversation/setting/OptionGroupMoreMember"));
|
15
|
-
exports.conversationRoutes = [
|
1
|
+
import List from './List';
|
2
|
+
import Setting from './setting/Setting';
|
3
|
+
import SettingChatBg from './setting/SettingChatBg';
|
4
|
+
import ForwardToConversation from './ForwardToConversation';
|
5
|
+
import OptionGroupNameOrNoticeEdit from './setting/OptionGroupNameOrNoticeEdit';
|
6
|
+
import OptionGroupManage from './setting/OptionGroupManage';
|
7
|
+
import GroupTransfer from './setting/GroupTransfer';
|
8
|
+
import OptionGroupMoreMember from "./setting/OptionGroupMoreMember";
|
9
|
+
export const conversationRoutes = [
|
16
10
|
{
|
17
11
|
name: 'ConversationList',
|
18
|
-
component:
|
12
|
+
component: List,
|
19
13
|
options: {
|
20
14
|
title: '',
|
21
15
|
}
|
22
16
|
},
|
23
17
|
{
|
24
18
|
name: 'ConversationSetting',
|
25
|
-
component:
|
19
|
+
component: Setting,
|
26
20
|
options: {
|
27
21
|
title: '',
|
28
22
|
}
|
29
23
|
},
|
30
24
|
{
|
31
25
|
name: 'OptionGroupNameOrNoticeEdit',
|
32
|
-
component:
|
26
|
+
component: OptionGroupNameOrNoticeEdit,
|
33
27
|
options: {
|
34
28
|
title: '',
|
35
29
|
}
|
36
30
|
},
|
37
31
|
{
|
38
32
|
name: 'OptionGroupManage',
|
39
|
-
component:
|
33
|
+
component: OptionGroupManage,
|
40
34
|
options: {
|
41
35
|
title: '',
|
42
36
|
}
|
43
37
|
},
|
44
38
|
{
|
45
39
|
name: 'ForwardToConversation',
|
46
|
-
component:
|
40
|
+
component: ForwardToConversation,
|
47
41
|
options: {
|
48
42
|
animation: 'fade_from_bottom',
|
49
43
|
title: '',
|
@@ -51,14 +45,14 @@ exports.conversationRoutes = [
|
|
51
45
|
},
|
52
46
|
{
|
53
47
|
name: 'SettingChatBg',
|
54
|
-
component:
|
48
|
+
component: SettingChatBg,
|
55
49
|
options: {
|
56
50
|
title: '',
|
57
51
|
}
|
58
52
|
},
|
59
53
|
{
|
60
54
|
name: 'GroupTransfer',
|
61
|
-
component:
|
55
|
+
component: GroupTransfer,
|
62
56
|
options: {
|
63
57
|
title: '',
|
64
58
|
animation: 'fade_from_bottom',
|
@@ -66,7 +60,7 @@ exports.conversationRoutes = [
|
|
66
60
|
},
|
67
61
|
{
|
68
62
|
name: 'OptionGroupMoreMember',
|
69
|
-
component:
|
63
|
+
component: OptionGroupMoreMember,
|
70
64
|
options: {
|
71
65
|
title: '',
|
72
66
|
}
|
@@ -1,27 +1,3 @@
|
|
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
1
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
26
2
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
27
3
|
return new (P || (P = Promise))(function (resolve, reject) {
|
@@ -31,57 +7,53 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
31
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
32
8
|
});
|
33
9
|
};
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
const im_base_1 = require("@smart-link/im-base");
|
43
|
-
const rn_ui_1 = require("@smart-link/rn-ui");
|
44
|
-
const react_1 = __importStar(require("react"));
|
45
|
-
const react_native_1 = require("react-native");
|
10
|
+
import ChatAvatar from '../../../components/ChatAvatar/ChatAvatar';
|
11
|
+
import { useConversation } from '../../../hooks/useImSelector';
|
12
|
+
import useTranslation from '../../../hooks/useTranslation';
|
13
|
+
import { getImManager } from '../../../init';
|
14
|
+
import { ConversationActions } from '@smart-link/im-base';
|
15
|
+
import { Checkbox, ListRow, NavigationPage, SearchInput } from '@smart-link/rn-ui';
|
16
|
+
import React, { useEffect, useMemo, useState } from 'react';
|
17
|
+
import { View, StyleSheet, FlatList, Text, TouchableOpacity } from 'react-native';
|
46
18
|
const GroupTransfer = ({ navigation }) => {
|
47
|
-
const { t } = (
|
48
|
-
const { allMembers } =
|
49
|
-
const [checkedMember, setCheckedMember] =
|
50
|
-
const [keyword, setKeyword] =
|
51
|
-
const list =
|
19
|
+
const { t } = useTranslation();
|
20
|
+
const { allMembers } = useConversation();
|
21
|
+
const [checkedMember, setCheckedMember] = useState(null);
|
22
|
+
const [keyword, setKeyword] = useState('');
|
23
|
+
const list = useMemo(() => {
|
52
24
|
return allMembers === null || allMembers === void 0 ? void 0 : allMembers.filter(item => item.memberLevel !== 'owner');
|
53
25
|
}, [allMembers]);
|
54
|
-
|
26
|
+
useEffect(() => {
|
55
27
|
navigation.setOptions({
|
56
28
|
title: t('chooseNewOwner'),
|
57
29
|
headerRight: ({ tintColor }) => {
|
58
|
-
return (<
|
30
|
+
return (<TouchableOpacity disabled={!checkedMember} onPress={() => __awaiter(void 0, void 0, void 0, function* () {
|
59
31
|
if (checkedMember) {
|
60
|
-
const imManager =
|
61
|
-
yield imManager.store.dispatch(
|
32
|
+
const imManager = getImManager();
|
33
|
+
yield imManager.store.dispatch(ConversationActions.groupTransfer(imManager, checkedMember));
|
62
34
|
navigation.goBack();
|
63
35
|
}
|
64
36
|
})} style={{ marginRight: 10 }}>
|
65
|
-
<
|
66
|
-
</
|
37
|
+
<Text style={{ color: tintColor }}>{t('confirm')}</Text>
|
38
|
+
</TouchableOpacity>);
|
67
39
|
},
|
68
40
|
});
|
69
41
|
}, [navigation, t, checkedMember]);
|
70
|
-
return (<
|
71
|
-
<
|
72
|
-
<
|
73
|
-
</
|
42
|
+
return (<NavigationPage noPadding>
|
43
|
+
<View style={{ margin: 10 }}>
|
44
|
+
<SearchInput value={keyword} onChange={text => setKeyword(text)} style={{ height: 40 }}/>
|
45
|
+
</View>
|
74
46
|
|
75
|
-
<
|
76
|
-
return (<
|
77
|
-
<
|
78
|
-
<
|
79
|
-
<
|
80
|
-
</
|
47
|
+
<FlatList data={list} renderItem={({ item }) => {
|
48
|
+
return (<ListRow title={<View style={{ flexDirection: 'row', alignItems: 'center' }}>
|
49
|
+
<Checkbox checked={(checkedMember === null || checkedMember === void 0 ? void 0 : checkedMember.userId) === item.userId} style={{ pointerEvents: 'none', width: 40, marginRight: 10 }}/>
|
50
|
+
<ChatAvatar disabled id={item.userId} name={item.memberName} url={item.memberAvatars}/>
|
51
|
+
<Text style={{ marginLeft: 10, fontSize: 16, color: '#333' }}>{item.memberName}</Text>
|
52
|
+
</View>} onPress={() => {
|
81
53
|
setCheckedMember(item);
|
82
54
|
}} accessory="none"/>);
|
83
55
|
}} keyExtractor={item => item.userId}/>
|
84
|
-
</
|
56
|
+
</NavigationPage>);
|
85
57
|
};
|
86
|
-
const styles =
|
87
|
-
|
58
|
+
const styles = StyleSheet.create({});
|
59
|
+
export default GroupTransfer;
|
@@ -1,152 +1,124 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
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 im_base_1 = require("@smart-link/im-base");
|
30
|
-
const react_1 = __importStar(require("react"));
|
31
|
-
const react_native_1 = require("react-native");
|
32
|
-
const ChatAvatar_1 = __importDefault(require("../../../components/ChatAvatar/ChatAvatar"));
|
33
|
-
const rn_ui_1 = require("@smart-link/rn-ui");
|
34
|
-
const useTranslation_1 = __importDefault(require("../../../hooks/useTranslation"));
|
35
|
-
const MaterialIcons_1 = __importDefault(require("react-native-vector-icons/MaterialIcons"));
|
36
|
-
const default_assets_1 = require("../../../default-assets");
|
37
|
-
const { OWNER, MGR } = im_base_1.MemberLevel;
|
38
|
-
const { width } = react_native_1.Dimensions.get('window');
|
1
|
+
import { MemberLevel } from '@smart-link/im-base';
|
2
|
+
import React, { memo } from 'react';
|
3
|
+
import { Image, StyleSheet, Text, TouchableOpacity, View, Dimensions } from 'react-native';
|
4
|
+
import ChatAvatar from '../../../components/ChatAvatar/ChatAvatar';
|
5
|
+
import { dp, ListRow, px, useTheme } from '@smart-link/rn-ui';
|
6
|
+
import useTranslation from '../../../hooks/useTranslation';
|
7
|
+
import MaterialIcons from 'react-native-vector-icons/MaterialIcons';
|
8
|
+
import { defaultAvatars } from '../../../default-assets';
|
9
|
+
const { OWNER, MGR } = MemberLevel;
|
10
|
+
const { width } = Dimensions.get('window');
|
39
11
|
const AvatarsItem = props => {
|
40
12
|
const { userId, userName, memberLevel } = props;
|
41
13
|
// console.log(props)
|
42
|
-
const adminSource = memberLevel === OWNER ?
|
43
|
-
return (<
|
44
|
-
{adminSource && <
|
14
|
+
const adminSource = memberLevel === OWNER ? defaultAvatars.GROUP_OWNER : memberLevel === MGR ? defaultAvatars.GROUP_MGR : null;
|
15
|
+
return (<View style={styles.avatarsItem}>
|
16
|
+
{adminSource && <Image source={adminSource} style={styles.admin} resizeMode={'contain'}/>}
|
45
17
|
|
46
|
-
<
|
47
|
-
<
|
48
|
-
<
|
18
|
+
<ChatAvatar id={userId} name={userName} size={dp(45)}/>
|
19
|
+
<View style={styles.heightSpace}/>
|
20
|
+
<Text numberOfLines={1} style={styles.userName}>
|
49
21
|
{userName}
|
50
|
-
</
|
51
|
-
</
|
22
|
+
</Text>
|
23
|
+
</View>);
|
52
24
|
};
|
53
|
-
const OptionAvatars =
|
25
|
+
const OptionAvatars = memo(props => {
|
54
26
|
const { list = [], showTitle = false, showAdd, isMgr, showMore, memberTotalCount, removeUser, addUser, toMoreMember, style, } = props;
|
55
|
-
const { t } = (
|
56
|
-
const theme =
|
27
|
+
const { t } = useTranslation();
|
28
|
+
const theme = useTheme();
|
57
29
|
const subCount = isMgr ? 8 : 9;
|
58
30
|
// @ts-ignore
|
59
|
-
return (<
|
60
|
-
{showTitle && (<
|
31
|
+
return (<View>
|
32
|
+
{showTitle && (<ListRow title={t('groupChatMember')} detail={'(' + (memberTotalCount || 0) + ')'} onPress={toMoreMember}/>)}
|
61
33
|
|
62
|
-
<
|
34
|
+
<View style={[
|
63
35
|
styles.avatarsList,
|
64
36
|
style,
|
65
37
|
{ borderColor: theme.borderColor },
|
66
|
-
showTitle ? {} : { borderTopWidth:
|
38
|
+
showTitle ? {} : { borderTopWidth: px(1) },
|
67
39
|
]}>
|
68
40
|
{list.slice(0, subCount).map((item) => {
|
69
41
|
return <AvatarsItem key={item.userId} {...item}/>;
|
70
42
|
})}
|
71
43
|
|
72
|
-
{showAdd && (<
|
73
|
-
<
|
74
|
-
</
|
44
|
+
{showAdd && (<TouchableOpacity style={[styles.avatarsItem, styles.optionItem]} onPress={addUser}>
|
45
|
+
<MaterialIcons name="add" size={dp(28)}></MaterialIcons>
|
46
|
+
</TouchableOpacity>)}
|
75
47
|
|
76
|
-
{isMgr && (<
|
77
|
-
<
|
78
|
-
</
|
48
|
+
{isMgr && (<TouchableOpacity style={[styles.avatarsItem, styles.optionItem]} onPress={removeUser}>
|
49
|
+
<MaterialIcons name="remove" size={dp(28)}></MaterialIcons>
|
50
|
+
</TouchableOpacity>)}
|
79
51
|
|
80
|
-
{showMore && (<
|
81
|
-
<
|
52
|
+
{showMore && (<TouchableOpacity style={styles.showMore} onPress={toMoreMember}>
|
53
|
+
<Text style={styles.showMoreText}>
|
82
54
|
{t('viewMoreMember')}
|
83
55
|
{'>'}
|
84
|
-
</
|
85
|
-
</
|
56
|
+
</Text>
|
57
|
+
</TouchableOpacity>)}
|
86
58
|
|
87
|
-
{!showMore && <
|
88
|
-
</
|
89
|
-
</
|
59
|
+
{!showMore && <View style={styles.notShowMore}/>}
|
60
|
+
</View>
|
61
|
+
</View>);
|
90
62
|
});
|
91
|
-
const styles =
|
63
|
+
const styles = StyleSheet.create({
|
92
64
|
admin: {
|
93
|
-
height:
|
94
|
-
width:
|
95
|
-
bottom:
|
65
|
+
height: dp(15),
|
66
|
+
width: dp(15),
|
67
|
+
bottom: dp(18),
|
96
68
|
right: -16,
|
97
69
|
position: 'absolute',
|
98
70
|
},
|
99
71
|
avatarsList: {
|
100
72
|
flexDirection: 'row',
|
101
73
|
flexWrap: 'wrap',
|
102
|
-
paddingHorizontal: (width -
|
74
|
+
paddingHorizontal: (width - dp(42) * 5) / 12 - 0.01,
|
103
75
|
backgroundColor: '#fff',
|
104
|
-
paddingTop:
|
105
|
-
borderBottomWidth:
|
76
|
+
paddingTop: dp(5),
|
77
|
+
borderBottomWidth: px(1),
|
106
78
|
},
|
107
79
|
avatarsItem: {
|
108
|
-
height:
|
109
|
-
width:
|
110
|
-
marginTop:
|
111
|
-
marginHorizontal: (width -
|
80
|
+
height: dp(60),
|
81
|
+
width: dp(42),
|
82
|
+
marginTop: dp(10),
|
83
|
+
marginHorizontal: (width - dp(42) * 5) / 12 - 0.01,
|
112
84
|
justifyContent: 'center',
|
113
85
|
alignItems: 'center',
|
114
86
|
},
|
115
87
|
userName: {
|
116
|
-
fontSize:
|
88
|
+
fontSize: dp(12),
|
117
89
|
color: '#4d4d4d',
|
118
90
|
},
|
119
91
|
optionItem: {
|
120
|
-
borderWidth:
|
92
|
+
borderWidth: dp(1),
|
121
93
|
borderColor: '#ebebeb',
|
122
|
-
borderRadius:
|
94
|
+
borderRadius: dp(3),
|
123
95
|
justifyContent: 'center',
|
124
96
|
alignItems: 'center',
|
125
|
-
height:
|
126
|
-
width:
|
97
|
+
height: dp(42),
|
98
|
+
width: dp(42),
|
127
99
|
},
|
128
100
|
option: {
|
129
|
-
height:
|
130
|
-
width:
|
101
|
+
height: dp(20),
|
102
|
+
width: dp(20),
|
131
103
|
},
|
132
104
|
showMore: {
|
133
105
|
width: width,
|
134
|
-
height:
|
106
|
+
height: dp(46),
|
135
107
|
backgroundColor: '#ffffff',
|
136
108
|
justifyContent: 'center',
|
137
109
|
alignItems: 'center',
|
138
110
|
},
|
139
111
|
showMoreText: {
|
140
|
-
fontSize:
|
141
|
-
lineHeight:
|
112
|
+
fontSize: dp(13),
|
113
|
+
lineHeight: dp(15),
|
142
114
|
color: '#999',
|
143
115
|
},
|
144
116
|
heightSpace: {
|
145
|
-
height:
|
117
|
+
height: dp(3),
|
146
118
|
},
|
147
119
|
notShowMore: {
|
148
|
-
height:
|
120
|
+
height: dp(15),
|
149
121
|
width: width,
|
150
122
|
},
|
151
123
|
});
|
152
|
-
|
124
|
+
export default OptionAvatars;
|
@@ -1,49 +1,21 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
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 rn_ui_1 = require("@smart-link/rn-ui");
|
32
|
-
const useTranslation_1 = __importDefault(require("../../../hooks/useTranslation"));
|
33
|
-
const OptionCancelGroup = (0, react_1.memo)(props => {
|
1
|
+
import React, { memo } from 'react';
|
2
|
+
import { StyleSheet, View } from 'react-native';
|
3
|
+
import { dp, Button, } from '@smart-link/rn-ui';
|
4
|
+
import useTranslation from "../../../hooks/useTranslation";
|
5
|
+
const OptionCancelGroup = memo(props => {
|
34
6
|
const { leaveGroup } = props;
|
35
|
-
const { t } = (
|
36
|
-
return (<
|
37
|
-
<
|
38
|
-
</
|
7
|
+
const { t } = useTranslation();
|
8
|
+
return (<View style={styles.cancelGroup}>
|
9
|
+
<Button type="primary" size="m" onPress={leaveGroup} textStyle={styles.cancelGroupBt}>{t('deleteAndLeave')}</Button>
|
10
|
+
</View>);
|
39
11
|
});
|
40
|
-
const styles =
|
12
|
+
const styles = StyleSheet.create({
|
41
13
|
cancelGroup: {
|
42
|
-
padding:
|
14
|
+
padding: dp(25),
|
43
15
|
},
|
44
16
|
cancelGroupBt: {
|
45
|
-
paddingVertical:
|
46
|
-
fontSize:
|
17
|
+
paddingVertical: dp(4),
|
18
|
+
fontSize: dp(16),
|
47
19
|
}
|
48
20
|
});
|
49
|
-
|
21
|
+
export default OptionCancelGroup;
|
@@ -1,50 +1,22 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
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 rn_ui_1 = require("@smart-link/rn-ui");
|
32
|
-
const useTranslation_1 = __importDefault(require("../../../hooks/useTranslation"));
|
33
|
-
const OptionConversation = (0, react_1.memo)(props => {
|
1
|
+
import React, { memo, useCallback } from 'react';
|
2
|
+
import { Switch, View } from 'react-native';
|
3
|
+
import { ListRow, Space } from '@smart-link/rn-ui';
|
4
|
+
import useTranslation from '../../../hooks/useTranslation';
|
5
|
+
const OptionConversation = memo(props => {
|
34
6
|
const { enableNoDisturb, enableTop, settingEnableNoDisturb, settingEnableTop, showSearch = true, showBackgroundSetting, toImageBackground, clearMessage, toSearchMessage, toSearchFile, toSearchPicture, toSearchManagePage, style, } = props;
|
35
|
-
const { t } = (
|
36
|
-
const onChangeEnableNoDisturb =
|
7
|
+
const { t } = useTranslation();
|
8
|
+
const onChangeEnableNoDisturb = useCallback((value) => {
|
37
9
|
settingEnableNoDisturb && settingEnableNoDisturb(value ? 'on' : 'off');
|
38
10
|
}, []);
|
39
|
-
const onChangeEnableTop =
|
11
|
+
const onChangeEnableTop = useCallback((value) => {
|
40
12
|
settingEnableTop && settingEnableTop(value ? 'on' : 'off');
|
41
13
|
}, []);
|
42
|
-
return (<
|
14
|
+
return (<View style={style}>
|
43
15
|
|
44
16
|
{showSearch &&
|
45
17
|
<>
|
46
|
-
<
|
47
|
-
<
|
18
|
+
<ListRow title={t('searchChatRecords')} onPress={toSearchMessage}/>
|
19
|
+
<ListRow title={t('filesAndPicturesAndLinks')} onPress={toSearchManagePage} topSeparator='full' bottomSeparator='full'/>
|
48
20
|
{/*<ListRow title={t('fileManager')}*/}
|
49
21
|
{/* onPress={toSearchFile}*/}
|
50
22
|
{/* topSeparator={'full'}*/}
|
@@ -53,19 +25,19 @@ const OptionConversation = (0, react_1.memo)(props => {
|
|
53
25
|
{/* topSeparator={'full'}*/}
|
54
26
|
{/* onPress={toSearchPicture}*/}
|
55
27
|
{/*/>*/}
|
56
|
-
<
|
28
|
+
<Space size='m'/>
|
57
29
|
</>}
|
58
|
-
<
|
59
|
-
<
|
30
|
+
<ListRow title={t('enableNoDisturb')} detail={<Switch value={enableNoDisturb === 'on'} onValueChange={onChangeEnableNoDisturb}/>} bottomSeparator='full'/>
|
31
|
+
<ListRow title={t('enableTop')} detail={<Switch value={enableTop === 'on'} onValueChange={onChangeEnableTop}/>}/>
|
60
32
|
{showBackgroundSetting &&
|
61
33
|
<>
|
62
|
-
<
|
63
|
-
<
|
34
|
+
<Space size='m'/>
|
35
|
+
<ListRow title={t('setCurrentChatBackground')} onPress={toImageBackground}/>
|
64
36
|
</>}
|
65
|
-
<
|
66
|
-
<
|
37
|
+
<Space size='m'/>
|
38
|
+
<ListRow title={t('clearChatRecords')} onPress={() => {
|
67
39
|
clearMessage && clearMessage();
|
68
40
|
}} accessory={'none'}/>
|
69
|
-
</
|
41
|
+
</View>);
|
70
42
|
});
|
71
|
-
|
43
|
+
export default OptionConversation;
|