@smart-link/rn-im 1.0.23 → 1.0.26
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/assets/file-dir.jpg +0 -0
- 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 +22 -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 +2 -0
- package/dist/default-assets.js +9 -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.d.ts +9 -0
- 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.d.ts +1 -1
- 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.d.ts +1 -1
- 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 +50 -56
- 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/FileSelector.d.ts +6 -0
- package/dist/pages/message/FileSelector.js +235 -0
- 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 +151 -141
- package/dist/pages/message/MessageRecord.js +74 -87
- package/dist/pages/message/components/BusiNotifyCard.js +60 -85
- package/dist/pages/message/components/ChatBg.js +11 -36
- package/dist/pages/message/components/MessageItem.d.ts +2 -1
- package/dist/pages/message/components/MessageItem.js +85 -112
- package/dist/pages/message/components/MessageItemQuote.js +30 -58
- package/dist/pages/message/components/MessageItemTips.js +27 -55
- package/dist/pages/message/components/MessageOption.d.ts +7 -3
- package/dist/pages/message/components/MessageOption.js +107 -134
- package/dist/pages/message/components/MessagePayload.d.ts +2 -1
- 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.d.ts +1 -1
- package/dist/pages/message/components/Payload/PayloadFile.js +44 -68
- package/dist/pages/message/components/Payload/PayloadMultiple.js +46 -70
- package/dist/pages/message/components/Payload/PayloadNotify.js +28 -56
- package/dist/pages/message/components/Payload/PayloadPicture.d.ts +1 -1
- package/dist/pages/message/components/Payload/PayloadPicture.js +21 -50
- 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 +30 -57
- package/dist/pages/message/components/Payload/PayloadVoice.js +80 -93
- package/dist/pages/message/components/Payload/PayloadWrapper.d.ts +2 -1
- package/dist/pages/message/components/Payload/PayloadWrapper.js +24 -44
- package/dist/pages/message/components/Payload/type.d.ts +2 -1
- package/dist/pages/message/components/Payload/type.js +1 -2
- package/dist/pages/message/components/ReceiptBack.js +30 -60
- package/dist/pages/message/components/TextMixMessage.js +13 -38
- package/dist/pages/message/components/TextMixQuote.js +128 -162
- package/dist/pages/message/components/TextMixQuoteMessage.js +19 -47
- 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 -107
- 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 +21 -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.d.ts +4 -2
- package/dist/pages/types.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 +64 -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 +10 -2
- package/dist/utils/file.js +188 -88
- 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
- package/dist/slice/contact/contact.action.d.ts +0 -1
- package/dist/slice/contact/contact.action.js +0 -2
@@ -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 __rest = (this && this.__rest) || function (s, e) {
|
26
2
|
var t = {};
|
27
3
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
@@ -33,19 +9,15 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
33
9
|
}
|
34
10
|
return t;
|
35
11
|
};
|
36
|
-
|
37
|
-
|
38
|
-
};
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
const
|
44
|
-
|
45
|
-
const MaterialIcons_1 = __importDefault(require("react-native-vector-icons/MaterialIcons"));
|
46
|
-
const PayloadFile_1 = __importDefault(require("../message/components/Payload/PayloadFile"));
|
47
|
-
const { TEXT, VOICE, VIDEO, PICTURE, FILE, } = im_base_1.PayloadType;
|
48
|
-
function ContentFactory({ keyword, collection }) {
|
12
|
+
import LocalImage from '../../components/LocalImage';
|
13
|
+
import { PayloadType, numberToTime } from '@smart-link/im-base';
|
14
|
+
import { dp } from '@smart-link/rn-ui';
|
15
|
+
import React, { memo } from 'react';
|
16
|
+
import { Image, StyleSheet, Text, View } from 'react-native';
|
17
|
+
import MaterialIcon from 'react-native-vector-icons/MaterialIcons';
|
18
|
+
import PayloadFile from '../message/components/Payload/PayloadFile';
|
19
|
+
const { TEXT, VOICE, VIDEO, PICTURE, FILE, } = PayloadType;
|
20
|
+
export default function ContentFactory({ keyword, collection }) {
|
49
21
|
const { payloadType, payload } = collection, retProps = __rest(collection, ["payloadType", "payload"]);
|
50
22
|
switch (payloadType) {
|
51
23
|
case TEXT: {
|
@@ -56,7 +28,7 @@ function ContentFactory({ keyword, collection }) {
|
|
56
28
|
}
|
57
29
|
case FILE: {
|
58
30
|
// @ts-ignore
|
59
|
-
return <
|
31
|
+
return <PayloadFile payload={payload} {...retProps}/>;
|
60
32
|
}
|
61
33
|
case PICTURE: {
|
62
34
|
return <ContentPicture {...payload}/>;
|
@@ -69,49 +41,48 @@ function ContentFactory({ keyword, collection }) {
|
|
69
41
|
}
|
70
42
|
}
|
71
43
|
}
|
72
|
-
|
73
|
-
const ContentText = (0, react_1.memo)(props => {
|
44
|
+
const ContentText = memo(props => {
|
74
45
|
const { keyword, text } = props;
|
75
|
-
return (<
|
46
|
+
return (<Text style={styles.text} numberOfLines={3}>
|
76
47
|
{text}
|
77
|
-
</
|
48
|
+
</Text>);
|
78
49
|
});
|
79
50
|
const voiceLeft = require('../../../assets/voice-left.png');
|
80
|
-
const ContentVoice =
|
51
|
+
const ContentVoice = memo(props => {
|
81
52
|
const { duration } = props;
|
82
|
-
return (<
|
83
|
-
<
|
84
|
-
<
|
85
|
-
</
|
86
|
-
<
|
87
|
-
<
|
88
|
-
</
|
53
|
+
return (<View style={styles.content}>
|
54
|
+
<View style={[styles.voice]}>
|
55
|
+
<Image style={[styles.voiceImage]} resizeMode="contain" source={voiceLeft}/>
|
56
|
+
</View>
|
57
|
+
<View style={styles.w15}/>
|
58
|
+
<Text style={[styles.duration]}>{duration}''</Text>
|
59
|
+
</View>);
|
89
60
|
});
|
90
|
-
const ContentPicture =
|
61
|
+
const ContentPicture = memo(props => {
|
91
62
|
const { localPath, } = props;
|
92
|
-
return (<
|
93
|
-
<
|
94
|
-
</
|
63
|
+
return (<View style={styles.content}>
|
64
|
+
<LocalImage style={styles.picture} resizeMode="cover" localPath={(localPath)}/>
|
65
|
+
</View>);
|
95
66
|
});
|
96
|
-
const ContentVideo =
|
67
|
+
const ContentVideo = memo(props => {
|
97
68
|
const { imagePath, duration, } = props;
|
98
|
-
return (<
|
99
|
-
<
|
100
|
-
<
|
69
|
+
return (<View style={styles.content}>
|
70
|
+
<View>
|
71
|
+
<LocalImage style={styles.picture} resizeMode="cover" localPath={imagePath}/>
|
101
72
|
|
102
|
-
<
|
103
|
-
<
|
104
|
-
</
|
105
|
-
</
|
106
|
-
<
|
107
|
-
<
|
108
|
-
</
|
73
|
+
<View style={styles.playView}>
|
74
|
+
<MaterialIcon size={30} name="play-circle-outline" color="#fff"/>
|
75
|
+
</View>
|
76
|
+
</View>
|
77
|
+
<View style={styles.w15}/>
|
78
|
+
<Text>{numberToTime(duration)}</Text>
|
79
|
+
</View>);
|
109
80
|
});
|
110
|
-
const styles =
|
81
|
+
const styles = StyleSheet.create({
|
111
82
|
text: {
|
112
83
|
color: '#010101',
|
113
|
-
fontSize:
|
114
|
-
lineHeight:
|
84
|
+
fontSize: dp(14),
|
85
|
+
lineHeight: dp(20),
|
115
86
|
},
|
116
87
|
content: {
|
117
88
|
flexDirection: 'row',
|
@@ -120,37 +91,37 @@ const styles = react_native_1.StyleSheet.create({
|
|
120
91
|
voice: {
|
121
92
|
justifyContent: 'center',
|
122
93
|
alignItems: 'center',
|
123
|
-
height:
|
124
|
-
width:
|
94
|
+
height: dp(40),
|
95
|
+
width: dp(40),
|
125
96
|
backgroundColor: '#ebebeb',
|
126
97
|
},
|
127
98
|
voiceImage: {
|
128
|
-
width:
|
129
|
-
height:
|
99
|
+
width: dp(25),
|
100
|
+
height: dp(20),
|
130
101
|
},
|
131
102
|
filename: {
|
132
|
-
fontSize:
|
133
|
-
lineHeight:
|
103
|
+
fontSize: dp(15),
|
104
|
+
lineHeight: dp(20),
|
134
105
|
color: '#010101'
|
135
106
|
},
|
136
107
|
fileInfo: {
|
137
108
|
flex: 1,
|
138
|
-
paddingTop:
|
109
|
+
paddingTop: dp(2),
|
139
110
|
justifyContent: 'center'
|
140
111
|
},
|
141
112
|
fileSize: {
|
142
|
-
fontSize:
|
143
|
-
lineHeight:
|
113
|
+
fontSize: dp(12),
|
114
|
+
lineHeight: dp(20),
|
144
115
|
color: '#a2a2a2'
|
145
116
|
},
|
146
117
|
duration: {},
|
147
118
|
fileImage: {
|
148
|
-
width:
|
149
|
-
height:
|
119
|
+
width: dp(40),
|
120
|
+
height: dp(40)
|
150
121
|
},
|
151
122
|
picture: {
|
152
|
-
width:
|
153
|
-
height:
|
123
|
+
width: dp(90),
|
124
|
+
height: dp(90)
|
154
125
|
},
|
155
126
|
playView: {
|
156
127
|
position: 'absolute',
|
@@ -162,6 +133,6 @@ const styles = react_native_1.StyleSheet.create({
|
|
162
133
|
alignItems: "center"
|
163
134
|
},
|
164
135
|
w15: {
|
165
|
-
width:
|
136
|
+
width: dp(15),
|
166
137
|
}
|
167
138
|
});
|
@@ -1,14 +1,8 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
|
-
};
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
-
exports.collectRoutes = void 0;
|
7
|
-
const Collection_1 = __importDefault(require("./Collection"));
|
8
|
-
exports.collectRoutes = [
|
1
|
+
import Collection from './Collection';
|
2
|
+
export const collectRoutes = [
|
9
3
|
{
|
10
4
|
name: 'Collection',
|
11
|
-
component:
|
5
|
+
component: Collection,
|
12
6
|
options: {
|
13
7
|
animation: 'fade_from_bottom',
|
14
8
|
headerShown: false,
|
@@ -1,40 +1,12 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
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 useImSelector_1 = require("../../hooks/useImSelector");
|
33
|
-
const useTranslation_1 = __importDefault(require("../../hooks/useTranslation"));
|
34
|
-
const styles_1 = require("../../components/styles");
|
35
|
-
const ChatAvatar_1 = __importDefault(require("../../components/ChatAvatar/ChatAvatar"));
|
36
|
-
const im_base_1 = require("@smart-link/im-base");
|
37
|
-
const init_1 = require("../../init");
|
1
|
+
import React, { memo, useEffect } from 'react';
|
2
|
+
import { StyleSheet, TouchableOpacity, View, Text, FlatList } from 'react-native';
|
3
|
+
import { Checkbox, dp, NavigationPage, SearchInput, Space } from '@smart-link/rn-ui';
|
4
|
+
import { useForward, useMessage } from '../../hooks/useImSelector';
|
5
|
+
import useTranslation from '../../hooks/useTranslation';
|
6
|
+
import { shadowStyle } from '../../components/styles';
|
7
|
+
import ChatAvatar from '../../components/ChatAvatar/ChatAvatar';
|
8
|
+
import { ForwardActions, MessageActions } from '@smart-link/im-base';
|
9
|
+
import { getImManager } from '../../init';
|
38
10
|
function isChecked(selectList, item) {
|
39
11
|
for (let i = 0; i < selectList.length; i++) {
|
40
12
|
if (item.id === selectList[i].id) {
|
@@ -44,76 +16,76 @@ function isChecked(selectList, item) {
|
|
44
16
|
return false;
|
45
17
|
}
|
46
18
|
const ForwardToConversation = ({ navigation }) => {
|
47
|
-
const { forwardMessage } =
|
48
|
-
const { list, selectList } =
|
49
|
-
const { t } = (
|
50
|
-
const imManager =
|
51
|
-
|
19
|
+
const { forwardMessage } = useMessage();
|
20
|
+
const { list, selectList } = useForward();
|
21
|
+
const { t } = useTranslation();
|
22
|
+
const imManager = getImManager();
|
23
|
+
useEffect(() => {
|
52
24
|
navigation.setOptions({
|
53
25
|
headerLeft({ tintColor }) {
|
54
|
-
return (<
|
55
|
-
imManager.store.dispatch(
|
26
|
+
return (<TouchableOpacity activeOpacity={0.5} style={{ padding: dp(10) }} onPress={() => {
|
27
|
+
imManager.store.dispatch(ForwardActions.resetState());
|
56
28
|
navigation.goBack();
|
57
29
|
}}>
|
58
|
-
<
|
59
|
-
</
|
30
|
+
<Text style={{ color: tintColor }}>{t('cancel')}</Text>
|
31
|
+
</TouchableOpacity>);
|
60
32
|
},
|
61
33
|
headerTitle: t('selectChat'),
|
62
34
|
headerRight: ({ tintColor }) => {
|
63
35
|
const disabled = selectList.length === 0;
|
64
36
|
const selectCountText = disabled ? '' : '(' + selectList.length + ')';
|
65
|
-
return (<
|
66
|
-
imManager.store.dispatch(
|
67
|
-
imManager.store.dispatch(
|
68
|
-
imManager.store.dispatch(
|
37
|
+
return (<TouchableOpacity activeOpacity={0.5} style={{ padding: dp(10) }} disabled={disabled} onPress={() => {
|
38
|
+
imManager.store.dispatch(ForwardActions.forwardMessage(imManager, forwardMessage, selectList, () => {
|
39
|
+
imManager.store.dispatch(ForwardActions.resetState());
|
40
|
+
imManager.store.dispatch(MessageActions.setForwardMessage(null));
|
69
41
|
navigation.goBack();
|
70
42
|
}));
|
71
43
|
}}>
|
72
|
-
<
|
44
|
+
<Text style={{ color: tintColor }}>
|
73
45
|
{t('confirm')} {selectCountText}
|
74
|
-
</
|
75
|
-
</
|
46
|
+
</Text>
|
47
|
+
</TouchableOpacity>);
|
76
48
|
},
|
77
49
|
});
|
78
50
|
}, [navigation, t, forwardMessage, selectList]);
|
79
|
-
|
80
|
-
imManager.store.dispatch(
|
51
|
+
useEffect(() => {
|
52
|
+
imManager.store.dispatch(ForwardActions.loadList(imManager, ''));
|
81
53
|
}, []);
|
82
54
|
const renderItem = ({ item }) => {
|
83
55
|
const checked = isChecked(selectList, item);
|
84
56
|
const enableTopStyles = item.enableTop === 'on' ? styles.enableTop : null;
|
85
|
-
return (<
|
86
|
-
imManager.store.dispatch(
|
57
|
+
return (<TouchableOpacity activeOpacity={0.5} style={[styles.row, enableTopStyles]} onPress={() => {
|
58
|
+
imManager.store.dispatch(ForwardActions.onSelect(item, !checked));
|
87
59
|
}}>
|
88
|
-
<
|
89
|
-
<
|
90
|
-
</
|
60
|
+
<View style={{ marginRight: dp(10) }}>
|
61
|
+
<Checkbox style={{ pointerEvents: 'none' }} checked={checked}/>
|
62
|
+
</View>
|
91
63
|
|
92
|
-
<
|
93
|
-
<
|
94
|
-
<
|
64
|
+
<ChatAvatar disabled id={item.id} priority="outside" url={item.avatars} name={item.name} size={dp(40)} type={item.type}/>
|
65
|
+
<View style={styles.width10}/>
|
66
|
+
<Text numberOfLines={1} style={styles.nameText}>
|
95
67
|
{item.name}
|
96
|
-
</
|
97
|
-
</
|
68
|
+
</Text>
|
69
|
+
</TouchableOpacity>);
|
98
70
|
};
|
99
71
|
const listHeaderComponent = list.length === 0 ? null : (<>
|
100
|
-
<
|
101
|
-
<
|
102
|
-
</
|
103
|
-
<
|
72
|
+
<View style={styles.currChat}>
|
73
|
+
<Text style={styles.currChatText}>{t('recentChat')}</Text>
|
74
|
+
</View>
|
75
|
+
<View style={styles.listHeaderLine}/>
|
104
76
|
</>);
|
105
|
-
const listFooterComponent = list.length === 0 ? null : <
|
106
|
-
const itemSeparatorComponent = () => <
|
77
|
+
const listFooterComponent = list.length === 0 ? null : <View style={styles.listFooterLine}/>;
|
78
|
+
const itemSeparatorComponent = () => <View style={styles.separator}/>;
|
107
79
|
console.log(list);
|
108
|
-
return (<
|
109
|
-
<
|
110
|
-
imManager.store.dispatch(
|
80
|
+
return (<NavigationPage noPadding>
|
81
|
+
<SearchInput onSubmitEditing={e => {
|
82
|
+
imManager.store.dispatch(ForwardActions.loadList(imManager, e.nativeEvent.text));
|
111
83
|
}} placeholder={t('search')}/>
|
112
|
-
<
|
113
|
-
<
|
114
|
-
</
|
84
|
+
<Space size="m"/>
|
85
|
+
<FlatList contentContainerStyle={styles.list} ItemSeparatorComponent={itemSeparatorComponent} ListHeaderComponent={listHeaderComponent} ListFooterComponent={listFooterComponent} initialNumToRender={1} numColumns={1} data={list} keyExtractor={item => item.id} renderItem={renderItem}></FlatList>
|
86
|
+
</NavigationPage>);
|
115
87
|
};
|
116
|
-
const styles =
|
88
|
+
const styles = StyleSheet.create({
|
117
89
|
selector: {
|
118
90
|
flex: 1,
|
119
91
|
backgroundColor: '#fff',
|
@@ -126,41 +98,41 @@ const styles = react_native_1.StyleSheet.create({
|
|
126
98
|
borderColor: '#e9e9e9',
|
127
99
|
},
|
128
100
|
row: {
|
129
|
-
paddingHorizontal:
|
101
|
+
paddingHorizontal: dp(15),
|
130
102
|
flexDirection: 'row',
|
131
103
|
alignItems: 'center',
|
132
|
-
height:
|
104
|
+
height: dp(60),
|
133
105
|
},
|
134
106
|
currChat: {
|
135
107
|
backgroundColor: '#f3f3f3',
|
136
|
-
paddingHorizontal:
|
137
|
-
paddingVertical:
|
108
|
+
paddingHorizontal: dp(15),
|
109
|
+
paddingVertical: dp(5),
|
138
110
|
},
|
139
111
|
currChatText: {
|
140
112
|
color: '#999',
|
141
113
|
},
|
142
114
|
nameText: {
|
143
|
-
width:
|
115
|
+
width: dp(250),
|
144
116
|
color: '#333',
|
145
117
|
},
|
146
118
|
width10: {
|
147
|
-
width:
|
119
|
+
width: dp(10),
|
148
120
|
},
|
149
|
-
search: Object.assign({ backgroundColor: '#fff', padding:
|
121
|
+
search: Object.assign({ backgroundColor: '#fff', padding: dp(10), borderBottomWidth: dp(1), borderColor: '#e9e9e9' }, shadowStyle),
|
150
122
|
heightSpace: {
|
151
|
-
height:
|
123
|
+
height: dp(5),
|
152
124
|
},
|
153
125
|
listHeaderLine: {
|
154
|
-
height:
|
126
|
+
height: dp(1),
|
155
127
|
backgroundColor: '#ececec',
|
156
128
|
},
|
157
129
|
listFooterLine: {
|
158
|
-
height:
|
130
|
+
height: dp(1),
|
159
131
|
backgroundColor: '#ececec',
|
160
132
|
},
|
161
133
|
separator: {
|
162
|
-
marginLeft:
|
163
|
-
height:
|
134
|
+
marginLeft: dp(91),
|
135
|
+
height: dp(1),
|
164
136
|
backgroundColor: '#ececec',
|
165
137
|
},
|
166
138
|
empty: {
|
@@ -169,4 +141,4 @@ const styles = react_native_1.StyleSheet.create({
|
|
169
141
|
justifyContent: 'center',
|
170
142
|
},
|
171
143
|
});
|
172
|
-
|
144
|
+
export default memo(ForwardToConversation);
|