Skip to content

Commit 2a62128

Browse files
v4.3.23
1 parent e4e1aa5 commit 2a62128

File tree

5 files changed

+40
-22
lines changed

5 files changed

+40
-22
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@cometchat/chat-uikit-react-native",
3-
"version": "4.3.22",
3+
"version": "4.3.23",
44
"description": "Ready-to-use Chat UI Components for React Native",
55
"main": "src/index",
66
"module": "src/index",

src/CometChatMessageHeader/CometChatMessageHeader.tsx

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,13 @@ import {
99
ViewProps,
1010
//@ts-ignore
1111
} from 'react-native';
12-
import React, { useEffect, useState, useRef, useContext } from 'react';
12+
import React, {
13+
useEffect,
14+
useState,
15+
useRef,
16+
useContext,
17+
useCallback,
18+
} from 'react';
1319
import { AvatarStyle, CometChatContext, CometChatListItem } from '../shared';
1420
import { localize } from '../shared';
1521
import { ICONS } from './resources';
@@ -400,6 +406,17 @@ export const CometChatMessageHeader = (
400406
};
401407
}, []);
402408

409+
const AppBarOptionsView = useCallback(() => {
410+
if (AppBarOptions) {
411+
return (
412+
<AppBarOptions
413+
{...(user ? { user } : groupObj ? { group: groupObj } : {})}
414+
/>
415+
);
416+
}
417+
return null;
418+
}, [user?.getUid(), groupObj?.getGuid()]);
419+
403420
return (
404421
<View
405422
style={
@@ -498,19 +515,7 @@ export const CometChatMessageHeader = (
498515
: null
499516
: null
500517
}
501-
TailView={
502-
AppBarOptions
503-
? () => (
504-
<AppBarOptions
505-
{...(user
506-
? { user }
507-
: groupObj
508-
? { group: groupObj }
509-
: {})}
510-
/>
511-
)
512-
: null
513-
}
518+
TailView={AppBarOptionsView}
514519
headViewContainerStyle={headViewContainerStyle}
515520
tailViewContainerStyle={tailViewContainerStyle}
516521
avatarStyle={_avatarStyle}

src/calls/CometChatIncomingCall/CometChatIncomingCall.tsx

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ import React, { useState, useContext, useEffect, useRef } from 'react';
22
import {
33
View,
44
Text,
5-
TextStyle
5+
TextStyle,
6+
Modal
67
} from 'react-native';
78
//@ts-ignore
89
import { CometChat } from '@cometchat/chat-sdk-react-native';
@@ -214,7 +215,14 @@ export const CometChatIncomingCall = (props: CometChatIncomingCallInterface) =>
214215
}, []);
215216

216217
return (
217-
<>
218+
<Modal
219+
transparent
220+
animated
221+
animationType="fade"
222+
onRequestClose={() => {
223+
return;
224+
}}
225+
>
218226
{
219227
showCallScreen ?
220228
<CometChatOngoingCall
@@ -277,6 +285,6 @@ export const CometChatIncomingCall = (props: CometChatIncomingCallInterface) =>
277285
}}
278286
/>
279287
}
280-
</>
288+
</Modal>
281289
)
282290
};

src/calls/CometChatOutgoingCall/CometChatOutgoingCall.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,12 @@ export const CometChatOutgoingCall = (props: CometChatOutgoingCallInterface) =>
221221
transparent
222222
animated
223223
animationType="fade"
224-
onRequestClose={() => onDeclineButtonPressed && onDeclineButtonPressed(call as CometChat.Call)}
224+
onRequestClose={() => {
225+
if (isCallConnected) {
226+
return;
227+
}
228+
onDeclineButtonPressed && onDeclineButtonPressed(call as CometChat.Call)
229+
}}
225230
>
226231
<SafeAreaView>
227232
{

src/shared/views/CometChatListItem/CometChatListItem.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { useContext, useEffect, useRef, useState } from 'react';
1+
import React, { useCallback, useContext, useEffect, useRef, useState } from 'react';
22

33
import {
44
View,
@@ -194,13 +194,13 @@ export const CometChatListItem = (props: CometChatListItemInterface) => {
194194
/**
195195
* Component to be display the Tail section
196196
*/
197-
const TailViewFc = () => {
197+
const TailViewFc = useCallback(() => {
198198
return (
199199
<View style={[Style.tailViewStyle, tailViewContainerStyle ?? {}]}>
200200
{Boolean(TailView) && typeof TailView === 'function' && <TailView />}
201201
</View>
202202
);
203-
};
203+
}, [tailViewContainerStyle, tailViewContainerStyle, TailView]);
204204

205205
/**
206206
* Component to be display the Options in list after swipe

0 commit comments

Comments
 (0)