@smart-link/rn-im 1.0.20 → 1.0.21
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.
@@ -54,6 +54,8 @@ const List = ({ navigation }) => {
|
|
54
54
|
const [nativeEvent, setNativeEvent] = (0, react_1.useState)();
|
55
55
|
const [popoverVisible, setPopoverVisible] = (0, react_1.useState)(false);
|
56
56
|
const [conversation, setConversation] = (0, react_1.useState)();
|
57
|
+
const lastPressTime = (0, react_1.useRef)(0);
|
58
|
+
const flatListRef = (0, react_1.useRef)(null);
|
57
59
|
(0, react_1.useEffect)(() => {
|
58
60
|
let headerTitle = t('message');
|
59
61
|
switch (connectStatus) {
|
@@ -115,6 +117,25 @@ const List = ({ navigation }) => {
|
|
115
117
|
</rn_ui_1.Popover>),
|
116
118
|
});
|
117
119
|
}, [t, navigation, connectStatus]);
|
120
|
+
(0, react_1.useEffect)(() => {
|
121
|
+
return navigation.addListener('tabPress', (e) => {
|
122
|
+
const now = Date.now();
|
123
|
+
if (now - lastPressTime.current < 300) {
|
124
|
+
// 双击, 定位到第一个未读消息
|
125
|
+
conversations.find((item) => {
|
126
|
+
var _a;
|
127
|
+
if (item.unreadCount > 0 && item.enableNoDisturb === 'off') {
|
128
|
+
(_a = flatListRef.current) === null || _a === void 0 ? void 0 : _a.scrollToIndex({
|
129
|
+
index: conversations.indexOf(item),
|
130
|
+
animated: true,
|
131
|
+
});
|
132
|
+
return true;
|
133
|
+
}
|
134
|
+
});
|
135
|
+
}
|
136
|
+
lastPressTime.current = now;
|
137
|
+
});
|
138
|
+
}, [navigation, conversations]);
|
118
139
|
const handleSearch = () => {
|
119
140
|
navigation.navigate('Search');
|
120
141
|
};
|
@@ -172,7 +193,7 @@ const List = ({ navigation }) => {
|
|
172
193
|
index,
|
173
194
|
});
|
174
195
|
return (<react_native_1.View style={{ flex: 1 }}>
|
175
|
-
<react_native_1.FlatList contentContainerStyle={styles.contentContainerStyle} keyboardShouldPersistTaps={'handled'} data={conversations} ListHeaderComponent={listHeaderComponent} ListFooterComponent={listFooterComponent} ItemSeparatorComponent={itemSeparatorComponent} getItemLayout={getItemLayout} renderItem={renderItem} numColumns={1} keyExtractor={keyExtractor}/>
|
196
|
+
<react_native_1.FlatList ref={flatListRef} contentContainerStyle={styles.contentContainerStyle} keyboardShouldPersistTaps={'handled'} data={conversations} ListHeaderComponent={listHeaderComponent} ListFooterComponent={listFooterComponent} ItemSeparatorComponent={itemSeparatorComponent} getItemLayout={getItemLayout} renderItem={renderItem} numColumns={1} keyExtractor={keyExtractor}/>
|
176
197
|
<ConversationOption_1.default conversation={conversation} nativeEvent={nativeEvent} visible={popoverVisible} onClose={() => {
|
177
198
|
setPopoverVisible(false);
|
178
199
|
setConversation(undefined);
|
@@ -12,7 +12,6 @@ const OptionAvatars_1 = __importDefault(require("./OptionAvatars"));
|
|
12
12
|
const OptionConversation_1 = __importDefault(require("./OptionConversation"));
|
13
13
|
const common_action_sheet_1 = require("../../../utils/common-action-sheet");
|
14
14
|
const init_1 = require("../../../init");
|
15
|
-
const react_native_1 = require("react-native");
|
16
15
|
const OptionGroup_1 = __importDefault(require("../../../pages/conversation/setting/OptionGroup"));
|
17
16
|
const OptionCancelGroup_1 = __importDefault(require("../../../pages/conversation/setting/OptionCancelGroup"));
|
18
17
|
const contact_slice_1 = require("../../../slice/contact/contact.slice");
|
@@ -27,7 +26,8 @@ const ConversationSetting = ({ navigation }) => {
|
|
27
26
|
const { currentConversation } = (0, useImSelector_1.useConversation)();
|
28
27
|
const { groupDetail } = (0, useImSelector_1.useChatGroup)();
|
29
28
|
const title = t('chatSetting');
|
30
|
-
const
|
29
|
+
const memberTotalCount = (groupDetail === null || groupDetail === void 0 ? void 0 : groupDetail.memberTotalCount) || 0;
|
30
|
+
const groupMemberList = (groupDetail === null || groupDetail === void 0 ? void 0 : groupDetail.groupMemberList) || [];
|
31
31
|
// 设置标题
|
32
32
|
(0, react_1.useEffect)(() => {
|
33
33
|
let newTitle = title;
|
@@ -79,10 +79,10 @@ const ConversationSetting = ({ navigation }) => {
|
|
79
79
|
const toEditGroupNameOrNotice = (type) => {
|
80
80
|
navigation.navigate('OptionGroupNameOrNoticeEdit', { type });
|
81
81
|
};
|
82
|
-
// 群组转让
|
83
|
-
const toGroupTransfer = () => {
|
84
|
-
|
85
|
-
};
|
82
|
+
// // 群组转让
|
83
|
+
// const toGroupTransfer = () => {
|
84
|
+
// // navigation.navigate('OptionGroupTransferPage');
|
85
|
+
// };
|
86
86
|
// 群组管理
|
87
87
|
const toGroupMgr = () => {
|
88
88
|
navigation.navigate('OptionGroupManage');
|
@@ -176,9 +176,4 @@ const ConversationSetting = ({ navigation }) => {
|
|
176
176
|
{content}
|
177
177
|
</rn_ui_1.NavigationPage>);
|
178
178
|
};
|
179
|
-
const styles = react_native_1.StyleSheet.create({
|
180
|
-
setting: {
|
181
|
-
paddingVertical: (0, rn_ui_1.dp)(15),
|
182
|
-
},
|
183
|
-
});
|
184
179
|
exports.default = ConversationSetting;
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@smart-link/rn-im",
|
3
|
-
"version": "1.0.
|
3
|
+
"version": "1.0.21",
|
4
4
|
"description": "",
|
5
5
|
"main": "./dist/index.js",
|
6
6
|
"dependencies": {
|
@@ -64,7 +64,7 @@
|
|
64
64
|
"redux": "^4.2.1",
|
65
65
|
"redux-thunk": "^2.4.2",
|
66
66
|
"@smart-link/rn-ui": "^1.0.6",
|
67
|
-
"@smart-link/im-base": "^1.0.
|
67
|
+
"@smart-link/im-base": "^1.0.21"
|
68
68
|
},
|
69
69
|
"files": [
|
70
70
|
"dist/**",
|