agora-appbuilder-core 4.0.13 → 4.0.15
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/package.json +1 -1
- package/template/_package-lock.json +1364 -1576
- package/template/android/app/src/main/assets/fonts/icomoon.ttf +0 -0
- package/template/customization-api/sub-components.ts +6 -4
- package/template/customization-api/types.ts +0 -6
- package/template/defaultConfig.js +0 -3
- package/template/global.d.ts +0 -3
- package/template/ios/Podfile.lock +0 -10
- package/template/package-lock.json +1364 -1576
- package/template/package.json +0 -4
- package/template/src/SDKAppWrapper.tsx +8 -2
- package/template/src/app-state/useMessages.ts +9 -49
- package/template/src/assets/font-styles.css +125 -289
- package/template/src/assets/fonts/icomoon.ttf +0 -0
- package/template/src/assets/selection.json +1 -1
- package/template/src/atoms/ActionMenu.tsx +2 -5
- package/template/src/atoms/CustomIcon.tsx +1 -17
- package/template/src/atoms/ImageIcon.tsx +3 -19
- package/template/src/atoms/Popup.tsx +4 -13
- package/template/src/atoms/ToolbarPreset.tsx +57 -6
- package/template/src/auth/AuthProvider.tsx +0 -5
- package/template/src/auth/config.ts +3 -12
- package/template/src/components/Chat.tsx +1 -7
- package/template/src/components/ChatContext.ts +0 -12
- package/template/src/components/CommonStyles.ts +2 -2
- package/template/src/components/Controls.tsx +57 -29
- package/template/src/components/Leftbar.tsx +4 -4
- package/template/src/components/Navbar.tsx +54 -29
- package/template/src/components/NavbarMobile.tsx +23 -33
- package/template/src/components/PinnedVideo.tsx +1 -1
- package/template/src/components/RTMConfigure.tsx +0 -1
- package/template/src/components/SdkApiContext.tsx +4 -1
- package/template/src/components/chat-messages/useChatMessages.tsx +607 -411
- package/template/src/components/chat-ui/useChatUIControls.tsx +0 -53
- package/template/src/components/meeting-info-invite/MeetingInfoGridTile.tsx +1 -4
- package/template/src/components/participants/Participant.tsx +1 -0
- package/template/src/components/precall/joinWaitingRoomBtn.native.tsx +1 -6
- package/template/src/components/precall/joinWaitingRoomBtn.tsx +1 -6
- package/template/src/components/room-info/useRoomInfo.tsx +5 -5
- package/template/src/language/default-labels/videoCallScreenLabels.ts +6 -86
- package/template/src/pages/VideoCall.tsx +4 -3
- package/template/src/pages/video-call/ActionSheetContent.tsx +32 -3
- package/template/src/pages/video-call/VideoCallScreenWrapper.tsx +12 -22
- package/template/src/pages/video-call/VideoComponent.tsx +11 -5
- package/template/src/pages/video-call/index.ts +0 -8
- package/template/src/subComponents/ChatBubble.tsx +32 -252
- package/template/src/subComponents/ChatContainer.tsx +4 -14
- package/template/src/subComponents/ChatInput.ios.tsx +184 -0
- package/template/src/subComponents/ChatInput.tsx +100 -276
- package/template/src/subComponents/RemoteMutePopup.tsx +131 -12
- package/template/src/subComponents/caption/CaptionContainer.tsx +2 -6
- package/template/src/subComponents/recording/useRecording.tsx +1 -3
- package/template/src/utils/SdkMethodEvents.ts +1 -0
- package/template/src/utils/common.tsx +17 -0
- package/template/src/utils/index.tsx +0 -30
- package/template/src/utils/useEndCall.ts +0 -7
- package/template/src/utils/useJoinRoom.ts +7 -33
- package/template/android/link-assets-manifest.json +0 -13
- package/template/ios/link-assets-manifest.json +0 -13
- package/template/src/atoms/InlinePopup.tsx +0 -185
- package/template/src/components/chat/chatConfigure.native.tsx +0 -488
- package/template/src/components/chat/chatConfigure.tsx +0 -473
- package/template/src/subComponents/ChatInput.native.tsx +0 -269
- package/template/src/subComponents/chat/ChatActionMenu.tsx +0 -224
- package/template/src/subComponents/chat/ChatAttachment.native.tsx +0 -234
- package/template/src/subComponents/chat/ChatAttachment.tsx +0 -145
- package/template/src/subComponents/chat/ChatEmoji.native.tsx +0 -75
- package/template/src/subComponents/chat/ChatEmoji.tsx +0 -181
- package/template/src/subComponents/chat/ChatSendButton.tsx +0 -141
- package/template/src/subComponents/chat/ChatUploadStatus.tsx +0 -65
- package/template/src/subComponents/chat/ImagePopup.tsx +0 -400
|
@@ -1,141 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import {StyleSheet, View} from 'react-native';
|
|
3
|
-
import {useChatConfigure} from '../../components/chat/chatConfigure';
|
|
4
|
-
import IconButton from '../../../src/atoms/IconButton';
|
|
5
|
-
import {
|
|
6
|
-
MIN_HEIGHT,
|
|
7
|
-
UploadStatus,
|
|
8
|
-
useChatUIControls,
|
|
9
|
-
MAX_TEXT_MESSAGE_SIZE,
|
|
10
|
-
} from '../../components/chat-ui/useChatUIControls';
|
|
11
|
-
import {useRoomInfo} from 'customization-api';
|
|
12
|
-
import {
|
|
13
|
-
ChatMessageType,
|
|
14
|
-
SDKChatType,
|
|
15
|
-
} from '../../components/chat-messages/useChatMessages';
|
|
16
|
-
import {useString} from '../../utils/useString';
|
|
17
|
-
import {
|
|
18
|
-
chatSendMessageBtnText,
|
|
19
|
-
chatSendErrorTextSizeToastHeading,
|
|
20
|
-
chatSendErrorTextSizeToastSubHeading,
|
|
21
|
-
} from '../../language/default-labels/videoCallScreenLabels';
|
|
22
|
-
import {isMobileUA, isWeb} from '../../utils/common';
|
|
23
|
-
import Toast from '../../../react-native-toast-message';
|
|
24
|
-
|
|
25
|
-
export interface ChatSendButtonProps {
|
|
26
|
-
render?: (onPress: () => void) => JSX.Element;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
const ChatSendButton = (props: ChatSendButtonProps) => {
|
|
30
|
-
const {sendChatSDKMessage} = useChatConfigure();
|
|
31
|
-
const {setShowEmojiPicker} = useChatUIControls();
|
|
32
|
-
const {
|
|
33
|
-
privateChatUser: selectedUserId,
|
|
34
|
-
message,
|
|
35
|
-
setMessage,
|
|
36
|
-
inputActive,
|
|
37
|
-
uploadStatus,
|
|
38
|
-
uploadedFiles,
|
|
39
|
-
setUploadedFiles,
|
|
40
|
-
setInputHeight,
|
|
41
|
-
} = useChatUIControls();
|
|
42
|
-
|
|
43
|
-
const {data} = useRoomInfo();
|
|
44
|
-
const isValidMsg =
|
|
45
|
-
message.length > 0 ||
|
|
46
|
-
(uploadedFiles.length > 0 && uploadStatus === UploadStatus.SUCCESS);
|
|
47
|
-
const toastHeadingSize = useString(chatSendErrorTextSizeToastHeading)();
|
|
48
|
-
const errorSubHeadingSize = useString(chatSendErrorTextSizeToastSubHeading);
|
|
49
|
-
|
|
50
|
-
const onPress = () => {
|
|
51
|
-
if (!isValidMsg) return;
|
|
52
|
-
if (message.length >= MAX_TEXT_MESSAGE_SIZE * 1024) {
|
|
53
|
-
Toast.show({
|
|
54
|
-
leadingIconName: 'alert',
|
|
55
|
-
type: 'error',
|
|
56
|
-
text1: toastHeadingSize,
|
|
57
|
-
text2: errorSubHeadingSize(MAX_TEXT_MESSAGE_SIZE.toString()),
|
|
58
|
-
visibilityTime: 3000,
|
|
59
|
-
primaryBtn: null,
|
|
60
|
-
secondaryBtn: null,
|
|
61
|
-
});
|
|
62
|
-
return;
|
|
63
|
-
}
|
|
64
|
-
const groupID = data.chat.group_id;
|
|
65
|
-
const msgType =
|
|
66
|
-
uploadedFiles.length > 0
|
|
67
|
-
? uploadedFiles[0].file_type
|
|
68
|
-
: ChatMessageType.TXT;
|
|
69
|
-
|
|
70
|
-
const {
|
|
71
|
-
file_ext = '',
|
|
72
|
-
file_length = 0,
|
|
73
|
-
file_name = '',
|
|
74
|
-
file_url = '',
|
|
75
|
-
} = uploadedFiles[0] || {};
|
|
76
|
-
|
|
77
|
-
const option = {
|
|
78
|
-
chatType: selectedUserId
|
|
79
|
-
? SDKChatType.SINGLE_CHAT
|
|
80
|
-
: SDKChatType.GROUP_CHAT,
|
|
81
|
-
type: msgType as ChatMessageType,
|
|
82
|
-
msg: msgType === ChatMessageType.TXT ? message : '', // currenlt not supporting combinarion msg (file+txt)
|
|
83
|
-
from: data.uid.toString(),
|
|
84
|
-
to: selectedUserId ? selectedUserId.toString() : groupID,
|
|
85
|
-
ext: {
|
|
86
|
-
file_length,
|
|
87
|
-
file_ext,
|
|
88
|
-
file_url,
|
|
89
|
-
file_name,
|
|
90
|
-
from_platform: isWeb() ? 'web' : 'native',
|
|
91
|
-
},
|
|
92
|
-
};
|
|
93
|
-
sendChatSDKMessage(option);
|
|
94
|
-
setMessage && setMessage('');
|
|
95
|
-
setInputHeight && setInputHeight(MIN_HEIGHT);
|
|
96
|
-
setUploadedFiles && setUploadedFiles(prev => []);
|
|
97
|
-
isWeb() && setShowEmojiPicker(false);
|
|
98
|
-
};
|
|
99
|
-
return props?.render ? (
|
|
100
|
-
props.render(onPress)
|
|
101
|
-
) : (
|
|
102
|
-
<View style={styles.containerBtn}>
|
|
103
|
-
<IconButton
|
|
104
|
-
hoverEffect={true}
|
|
105
|
-
hoverEffectStyle={{
|
|
106
|
-
backgroundColor: $config.ICON_BG_COLOR,
|
|
107
|
-
borderRadius: 24,
|
|
108
|
-
}}
|
|
109
|
-
toolTipMessage={
|
|
110
|
-
isMobileUA() ? null : useString(chatSendMessageBtnText)()
|
|
111
|
-
}
|
|
112
|
-
iconProps={{
|
|
113
|
-
iconType: 'plain',
|
|
114
|
-
iconContainerStyle: {
|
|
115
|
-
backgroundColor: isValidMsg
|
|
116
|
-
? $config.PRIMARY_ACTION_BRAND_COLOR
|
|
117
|
-
: 'transparent',
|
|
118
|
-
borderRadius: 30,
|
|
119
|
-
paddingVertical: 2,
|
|
120
|
-
paddingLeft: 8,
|
|
121
|
-
paddingRight: 4,
|
|
122
|
-
},
|
|
123
|
-
iconSize: 24,
|
|
124
|
-
name: isValidMsg ? 'chat_send_fill' : 'chat_send',
|
|
125
|
-
tintColor: isValidMsg
|
|
126
|
-
? $config.SECONDARY_ACTION_COLOR
|
|
127
|
-
: $config.SEMANTIC_NEUTRAL,
|
|
128
|
-
}}
|
|
129
|
-
onPress={onPress}
|
|
130
|
-
/>
|
|
131
|
-
</View>
|
|
132
|
-
);
|
|
133
|
-
};
|
|
134
|
-
|
|
135
|
-
const styles = StyleSheet.create({
|
|
136
|
-
containerBtn: {
|
|
137
|
-
padding: 2,
|
|
138
|
-
},
|
|
139
|
-
});
|
|
140
|
-
|
|
141
|
-
export default ChatSendButton;
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import {StyleSheet, Text, View} from 'react-native';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import hexadecimalTransparency from '../../../src/utils/hexadecimalTransparency';
|
|
4
|
-
import ThemeConfig from '../../../src/theme';
|
|
5
|
-
import {
|
|
6
|
-
UploadStatus,
|
|
7
|
-
useChatUIControls,
|
|
8
|
-
} from '../../components/chat-ui/useChatUIControls';
|
|
9
|
-
import {
|
|
10
|
-
chatUploadStatusFailure,
|
|
11
|
-
chatUploadStatusInProgress,
|
|
12
|
-
} from '../../language/default-labels/videoCallScreenLabels';
|
|
13
|
-
import {useString} from '../../utils/useString';
|
|
14
|
-
|
|
15
|
-
const ChatUploadStatus = () => {
|
|
16
|
-
const {uploadStatus} = useChatUIControls();
|
|
17
|
-
const inProgressText = useString(chatUploadStatusInProgress)();
|
|
18
|
-
const failureText = useString(chatUploadStatusFailure)();
|
|
19
|
-
|
|
20
|
-
let text = '';
|
|
21
|
-
switch (uploadStatus) {
|
|
22
|
-
case UploadStatus.IN_PROGRESS:
|
|
23
|
-
text = inProgressText;
|
|
24
|
-
break;
|
|
25
|
-
case UploadStatus.FAILURE:
|
|
26
|
-
text = failureText;
|
|
27
|
-
break;
|
|
28
|
-
}
|
|
29
|
-
return text.length > 0 ? (
|
|
30
|
-
<View
|
|
31
|
-
style={[
|
|
32
|
-
styles.chatStatusContainer,
|
|
33
|
-
uploadStatus === UploadStatus.FAILURE && {
|
|
34
|
-
backgroundColor:
|
|
35
|
-
$config.SEMANTIC_ERROR + hexadecimalTransparency['40%'],
|
|
36
|
-
},
|
|
37
|
-
]}>
|
|
38
|
-
<Text style={styles.chatStatusText}>{text}</Text>
|
|
39
|
-
</View>
|
|
40
|
-
) : null;
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
export default ChatUploadStatus;
|
|
44
|
-
|
|
45
|
-
const styles = StyleSheet.create({
|
|
46
|
-
chatStatusContainer: {
|
|
47
|
-
flexGrow: 1,
|
|
48
|
-
borderWidth: 1,
|
|
49
|
-
borderColor: $config.CARD_LAYER_5_COLOR + hexadecimalTransparency['40%'],
|
|
50
|
-
borderBottomWidth: 0,
|
|
51
|
-
paddingHorizontal: 16,
|
|
52
|
-
paddingVertical: 8,
|
|
53
|
-
backgroundColor: $config.SEMANTIC_NEUTRAL + hexadecimalTransparency['15%'],
|
|
54
|
-
borderTopLeftRadius: 8,
|
|
55
|
-
borderTopRightRadius: 8,
|
|
56
|
-
},
|
|
57
|
-
chatStatusText: {
|
|
58
|
-
fontFamily: ThemeConfig.FontFamily.sansPro,
|
|
59
|
-
fontSize: 12,
|
|
60
|
-
lineHeight: 14.5,
|
|
61
|
-
fontStyle: 'italic',
|
|
62
|
-
color: $config.FONT_COLOR + hexadecimalTransparency['70%'],
|
|
63
|
-
textAlign: 'center',
|
|
64
|
-
},
|
|
65
|
-
});
|
|
@@ -1,400 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
StyleSheet,
|
|
3
|
-
Text,
|
|
4
|
-
View,
|
|
5
|
-
Image,
|
|
6
|
-
ActivityIndicator,
|
|
7
|
-
TouchableOpacity,
|
|
8
|
-
useWindowDimensions,
|
|
9
|
-
} from 'react-native';
|
|
10
|
-
import React, {SetStateAction} from 'react';
|
|
11
|
-
import Popup from '../../atoms/Popup';
|
|
12
|
-
import UserAvatar from '../../atoms/UserAvatar';
|
|
13
|
-
import ThemeConfig from '../../theme';
|
|
14
|
-
import {timeAgo} from '../../../src/utils';
|
|
15
|
-
import IconButton from '../../atoms/IconButton';
|
|
16
|
-
import {useChatConfigure} from '../../components/chat/chatConfigure';
|
|
17
|
-
import {
|
|
18
|
-
SDKChatType,
|
|
19
|
-
useChatMessages,
|
|
20
|
-
} from '../../components/chat-messages/useChatMessages';
|
|
21
|
-
import Clipboard from '../../subComponents/Clipboard';
|
|
22
|
-
import {useRoomInfo} from '../../components/room-info/useRoomInfo';
|
|
23
|
-
import {useChatUIControls} from '../../components/chat-ui/useChatUIControls';
|
|
24
|
-
import {IconsInterface} from '../../atoms/CustomIcon';
|
|
25
|
-
import hexadecimalTransparency from '../../utils/hexadecimalTransparency';
|
|
26
|
-
import InlinePopup from '../../atoms/InlinePopup';
|
|
27
|
-
import {calculatePosition, trimText} from '../../utils/common';
|
|
28
|
-
import {useString} from '../../utils/useString';
|
|
29
|
-
import {
|
|
30
|
-
chatMessageDeleteConfirmBtnText,
|
|
31
|
-
chatPublicMessageDeletePopupText,
|
|
32
|
-
chatPrivateMessageDeletePopupText,
|
|
33
|
-
} from '../../language/default-labels/videoCallScreenLabels';
|
|
34
|
-
import {cancelText} from '../../language/default-labels/commonLabels';
|
|
35
|
-
import {useContent} from 'customization-api';
|
|
36
|
-
|
|
37
|
-
interface ImagePopupProps {
|
|
38
|
-
modalVisible: boolean;
|
|
39
|
-
setModalVisible: React.Dispatch<SetStateAction<boolean>>;
|
|
40
|
-
imageUrl: string;
|
|
41
|
-
fileName: string;
|
|
42
|
-
timestamp: string;
|
|
43
|
-
senderName: string;
|
|
44
|
-
msgId: string;
|
|
45
|
-
isLocal: boolean;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
const ImagePopup = (props: ImagePopupProps) => {
|
|
49
|
-
const {
|
|
50
|
-
modalVisible,
|
|
51
|
-
setModalVisible,
|
|
52
|
-
imageUrl,
|
|
53
|
-
fileName,
|
|
54
|
-
timestamp,
|
|
55
|
-
senderName,
|
|
56
|
-
msgId,
|
|
57
|
-
isLocal,
|
|
58
|
-
} = props;
|
|
59
|
-
const [isLoading, setIsLoading] = React.useState(true);
|
|
60
|
-
const [showDeleteMessageModal, setShowDeleteMessageModal] =
|
|
61
|
-
React.useState(false);
|
|
62
|
-
const {privateChatUser} = useChatUIControls();
|
|
63
|
-
const {
|
|
64
|
-
data: {isHost, chat},
|
|
65
|
-
} = useRoomInfo();
|
|
66
|
-
const {downloadAttachment, deleteAttachment} = useChatConfigure();
|
|
67
|
-
const {removeMessageFromPrivateStore, removeMessageFromStore} =
|
|
68
|
-
useChatMessages();
|
|
69
|
-
|
|
70
|
-
const groupID = chat.group_id;
|
|
71
|
-
const chatType = privateChatUser
|
|
72
|
-
? SDKChatType.SINGLE_CHAT
|
|
73
|
-
: SDKChatType.GROUP_CHAT;
|
|
74
|
-
const recallFromUser = privateChatUser ? privateChatUser : groupID;
|
|
75
|
-
const [modalPosition, setModalPosition] = React.useState({});
|
|
76
|
-
const [isPosCalculated, setIsPosCalculated] = React.useState(false);
|
|
77
|
-
const {width: globalWidth, height: globalHeight} = useWindowDimensions();
|
|
78
|
-
const btnRef = React.useRef<View>(null);
|
|
79
|
-
const {defaultContent} = useContent();
|
|
80
|
-
|
|
81
|
-
const cancelTxt = useString(cancelText)();
|
|
82
|
-
const cancelLabel =
|
|
83
|
-
cancelTxt.charAt(0).toUpperCase() + cancelTxt.slice(1).toLowerCase();
|
|
84
|
-
const confirmLabel = useString(chatMessageDeleteConfirmBtnText)();
|
|
85
|
-
|
|
86
|
-
let message = '';
|
|
87
|
-
if (chatType === SDKChatType.GROUP_CHAT) {
|
|
88
|
-
message = useString(chatPublicMessageDeletePopupText)();
|
|
89
|
-
}
|
|
90
|
-
if (chatType === SDKChatType.SINGLE_CHAT) {
|
|
91
|
-
message = useString(chatPrivateMessageDeletePopupText)(
|
|
92
|
-
trimText(defaultContent[recallFromUser]?.name),
|
|
93
|
-
);
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
React.useEffect(() => {
|
|
97
|
-
//getting btnRef x,y
|
|
98
|
-
if (!isLoading) {
|
|
99
|
-
btnRef?.current?.measure(
|
|
100
|
-
(
|
|
101
|
-
_fx: number,
|
|
102
|
-
_fy: number,
|
|
103
|
-
localWidth: number,
|
|
104
|
-
localHeight: number,
|
|
105
|
-
px: number,
|
|
106
|
-
py: number,
|
|
107
|
-
) => {
|
|
108
|
-
const data = calculatePosition({
|
|
109
|
-
px,
|
|
110
|
-
py,
|
|
111
|
-
localWidth,
|
|
112
|
-
localHeight,
|
|
113
|
-
globalHeight,
|
|
114
|
-
globalWidth,
|
|
115
|
-
});
|
|
116
|
-
setModalPosition(data);
|
|
117
|
-
setIsPosCalculated(true);
|
|
118
|
-
},
|
|
119
|
-
);
|
|
120
|
-
}
|
|
121
|
-
}, [isLoading]);
|
|
122
|
-
|
|
123
|
-
const handleImageLoad = () => {
|
|
124
|
-
setIsLoading(false);
|
|
125
|
-
};
|
|
126
|
-
|
|
127
|
-
const CloseIcon = () => {
|
|
128
|
-
return (
|
|
129
|
-
<View>
|
|
130
|
-
<IconButton
|
|
131
|
-
hoverEffect={true}
|
|
132
|
-
hoverEffectStyle={{
|
|
133
|
-
backgroundColor: $config.ICON_BG_COLOR,
|
|
134
|
-
borderRadius: 20,
|
|
135
|
-
}}
|
|
136
|
-
iconProps={{
|
|
137
|
-
iconType: 'plain',
|
|
138
|
-
iconSize: 24,
|
|
139
|
-
iconContainerStyle: {
|
|
140
|
-
padding: 0,
|
|
141
|
-
},
|
|
142
|
-
name: 'close',
|
|
143
|
-
tintColor: $config.SECONDARY_ACTION_COLOR,
|
|
144
|
-
}}
|
|
145
|
-
onPress={() => {
|
|
146
|
-
setModalVisible(false);
|
|
147
|
-
}}
|
|
148
|
-
/>
|
|
149
|
-
</View>
|
|
150
|
-
);
|
|
151
|
-
};
|
|
152
|
-
|
|
153
|
-
const Loader = () => {
|
|
154
|
-
return (
|
|
155
|
-
<View style={styles.spinnerContainer}>
|
|
156
|
-
<ActivityIndicator
|
|
157
|
-
size="large"
|
|
158
|
-
color={$config.PRIMARY_ACTION_BRAND_COLOR}
|
|
159
|
-
/>
|
|
160
|
-
</View>
|
|
161
|
-
);
|
|
162
|
-
};
|
|
163
|
-
|
|
164
|
-
const ControlsMenu = () => {
|
|
165
|
-
const menuItems = [
|
|
166
|
-
{
|
|
167
|
-
icon: 'delete',
|
|
168
|
-
iconColor: $config.SECONDARY_ACTION_COLOR,
|
|
169
|
-
iconSize: 24,
|
|
170
|
-
callback: () => {
|
|
171
|
-
if (isLocal) {
|
|
172
|
-
setShowDeleteMessageModal(true);
|
|
173
|
-
} else {
|
|
174
|
-
if (chatType === SDKChatType.SINGLE_CHAT) {
|
|
175
|
-
removeMessageFromPrivateStore(msgId, isLocal);
|
|
176
|
-
}
|
|
177
|
-
if (chatType === SDKChatType.GROUP_CHAT) {
|
|
178
|
-
removeMessageFromStore(msgId, isLocal);
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
},
|
|
182
|
-
},
|
|
183
|
-
{
|
|
184
|
-
icon: 'download',
|
|
185
|
-
iconColor: $config.SECONDARY_ACTION_COLOR,
|
|
186
|
-
iconSize: 24,
|
|
187
|
-
callback: () => {
|
|
188
|
-
downloadAttachment(fileName, imageUrl);
|
|
189
|
-
},
|
|
190
|
-
},
|
|
191
|
-
{
|
|
192
|
-
icon: 'close',
|
|
193
|
-
iconColor: $config.SECONDARY_ACTION_COLOR,
|
|
194
|
-
iconSize: 20,
|
|
195
|
-
callback: () => {
|
|
196
|
-
setModalVisible(false);
|
|
197
|
-
},
|
|
198
|
-
},
|
|
199
|
-
];
|
|
200
|
-
return !isLoading ? (
|
|
201
|
-
<View style={styles.controlsContainer}>
|
|
202
|
-
{menuItems.map((obj, index) => (
|
|
203
|
-
<View key={obj.icon} ref={obj.icon === 'delete' ? btnRef : null}>
|
|
204
|
-
<IconButton
|
|
205
|
-
hoverEffect={false}
|
|
206
|
-
hoverEffectStyle={{
|
|
207
|
-
backgroundColor:
|
|
208
|
-
$config.ICON_BG_COLOR + hexadecimalTransparency['50%'],
|
|
209
|
-
}}
|
|
210
|
-
iconProps={{
|
|
211
|
-
iconType: 'plain',
|
|
212
|
-
iconContainerStyle: {
|
|
213
|
-
backgroundColor: 'transparent',
|
|
214
|
-
paddingHorizontal: 8,
|
|
215
|
-
borderRightWidth: index === menuItems.length - 1 ? 0 : 1,
|
|
216
|
-
borderRightColor:
|
|
217
|
-
$config.SECONDARY_ACTION_COLOR +
|
|
218
|
-
hexadecimalTransparency['20%'],
|
|
219
|
-
},
|
|
220
|
-
iconSize: obj.iconSize,
|
|
221
|
-
name: obj.icon as keyof IconsInterface,
|
|
222
|
-
tintColor: obj.iconColor,
|
|
223
|
-
}}
|
|
224
|
-
onPress={obj.callback}
|
|
225
|
-
/>
|
|
226
|
-
</View>
|
|
227
|
-
))}
|
|
228
|
-
</View>
|
|
229
|
-
) : (
|
|
230
|
-
<></>
|
|
231
|
-
);
|
|
232
|
-
};
|
|
233
|
-
|
|
234
|
-
// const HeaderComponent = () => {
|
|
235
|
-
// return (
|
|
236
|
-
// <View style={styles.headerContainer}>
|
|
237
|
-
// <View style={styles.header}>
|
|
238
|
-
// <UserAvatar
|
|
239
|
-
// name={senderName}
|
|
240
|
-
// containerStyle={styles.avatarContainerStyle}
|
|
241
|
-
// textStyle={styles.avatarTextStyle}
|
|
242
|
-
// />
|
|
243
|
-
// <View>
|
|
244
|
-
// <Text
|
|
245
|
-
// style={styles.nameText}
|
|
246
|
-
// numberOfLines={1}
|
|
247
|
-
// ellipsizeMode={'tail'}>
|
|
248
|
-
// {senderName}
|
|
249
|
-
// </Text>
|
|
250
|
-
// <View style={styles.subTextContainer}>
|
|
251
|
-
// <Text style={styles.subText} ellipsizeMode={'tail'}>
|
|
252
|
-
// {timeAgo(parseInt(timestamp))} - {fileName}
|
|
253
|
-
// </Text>
|
|
254
|
-
// </View>
|
|
255
|
-
// </View>
|
|
256
|
-
// </View>
|
|
257
|
-
// <CloseIcon />
|
|
258
|
-
// </View>
|
|
259
|
-
// );
|
|
260
|
-
// };
|
|
261
|
-
return (
|
|
262
|
-
<Popup
|
|
263
|
-
modalVisible={modalVisible}
|
|
264
|
-
setModalVisible={setModalVisible}
|
|
265
|
-
showCloseIcon={false}
|
|
266
|
-
contentContainerStyle={styles.contentContainer}
|
|
267
|
-
bodyContainerStyle={styles.bodyContainer}
|
|
268
|
-
// headerComponent={<HeaderComponent />}
|
|
269
|
-
>
|
|
270
|
-
{isLoading ? <Loader /> : null}
|
|
271
|
-
<Image
|
|
272
|
-
source={{uri: imageUrl}}
|
|
273
|
-
style={styles.image}
|
|
274
|
-
onLoad={handleImageLoad}
|
|
275
|
-
/>
|
|
276
|
-
{isLocal ? (
|
|
277
|
-
<InlinePopup
|
|
278
|
-
actionMenuVisible={showDeleteMessageModal && isPosCalculated}
|
|
279
|
-
setActionMenuVisible={setShowDeleteMessageModal}
|
|
280
|
-
modalPosition={modalPosition}
|
|
281
|
-
message={message}
|
|
282
|
-
cancelLabel={cancelLabel}
|
|
283
|
-
cancelLabelStyle={{color: $config.SECONDARY_ACTION_COLOR}}
|
|
284
|
-
confirmLabel={confirmLabel}
|
|
285
|
-
confirmLabelStyle={{color: $config.SEMANTIC_ERROR}}
|
|
286
|
-
onConfirmClick={() => {
|
|
287
|
-
deleteAttachment(msgId, recallFromUser.toString(), chatType);
|
|
288
|
-
if (chatType === SDKChatType.SINGLE_CHAT) {
|
|
289
|
-
removeMessageFromPrivateStore(msgId, isLocal);
|
|
290
|
-
}
|
|
291
|
-
if (chatType === SDKChatType.GROUP_CHAT) {
|
|
292
|
-
removeMessageFromStore(msgId, isLocal);
|
|
293
|
-
}
|
|
294
|
-
setShowDeleteMessageModal(false);
|
|
295
|
-
setModalVisible(false);
|
|
296
|
-
}}
|
|
297
|
-
/>
|
|
298
|
-
) : (
|
|
299
|
-
<></>
|
|
300
|
-
)}
|
|
301
|
-
<ControlsMenu />
|
|
302
|
-
</Popup>
|
|
303
|
-
);
|
|
304
|
-
};
|
|
305
|
-
|
|
306
|
-
/*
|
|
307
|
-
|
|
308
|
-
*/
|
|
309
|
-
|
|
310
|
-
export default ImagePopup;
|
|
311
|
-
|
|
312
|
-
const styles = StyleSheet.create({
|
|
313
|
-
contentContainer: {
|
|
314
|
-
padding: 12,
|
|
315
|
-
width: '100%',
|
|
316
|
-
maxWidth: 1376,
|
|
317
|
-
marginHorizontal: 32,
|
|
318
|
-
},
|
|
319
|
-
headerContainer: {
|
|
320
|
-
flexDirection: 'row',
|
|
321
|
-
justifyContent: 'space-between',
|
|
322
|
-
alignItems: 'center',
|
|
323
|
-
flex: 1,
|
|
324
|
-
},
|
|
325
|
-
|
|
326
|
-
header: {
|
|
327
|
-
flexDirection: 'row',
|
|
328
|
-
alignItems: 'flex-start',
|
|
329
|
-
gap: 12,
|
|
330
|
-
paddingTop: 4,
|
|
331
|
-
paddingBottom: 16,
|
|
332
|
-
},
|
|
333
|
-
|
|
334
|
-
image: {
|
|
335
|
-
width: '100%',
|
|
336
|
-
aspectRatio: 16 / 9,
|
|
337
|
-
},
|
|
338
|
-
spinnerContainer: {
|
|
339
|
-
position: 'absolute',
|
|
340
|
-
justifyContent: 'center',
|
|
341
|
-
alignItems: 'center',
|
|
342
|
-
zIndex: 1,
|
|
343
|
-
},
|
|
344
|
-
bodyContainer: {
|
|
345
|
-
justifyContent: 'center',
|
|
346
|
-
alignItems: 'center',
|
|
347
|
-
position: 'relative',
|
|
348
|
-
},
|
|
349
|
-
closeBtnContainer: {
|
|
350
|
-
position: 'absolute',
|
|
351
|
-
top: -24,
|
|
352
|
-
right: -24,
|
|
353
|
-
},
|
|
354
|
-
avatarContainerStyle: {
|
|
355
|
-
width: 36,
|
|
356
|
-
height: 36,
|
|
357
|
-
borderRadius: 18,
|
|
358
|
-
backgroundColor: $config.VIDEO_AUDIO_TILE_AVATAR_COLOR,
|
|
359
|
-
},
|
|
360
|
-
avatarTextStyle: {
|
|
361
|
-
fontSize: ThemeConfig.FontSize.tiny,
|
|
362
|
-
lineHeight: 12,
|
|
363
|
-
fontWeight: '400',
|
|
364
|
-
color: $config.CARD_LAYER_1_COLOR,
|
|
365
|
-
},
|
|
366
|
-
nameText: {
|
|
367
|
-
fontWeight: '700',
|
|
368
|
-
fontSize: ThemeConfig.FontSize.normal,
|
|
369
|
-
lineHeight: 20,
|
|
370
|
-
fontFamily: ThemeConfig.FontFamily.sansPro,
|
|
371
|
-
flexDirection: 'row',
|
|
372
|
-
color: $config.FONT_COLOR,
|
|
373
|
-
textAlign: 'left',
|
|
374
|
-
},
|
|
375
|
-
subText: {
|
|
376
|
-
fontWeight: '400',
|
|
377
|
-
fontSize: ThemeConfig.FontSize.tiny,
|
|
378
|
-
lineHeight: 16,
|
|
379
|
-
fontFamily: ThemeConfig.FontFamily.sansPro,
|
|
380
|
-
flexDirection: 'row',
|
|
381
|
-
color: $config.FONT_COLOR,
|
|
382
|
-
},
|
|
383
|
-
subTextContainer: {
|
|
384
|
-
flexDirection: 'row',
|
|
385
|
-
},
|
|
386
|
-
controlsContainer: {
|
|
387
|
-
backgroundColor:
|
|
388
|
-
$config.CARD_LAYER_2_COLOR + hexadecimalTransparency['50%'],
|
|
389
|
-
flexDirection: 'row',
|
|
390
|
-
position: 'absolute',
|
|
391
|
-
justifyContent: 'center',
|
|
392
|
-
alignItems: 'center',
|
|
393
|
-
right: 16,
|
|
394
|
-
top: 12,
|
|
395
|
-
borderRadius: 4,
|
|
396
|
-
paddingVertical: 8,
|
|
397
|
-
zIndex: 1,
|
|
398
|
-
elevation: 1,
|
|
399
|
-
},
|
|
400
|
-
});
|