agora-appbuilder-core 3.0.10 → 3.0.12
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/Readme.md +0 -6
- package/package.json +2 -2
- package/template/_package-lock.json +4979 -7086
- package/template/agora-rn-uikit/src/Contexts/LocalUserContext.tsx +0 -4
- package/template/agora-rn-uikit/src/Contexts/PropsContext.tsx +0 -18
- package/template/agora-rn-uikit/src/Contexts/RtcContext.tsx +0 -2
- package/template/agora-rn-uikit/src/Controls/BtnTemplate.tsx +26 -30
- package/template/agora-rn-uikit/src/Controls/Icons.ts +83 -30
- package/template/agora-rn-uikit/src/Controls/ImageIcon.tsx +6 -6
- package/template/agora-rn-uikit/src/Reducer/LocalMuteAudio.ts +0 -1
- package/template/agora-rn-uikit/src/Reducer/LocalMuteVideo.ts +0 -1
- package/template/agora-rn-uikit/src/Reducer/RemoteAudioStateChanged.ts +0 -1
- package/template/agora-rn-uikit/src/Reducer/RemoteVideoStateChanged.ts +0 -1
- package/template/agora-rn-uikit/src/Reducer/UpdateDualStreamMode.ts +0 -1
- package/template/agora-rn-uikit/src/Reducer/UserJoined.ts +0 -2
- package/template/agora-rn-uikit/src/Reducer/UserMuteRemoteAudio.ts +0 -1
- package/template/agora-rn-uikit/src/Reducer/UserMuteRemoteVideo.ts +0 -1
- package/template/agora-rn-uikit/src/Reducer/UserOffline.ts +0 -1
- package/template/agora-rn-uikit/src/Reducer/index.ts +0 -3
- package/template/agora-rn-uikit/src/Rtc/Create.tsx +1 -89
- package/template/agora-rn-uikit/src/RtcConfigure.tsx +2 -39
- package/template/agora-rn-uikit/src/Views/MaxVideoView.native.tsx +5 -15
- package/template/agora-rn-uikit/src/Views/MaxVideoView.tsx +9 -15
- package/template/agora-rn-uikit/src/index.ts +1 -3
- package/template/android/app/build.gradle +0 -1
- package/template/android/app/src/main/AndroidManifest.xml +15 -22
- package/template/android/app/src/main/java/com/helloworld/MainActivity.java +0 -50
- package/template/android/build.gradle +3 -3
- package/template/babel.config.js +0 -1
- package/template/bridge/rtc/webNg/RtcEngine.ts +17 -110
- package/template/customization-api/sub-components.ts +1 -1
- package/template/customization-api/typeDefinition.ts +1 -2
- package/template/electron/index.html +27 -27
- package/template/electron/renderer/index.js +0 -1
- package/template/global.d.ts +4 -26
- package/template/index.js +0 -4
- package/template/index.rsdk.tsx +0 -1
- package/template/index.web.js +1 -7
- package/template/index.wsdk.tsx +1 -1
- package/template/ios/HelloWorld/Info.plist +1 -14
- package/template/ios/HelloWorld.xcodeproj/project.pbxproj +0 -17
- package/template/metro.config.js +1 -1
- package/template/package.json +7 -21
- package/template/react-native-toast-message/index.d.ts +43 -43
- package/template/react-native-toast-message/src/colors/index.js +2 -3
- package/template/react-native-toast-message/src/components/base/index.js +59 -46
- package/template/react-native-toast-message/src/components/base/styles.js +32 -16
- package/template/react-native-toast-message/src/components/error.js +2 -3
- package/template/react-native-toast-message/src/components/info.js +2 -3
- package/template/react-native-toast-message/src/components/success.js +2 -3
- package/template/react-native-toast-message/src/index.js +31 -122
- package/template/react-native-toast-message/src/index.sdk.tsx +35 -125
- package/template/react-native-toast-message/src/styles.js +4 -3
- package/template/react-native-toast-message/src/styles.sdk.ts +4 -3
- package/template/src/App.tsx +0 -6
- package/template/src/AppWrapper.tsx +28 -63
- package/template/src/assets/icons.ts +102 -0
- package/template/src/atoms/HorizontalRule.tsx +1 -3
- package/template/src/atoms/PrimaryButton.tsx +26 -51
- package/template/src/atoms/SecondaryButton.tsx +5 -8
- package/template/src/atoms/TextInput.tsx +14 -12
- package/template/src/components/Chat.tsx +214 -86
- package/template/src/components/ChatContext.ts +1 -8
- package/template/src/components/ColorConfigure.tsx +1 -1
- package/template/src/components/ColorContext.ts +1 -1
- package/template/src/components/{Controls1.native.tsx → Controls.native.tsx} +4 -6
- package/template/src/components/Controls.tsx +42 -342
- package/template/src/components/DeviceConfigure.tsx +101 -461
- package/template/src/components/DeviceContext.tsx +4 -8
- package/template/src/components/EventsConfigure.tsx +7 -144
- package/template/src/components/GraphQLProvider.tsx +1 -1
- package/template/src/components/GridVideo.tsx +44 -59
- package/template/src/components/HostControlView.tsx +35 -114
- package/template/src/components/Navbar.tsx +398 -216
- package/template/src/components/NetworkQualityContext.tsx +20 -20
- package/template/src/components/ParticipantsView.tsx +154 -177
- package/template/src/components/PinnedVideo.tsx +120 -207
- package/template/src/components/Precall.native.tsx +119 -358
- package/template/src/components/Precall.tsx +135 -269
- package/template/src/components/RTMConfigure.tsx +4 -27
- package/template/src/components/Router.electron.ts +0 -1
- package/template/src/components/Router.native.ts +0 -1
- package/template/src/components/Router.sdk.ts +0 -1
- package/template/src/components/Router.ts +0 -1
- package/template/src/components/Settings.tsx +95 -26
- package/template/src/components/SettingsView.tsx +56 -251
- package/template/src/components/Share.tsx +273 -302
- package/template/src/components/StorageContext.tsx +3 -30
- package/template/src/components/chat-messages/useChatMessages.tsx +23 -69
- package/template/src/components/chat-ui/useChatUIControl.tsx +0 -7
- package/template/src/components/common/Error.tsx +6 -20
- package/template/src/components/common/Logo.tsx +15 -16
- package/template/src/components/contexts/LiveStreamDataContext.tsx +5 -10
- package/template/src/components/contexts/VideoMeetingDataContext.tsx +7 -37
- package/template/src/components/livestream/LiveStreamContext.tsx +36 -270
- package/template/src/components/livestream/Types.ts +14 -39
- package/template/src/components/livestream/index.ts +0 -1
- package/template/src/components/livestream/views/LiveStreamControls.tsx +4 -12
- package/template/src/components/participants/AllAudienceParticipants.tsx +30 -101
- package/template/src/components/participants/AllHostParticipants.tsx +34 -103
- package/template/src/components/participants/MeParticipant.tsx +38 -0
- package/template/src/components/participants/ParticipantName.tsx +7 -13
- package/template/src/components/participants/ParticipantSectionTitle.tsx +10 -35
- package/template/src/components/participants/RemoteParticipants.tsx +71 -0
- package/template/src/components/participants/ScreenshareParticipants.tsx +12 -144
- package/template/src/components/precall/{LocalMute1.native.tsx → LocalMute.native.tsx} +5 -21
- package/template/src/components/precall/LocalMute.tsx +14 -84
- package/template/src/components/precall/VideoPreview.native.tsx +3 -48
- package/template/src/components/precall/VideoPreview.tsx +7 -163
- package/template/src/components/precall/joinCallBtn.tsx +2 -15
- package/template/src/components/precall/meetingTitle.tsx +12 -15
- package/template/src/components/precall/selectDevice.tsx +21 -1
- package/template/src/components/precall/textInput.tsx +4 -32
- package/template/src/components/precall/usePreCall.tsx +0 -16
- package/template/src/components/styles.ts +21 -42
- package/template/src/components/useShareLink.tsx +14 -12
- package/template/src/language/default-labels/precallScreenLabels.ts +3 -3
- package/template/src/pages/Authenticate.tsx +15 -5
- package/template/src/pages/Create.tsx +165 -293
- package/template/src/pages/Join.tsx +67 -93
- package/template/src/pages/VideoCall.tsx +64 -89
- package/template/src/pages/video-call/DefaultLayouts.ts +4 -4
- package/template/src/pages/video-call/NameWithMicIcon.tsx +44 -120
- package/template/src/pages/video-call/RenderComponent.tsx +2 -3
- package/template/src/pages/video-call/VideoCallScreen.tsx +9 -45
- package/template/src/pages/video-call/VideoComponent.tsx +3 -18
- package/template/src/pages/video-call/VideoRenderer.tsx +60 -218
- package/template/src/rtm-events/constants.ts +0 -2
- package/template/src/subComponents/ChatBubble.tsx +83 -123
- package/template/src/subComponents/ChatContainer.tsx +84 -257
- package/template/src/subComponents/ChatInput.tsx +46 -61
- package/template/src/subComponents/Checkbox.native.tsx +5 -16
- package/template/src/subComponents/Checkbox.tsx +2 -2
- package/template/src/subComponents/CopyJoinInfo.tsx +58 -36
- package/template/src/subComponents/FallbackLogo.tsx +40 -122
- package/template/src/subComponents/LanguageSelector.tsx +1 -1
- package/template/src/subComponents/{LayoutIconDropdown1.native.tsx → LayoutIconDropdown.native.tsx} +18 -4
- package/template/src/subComponents/LayoutIconDropdown.tsx +134 -131
- package/template/src/subComponents/LocalAudioMute.tsx +27 -119
- package/template/src/subComponents/LocalEndCall.tsx +33 -71
- package/template/src/subComponents/LocalSwitchCamera.tsx +30 -17
- package/template/src/subComponents/LocalVideoMute.tsx +27 -117
- package/template/src/subComponents/Logo.tsx +4 -3
- package/template/src/subComponents/LogoutButton.tsx +1 -1
- package/template/src/subComponents/NetworkQualityPill.tsx +63 -60
- package/template/src/subComponents/OpenInNativeButton.tsx +3 -3
- package/template/src/subComponents/Recording.tsx +29 -28
- package/template/src/subComponents/RemoteAudioMute.tsx +29 -83
- package/template/src/subComponents/RemoteEndCall.tsx +5 -8
- package/template/src/subComponents/RemoteVideoMute.tsx +21 -74
- package/template/src/subComponents/ScreenShareNotice.tsx +8 -83
- package/template/src/subComponents/SelectDevice.tsx +61 -404
- package/template/src/subComponents/SelectOAuth.tsx +8 -9
- package/template/src/subComponents/ToastConfig.tsx +10 -150
- package/template/src/subComponents/chat/ChatParticipants.tsx +78 -187
- package/template/src/subComponents/livestream/CurrentLiveStreamRequestsView.tsx +32 -95
- package/template/src/subComponents/livestream/controls/LocalRaiseHand.tsx +33 -29
- package/template/src/subComponents/livestream/controls/RemoteLiveStreamApprovedRequestRecall.tsx +6 -6
- package/template/src/subComponents/livestream/controls/RemoteLiveStreamRequestApprove.tsx +11 -24
- package/template/src/subComponents/livestream/controls/RemoteLiveStreamRequestReject.tsx +10 -17
- package/template/src/subComponents/recording/useRecording.tsx +27 -79
- package/template/src/subComponents/screenshare/ScreenshareButton.tsx +70 -52
- package/template/src/subComponents/screenshare/ScreenshareConfigure.native.tsx +2 -11
- package/template/src/subComponents/screenshare/ScreenshareConfigure.tsx +4 -26
- package/template/src/utils/common.tsx +1 -155
- package/template/src/utils/index.tsx +0 -19
- package/template/src/utils/isMobileOrTablet.ts +2 -7
- package/template/src/utils/useButtonTemplate.tsx +0 -1
- package/template/src/utils/useMuteToggleLocal.ts +3 -54
- package/template/web/index.html +0 -5
- package/template/webpack.commons.js +8 -13
- package/template/webpack.web.config.js +0 -1
- package/template/agora-rn-uikit/src/Reducer/ActiveSpeakerDetected.ts +0 -11
- package/template/agora-rn-uikit/src/Reducer/LocalPermissionState.ts +0 -24
- package/template/agora-rn-uikit/src/Reducer/UserPin.ts +0 -11
- package/template/android/app/src/main/assets/fonts/SourceSansPro-Regular.ttf +0 -0
- package/template/android/app/src/main/assets/fonts/icomoon.ttf +0 -0
- package/template/android/app/src/main/res/values/colors.xml +0 -7
- package/template/react-native-toast-message/src/components/checkbox.js +0 -178
- package/template/react-native.config.js +0 -7
- package/template/src/assets/font-styles.css +0 -329
- package/template/src/assets/fonts/SourceSansPro-Regular.ttf +0 -0
- package/template/src/assets/fonts/icomoon.ttf +0 -0
- package/template/src/assets/permission.png +0 -0
- package/template/src/assets/selection.json +0 -1
- package/template/src/atoms/ActionMenu.tsx +0 -236
- package/template/src/atoms/AnimatedActiveSpeaker.native.tsx +0 -71
- package/template/src/atoms/AnimatedActiveSpeaker.tsx +0 -84
- package/template/src/atoms/AnimatedRings.native.tsx +0 -68
- package/template/src/atoms/AnimatedRings.tsx +0 -70
- package/template/src/atoms/Card.tsx +0 -61
- package/template/src/atoms/CircularProgress.native.tsx +0 -121
- package/template/src/atoms/CircularProgress.tsx +0 -102
- package/template/src/atoms/CustomIcon.tsx +0 -88
- package/template/src/atoms/CustomSwitch.tsx +0 -287
- package/template/src/atoms/Dropdown.tsx +0 -306
- package/template/src/atoms/IconButton.tsx +0 -162
- package/template/src/atoms/ImageIcon.tsx +0 -98
- package/template/src/atoms/InfoBubble.tsx +0 -291
- package/template/src/atoms/Input.tsx +0 -87
- package/template/src/atoms/InviteInfo.tsx +0 -166
- package/template/src/atoms/LinkButton.tsx +0 -28
- package/template/src/atoms/OutlineButton.tsx +0 -61
- package/template/src/atoms/ParticipantsCount.tsx +0 -73
- package/template/src/atoms/Popup.tsx +0 -147
- package/template/src/atoms/RecordingInfo.tsx +0 -49
- package/template/src/atoms/Spacer.tsx +0 -22
- package/template/src/atoms/TertiaryButton.tsx +0 -78
- package/template/src/atoms/Toggle.tsx +0 -47
- package/template/src/atoms/Tooltip.native.tsx +0 -65
- package/template/src/atoms/Tooltip.tsx +0 -94
- package/template/src/atoms/UserAvatar.tsx +0 -60
- package/template/src/components/CommonStyles.ts +0 -44
- package/template/src/components/ToastComponent.tsx +0 -8
- package/template/src/components/participants/Participant.tsx +0 -302
- package/template/src/components/participants/UserActionMenuOptions.tsx +0 -398
- package/template/src/components/popups/InvitePopup.tsx +0 -115
- package/template/src/components/popups/StopRecordingPopup.tsx +0 -114
- package/template/src/components/precall/PermissionHelper.native.tsx +0 -5
- package/template/src/components/precall/PermissionHelper.tsx +0 -126
- package/template/src/components/precall/PreCallSettings.tsx +0 -52
- package/template/src/components/useToast.tsx +0 -41
- package/template/src/components/useVideoCall.tsx +0 -65
- package/template/src/pages/Endcall.tsx +0 -148
- package/template/src/pages/video-call/ActionSheet.native.tsx +0 -215
- package/template/src/pages/video-call/ActionSheet.tsx +0 -226
- package/template/src/pages/video-call/ActionSheetContent.tsx +0 -479
- package/template/src/pages/video-call/ActionSheetHandle.tsx +0 -38
- package/template/src/pages/video-call/ActionSheetStyles.css +0 -138
- package/template/src/pages/video-call/SidePanelHeader.tsx +0 -190
- package/template/src/pages/video-call/VideoCallMobileView.tsx +0 -139
- package/template/src/pages/video-call/VideoCallScreen.native.tsx +0 -37
- package/template/src/subComponents/ChatInput.ios.tsx +0 -237
- package/template/src/subComponents/EndcallPopup.tsx +0 -107
- package/template/src/subComponents/LayoutIconButton.tsx +0 -201
- package/template/src/subComponents/RemoteMutePopup.tsx +0 -193
- package/template/src/subComponents/RemoveMeetingPopup.tsx +0 -109
- package/template/src/subComponents/RemoveScreensharePopup.tsx +0 -109
- package/template/src/subComponents/SelectDeviceSettings.backup.tsx +0 -207
- package/template/src/subComponents/SidePanelHeader.tsx +0 -112
- package/template/src/theme/index.ts +0 -46
- package/template/src/utils/PlatformWrapper.tsx +0 -21
- package/template/src/utils/hexadecimalTransparency.ts +0 -108
- package/template/src/utils/pendingStateUpdateHelper.ts +0 -19
- package/template/src/utils/useFocus.tsx +0 -46
- package/template/src/utils/useIsActiveSpeaker.ts +0 -27
- package/template/src/utils/useIsHandRaised.ts +0 -13
- package/template/src/utils/useRemoteEndScreenshare.ts +0 -26
- package/template/src/utils/useRemoteRequest.ts +0 -84
|
@@ -10,23 +10,11 @@
|
|
|
10
10
|
*********************************************
|
|
11
11
|
*/
|
|
12
12
|
import React, {createContext, ReactChildren, useEffect, useState} from 'react';
|
|
13
|
-
import AsyncStorage from '@react-native-
|
|
13
|
+
import AsyncStorage from '@react-native-community/async-storage';
|
|
14
14
|
import useMount from './useMount';
|
|
15
15
|
|
|
16
|
-
type rememberedDevicesListEntries = Record<
|
|
17
|
-
string,
|
|
18
|
-
'switch-on-connect' | 'ignore-on-connect'
|
|
19
|
-
>;
|
|
20
|
-
|
|
21
16
|
export interface StoreInterface {
|
|
22
|
-
|
|
23
|
-
displayName: string;
|
|
24
|
-
selectedLanguageCode: string;
|
|
25
|
-
rememberedDevicesList: Record<
|
|
26
|
-
MediaDeviceInfo['kind'],
|
|
27
|
-
rememberedDevicesListEntries
|
|
28
|
-
>;
|
|
29
|
-
activeDeviceId: Record<MediaDeviceInfo['kind'], string>;
|
|
17
|
+
[key: string]: string | null;
|
|
30
18
|
}
|
|
31
19
|
|
|
32
20
|
export interface StorageContextInterface {
|
|
@@ -38,16 +26,6 @@ export const initStoreValue: StoreInterface = {
|
|
|
38
26
|
token: null,
|
|
39
27
|
displayName: '',
|
|
40
28
|
selectedLanguageCode: '',
|
|
41
|
-
rememberedDevicesList: {
|
|
42
|
-
audioinput: {},
|
|
43
|
-
audiooutput: {},
|
|
44
|
-
videoinput: {},
|
|
45
|
-
},
|
|
46
|
-
activeDeviceId: {
|
|
47
|
-
audioinput: '',
|
|
48
|
-
audiooutput: '',
|
|
49
|
-
videoinput: '',
|
|
50
|
-
},
|
|
51
29
|
};
|
|
52
30
|
|
|
53
31
|
const initStorageContextValue = {
|
|
@@ -76,12 +54,7 @@ export const StorageProvider = (props: {children: React.ReactNode}) => {
|
|
|
76
54
|
await AsyncStorage.setItem('store', JSON.stringify(initStoreValue));
|
|
77
55
|
setReady(true);
|
|
78
56
|
} else {
|
|
79
|
-
|
|
80
|
-
Object.keys(initStoreValue).forEach((key) => {
|
|
81
|
-
if (!storeFromStorage[key])
|
|
82
|
-
storeFromStorage[key] = initStoreValue[key];
|
|
83
|
-
});
|
|
84
|
-
setStore(storeFromStorage);
|
|
57
|
+
setStore(JSON.parse(storeString));
|
|
85
58
|
setReady(true);
|
|
86
59
|
}
|
|
87
60
|
console.log('store hydrated', storeString);
|
|
@@ -11,9 +11,9 @@
|
|
|
11
11
|
*/
|
|
12
12
|
import {createHook} from 'customization-implementation';
|
|
13
13
|
import React, {useState, useEffect, useRef} from 'react';
|
|
14
|
-
import {useRender
|
|
14
|
+
import {useRender} from 'customization-api';
|
|
15
15
|
import {SidePanelType} from '../../subComponents/SidePanelEnum';
|
|
16
|
-
import {useLocalUid, UidType
|
|
16
|
+
import {useLocalUid, UidType} from '../../../agora-rn-uikit';
|
|
17
17
|
import events, {EventPersistLevel} from '../../rtm-events-api';
|
|
18
18
|
import {EventNames} from '../../rtm-events';
|
|
19
19
|
import {useChatUIControl} from '../chat-ui/useChatUIControl';
|
|
@@ -22,7 +22,6 @@ import Toast from '../../../react-native-toast-message';
|
|
|
22
22
|
import {timeNow} from '../../rtm/utils';
|
|
23
23
|
import {useSidePanel} from '../../utils/useSidePanel';
|
|
24
24
|
import getUniqueID from '../../utils/getUniqueID';
|
|
25
|
-
import {trimText} from '../../utils/common';
|
|
26
25
|
|
|
27
26
|
enum ChatMessageActionEnum {
|
|
28
27
|
Create = 'Create_Chat_Message',
|
|
@@ -50,7 +49,6 @@ interface ChatMessagesInterface {
|
|
|
50
49
|
sendChatMessage: (msg: string, toUid?: UidType) => void;
|
|
51
50
|
editChatMessage: (msgId: string, msg: string, toUid?: UidType) => void;
|
|
52
51
|
deleteChatMessage: (msgId: string, toUid?: UidType) => void;
|
|
53
|
-
openPrivateChat: (toUid: UidType) => void;
|
|
54
52
|
}
|
|
55
53
|
|
|
56
54
|
const ChatMessagesContext = React.createContext<ChatMessagesInterface>({
|
|
@@ -59,11 +57,9 @@ const ChatMessagesContext = React.createContext<ChatMessagesInterface>({
|
|
|
59
57
|
sendChatMessage: () => {},
|
|
60
58
|
editChatMessage: () => {},
|
|
61
59
|
deleteChatMessage: () => {},
|
|
62
|
-
openPrivateChat: () => {},
|
|
63
60
|
});
|
|
64
61
|
|
|
65
62
|
const ChatMessagesProvider = (props: ChatMessagesProviderProps) => {
|
|
66
|
-
const {dispatch} = useRtc();
|
|
67
63
|
const {renderList} = useRender();
|
|
68
64
|
const localUid = useLocalUid();
|
|
69
65
|
const {setSidePanel} = useSidePanel();
|
|
@@ -92,8 +88,7 @@ const ChatMessagesProvider = (props: ChatMessagesProviderProps) => {
|
|
|
92
88
|
|
|
93
89
|
//commented for v1 release
|
|
94
90
|
//const fromText = useString('messageSenderNotificationLabel');
|
|
95
|
-
const fromText = (name: string) =>
|
|
96
|
-
const privateMessageLabel = 'You’ve received a private message';
|
|
91
|
+
const fromText = (name: string) => `From : ${name}`;
|
|
97
92
|
useEffect(() => {
|
|
98
93
|
renderListRef.current.renderList = renderList;
|
|
99
94
|
}, [renderList]);
|
|
@@ -106,74 +101,42 @@ const ChatMessagesProvider = (props: ChatMessagesProviderProps) => {
|
|
|
106
101
|
individualActiveRef.current = selectedChatUserId;
|
|
107
102
|
}, [selectedChatUserId]);
|
|
108
103
|
|
|
109
|
-
const openPrivateChat = (uidAsNumber) => {
|
|
110
|
-
//move this logic into ChatContainer
|
|
111
|
-
// setUnreadPrivateMessageCount(
|
|
112
|
-
// unreadPrivateMessageCount -
|
|
113
|
-
// (unreadIndividualMessageCount[uidAsNumber] || 0),
|
|
114
|
-
// );
|
|
115
|
-
// setUnreadIndividualMessageCount((prevState) => {
|
|
116
|
-
// return {
|
|
117
|
-
// ...prevState,
|
|
118
|
-
// [uidAsNumber]: 0,
|
|
119
|
-
// };
|
|
120
|
-
// });
|
|
121
|
-
setGroupActive(false);
|
|
122
|
-
setSelectedChatUserId(uidAsNumber);
|
|
123
|
-
setPrivateActive(true);
|
|
124
|
-
setSidePanel(SidePanelType.Chat);
|
|
125
|
-
};
|
|
126
|
-
|
|
127
|
-
const updateRenderListState = (
|
|
128
|
-
uid: number,
|
|
129
|
-
data: Partial<RenderInterface>,
|
|
130
|
-
) => {
|
|
131
|
-
dispatch({type: 'UpdateRenderList', value: [uid, data]});
|
|
132
|
-
};
|
|
133
|
-
|
|
134
104
|
React.useEffect(() => {
|
|
135
105
|
const showMessageNotification = (
|
|
136
106
|
msg: string,
|
|
137
107
|
uid: string,
|
|
138
108
|
isPrivateMessage: boolean = false,
|
|
139
109
|
) => {
|
|
140
|
-
//don't show group message notification if group chat is open
|
|
141
|
-
if (!isPrivateMessage && groupActiveRef.current) {
|
|
142
|
-
return;
|
|
143
|
-
}
|
|
144
110
|
const uidAsNumber = parseInt(uid);
|
|
145
|
-
//don't show private message notification if private chat is open
|
|
146
|
-
if (isPrivateMessage && uidAsNumber === individualActiveRef.current) {
|
|
147
|
-
return;
|
|
148
|
-
}
|
|
149
111
|
Toast.show({
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
? privateMessageLabel
|
|
155
|
-
: renderListRef.current.renderList[uidAsNumber]?.name
|
|
156
|
-
? fromText(
|
|
157
|
-
trimText(renderListRef.current.renderList[uidAsNumber]?.name),
|
|
158
|
-
)
|
|
112
|
+
type: 'success',
|
|
113
|
+
text1: msg.length > 30 ? msg.slice(0, 30) + '...' : msg,
|
|
114
|
+
text2: renderListRef.current.renderList[uidAsNumber]?.name
|
|
115
|
+
? fromText(renderListRef.current.renderList[uidAsNumber]?.name)
|
|
159
116
|
: '',
|
|
160
|
-
|
|
161
|
-
? ''
|
|
162
|
-
: msg.length > 30
|
|
163
|
-
? msg.slice(0, 30) + '...'
|
|
164
|
-
: msg,
|
|
165
|
-
visibilityTime: 3000,
|
|
117
|
+
visibilityTime: 1000,
|
|
166
118
|
onPress: () => {
|
|
167
119
|
if (isPrivateMessage) {
|
|
168
|
-
|
|
120
|
+
setUnreadPrivateMessageCount(
|
|
121
|
+
unreadPrivateMessageCount -
|
|
122
|
+
(unreadIndividualMessageCount[uidAsNumber] || 0),
|
|
123
|
+
);
|
|
124
|
+
setUnreadIndividualMessageCount((prevState) => {
|
|
125
|
+
return {
|
|
126
|
+
...prevState,
|
|
127
|
+
[uidAsNumber]: 0,
|
|
128
|
+
};
|
|
129
|
+
});
|
|
130
|
+
setGroupActive(false);
|
|
131
|
+
setSelectedChatUserId(uidAsNumber);
|
|
132
|
+
setPrivateActive(true);
|
|
169
133
|
} else {
|
|
170
|
-
|
|
171
|
-
// setUnreadGroupMessageCount(0);
|
|
134
|
+
setUnreadGroupMessageCount(0);
|
|
172
135
|
setPrivateActive(false);
|
|
173
136
|
setSelectedChatUserId(0);
|
|
174
137
|
setGroupActive(true);
|
|
175
|
-
setSidePanel(SidePanelType.Chat);
|
|
176
138
|
}
|
|
139
|
+
setSidePanel(SidePanelType.Chat);
|
|
177
140
|
},
|
|
178
141
|
});
|
|
179
142
|
};
|
|
@@ -248,14 +211,6 @@ const ChatMessagesProvider = (props: ChatMessagesProviderProps) => {
|
|
|
248
211
|
const messageData = payload.value;
|
|
249
212
|
switch (messageAction) {
|
|
250
213
|
case ChatMessageActionEnum.Create:
|
|
251
|
-
//To order chat participant based on recent message
|
|
252
|
-
try {
|
|
253
|
-
updateRenderListState(data.sender, {
|
|
254
|
-
lastMessageTimeStamp: new Date().getTime(),
|
|
255
|
-
});
|
|
256
|
-
} catch (error) {
|
|
257
|
-
console.log("ERROR : couldn't update the last message timestamp");
|
|
258
|
-
}
|
|
259
214
|
showMessageNotification(messageData.msg, `${data.sender}`, true);
|
|
260
215
|
addMessageToPrivateStore(
|
|
261
216
|
data.sender,
|
|
@@ -559,7 +514,6 @@ const ChatMessagesProvider = (props: ChatMessagesProviderProps) => {
|
|
|
559
514
|
sendChatMessage,
|
|
560
515
|
editChatMessage,
|
|
561
516
|
deleteChatMessage,
|
|
562
|
-
openPrivateChat,
|
|
563
517
|
}}>
|
|
564
518
|
{props.children}
|
|
565
519
|
</ChatMessagesContext.Provider>
|
|
@@ -17,11 +17,9 @@ export interface ChatUIControlInterface {
|
|
|
17
17
|
groupActive: boolean;
|
|
18
18
|
privateActive: boolean;
|
|
19
19
|
selectedChatUserId: UidType;
|
|
20
|
-
inputActive?: boolean;
|
|
21
20
|
setGroupActive: React.Dispatch<SetStateAction<boolean>>;
|
|
22
21
|
setPrivateActive: React.Dispatch<SetStateAction<boolean>>;
|
|
23
22
|
setSelectedChatUserId: React.Dispatch<SetStateAction<UidType>>;
|
|
24
|
-
setInputActive: React.Dispatch<SetStateAction<boolean>>;
|
|
25
23
|
message: string;
|
|
26
24
|
setMessage: React.Dispatch<SetStateAction<string>>;
|
|
27
25
|
}
|
|
@@ -35,8 +33,6 @@ const ChatUIControlContext = React.createContext<ChatUIControlInterface>({
|
|
|
35
33
|
setPrivateActive: () => {},
|
|
36
34
|
setSelectedChatUserId: () => {},
|
|
37
35
|
setMessage: () => {},
|
|
38
|
-
inputActive: false,
|
|
39
|
-
setInputActive: () => {},
|
|
40
36
|
});
|
|
41
37
|
|
|
42
38
|
interface ChatUIControlProviderProps {
|
|
@@ -46,7 +42,6 @@ interface ChatUIControlProviderProps {
|
|
|
46
42
|
const ChatUIControlProvider = (props: ChatUIControlProviderProps) => {
|
|
47
43
|
const [groupActive, setGroupActive] = useState(false);
|
|
48
44
|
const [privateActive, setPrivateActive] = useState(false);
|
|
49
|
-
const [inputActive, setInputActive] = useState(false);
|
|
50
45
|
const [selectedChatUserId, setSelectedChatUserId] = useState<UidType>(0);
|
|
51
46
|
const [message, setMessage] = useState('');
|
|
52
47
|
return (
|
|
@@ -60,8 +55,6 @@ const ChatUIControlProvider = (props: ChatUIControlProviderProps) => {
|
|
|
60
55
|
setSelectedChatUserId,
|
|
61
56
|
message,
|
|
62
57
|
setMessage,
|
|
63
|
-
inputActive,
|
|
64
|
-
setInputActive,
|
|
65
58
|
}}>
|
|
66
59
|
{props.children}
|
|
67
60
|
</ChatUIControlContext.Provider>
|
|
@@ -10,8 +10,7 @@
|
|
|
10
10
|
*********************************************
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
import React, {useContext,
|
|
14
|
-
import Toast from '../../../react-native-toast-message';
|
|
13
|
+
import React, {useContext, useState} from 'react';
|
|
15
14
|
import Error from '../../subComponents/Error';
|
|
16
15
|
type ErrorType = {
|
|
17
16
|
name: string;
|
|
@@ -45,24 +44,11 @@ const ErrorProvider = (props: {children: React.ReactNode}) => {
|
|
|
45
44
|
|
|
46
45
|
const CommonError: React.FC = () => {
|
|
47
46
|
const {error} = useContext(ErrorContext);
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
text2: error.message,
|
|
54
|
-
visibilityTime: 1000 * 10,
|
|
55
|
-
primaryBtn: null,
|
|
56
|
-
secondaryBtn: null,
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
}, [error]);
|
|
60
|
-
return <></>;
|
|
61
|
-
// return error && (error.name || error.message) ? (
|
|
62
|
-
// <Error error={error} showBack={true} />
|
|
63
|
-
// ) : (
|
|
64
|
-
// <></>
|
|
65
|
-
// );
|
|
47
|
+
return error && (error.name || error.message) ? (
|
|
48
|
+
<Error error={error} showBack={true} />
|
|
49
|
+
) : (
|
|
50
|
+
<></>
|
|
51
|
+
);
|
|
66
52
|
};
|
|
67
53
|
export {ErrorContext, ErrorProvider};
|
|
68
54
|
export default CommonError;
|
|
@@ -11,27 +11,26 @@
|
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
13
|
import React from 'react';
|
|
14
|
-
import {
|
|
14
|
+
import {View, StyleSheet} from 'react-native';
|
|
15
|
+
import Logo from '../../subComponents/Logo';
|
|
15
16
|
import {useHasBrandLogo} from '../../utils/common';
|
|
16
|
-
const Logo: React.FC = () => {
|
|
17
|
-
const hasBrandLogo = useHasBrandLogo();
|
|
18
|
-
const hasLogo = hasBrandLogo();
|
|
19
|
-
if (!hasLogo) {
|
|
20
|
-
return null;
|
|
21
|
-
}
|
|
22
17
|
|
|
18
|
+
const CommonLogo: React.FC = () => {
|
|
19
|
+
const hasBrandLogo = useHasBrandLogo();
|
|
23
20
|
return (
|
|
24
|
-
<
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
/>
|
|
21
|
+
<View style={style.nav}>
|
|
22
|
+
{hasBrandLogo() && <Logo />}
|
|
23
|
+
{/* <OpenInNativeButton /> */}
|
|
24
|
+
</View>
|
|
29
25
|
);
|
|
30
26
|
};
|
|
31
|
-
export default
|
|
27
|
+
export default CommonLogo;
|
|
32
28
|
const style = StyleSheet.create({
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
29
|
+
nav: {
|
|
30
|
+
flex: 1,
|
|
31
|
+
width: '100%',
|
|
32
|
+
flexDirection: 'row',
|
|
33
|
+
alignItems: 'center',
|
|
34
|
+
justifyContent: 'center',
|
|
36
35
|
},
|
|
37
36
|
});
|
|
@@ -1,11 +1,5 @@
|
|
|
1
1
|
import {UidType} from '../../../agora-rn-uikit';
|
|
2
|
-
import React, {
|
|
3
|
-
createContext,
|
|
4
|
-
useState,
|
|
5
|
-
useContext,
|
|
6
|
-
useReducer,
|
|
7
|
-
useEffect,
|
|
8
|
-
} from 'react';
|
|
2
|
+
import React, {createContext, useState, useContext} from 'react';
|
|
9
3
|
import {createHook} from 'customization-implementation';
|
|
10
4
|
import LiveStreamContext, {
|
|
11
5
|
raiseHandListInterface,
|
|
@@ -46,8 +40,9 @@ const LiveStreamDataProvider = (props: ScreenShareProviderProps) => {
|
|
|
46
40
|
const hostList = filterObject(
|
|
47
41
|
renderList,
|
|
48
42
|
([k, v]) =>
|
|
49
|
-
(v?.type === 'rtc' ||
|
|
50
|
-
|
|
43
|
+
(v?.type === 'rtc' ||
|
|
44
|
+
v?.type === 'live' ||
|
|
45
|
+
(v?.type === 'screenshare' && v?.video == 1)) &&
|
|
51
46
|
(raiseHandList[k]
|
|
52
47
|
? raiseHandList[k]?.role == ClientRole.Broadcaster
|
|
53
48
|
: true) &&
|
|
@@ -72,7 +67,7 @@ const LiveStreamDataProvider = (props: ScreenShareProviderProps) => {
|
|
|
72
67
|
<LiveStreamDataContext.Provider
|
|
73
68
|
value={{
|
|
74
69
|
liveStreamData: raiseHandList,
|
|
75
|
-
hostUids
|
|
70
|
+
hostUids,
|
|
76
71
|
audienceUids,
|
|
77
72
|
}}>
|
|
78
73
|
{props.children}
|
|
@@ -1,18 +1,10 @@
|
|
|
1
|
-
import React, {
|
|
2
|
-
createContext,
|
|
3
|
-
useState,
|
|
4
|
-
useEffect,
|
|
5
|
-
useContext,
|
|
6
|
-
useReducer,
|
|
7
|
-
useRef,
|
|
8
|
-
} from 'react';
|
|
1
|
+
import React, {createContext, useState, useEffect, useContext} from 'react';
|
|
9
2
|
import {createHook} from 'customization-implementation';
|
|
10
3
|
import {UidType, useLocalUid} from '../../../agora-rn-uikit';
|
|
11
4
|
import {useMeetingInfo} from '../meeting-info/useMeetingInfo';
|
|
12
5
|
import events, {EventPersistLevel} from '../../rtm-events-api';
|
|
13
6
|
import {EventNames} from '../../rtm-events';
|
|
14
7
|
import ChatContext from '../ChatContext';
|
|
15
|
-
import {useRender} from 'customization-api';
|
|
16
8
|
|
|
17
9
|
export interface VideoMeetingDataInterface {
|
|
18
10
|
hostUids: UidType[];
|
|
@@ -30,22 +22,10 @@ const VideoMeetingDataProvider = (props: VideoMeetingDataProviderProps) => {
|
|
|
30
22
|
const {
|
|
31
23
|
data: {isHost},
|
|
32
24
|
} = useMeetingInfo();
|
|
33
|
-
const {activeUids} = useRender();
|
|
34
25
|
const {hasUserJoinedRTM} = useContext(ChatContext);
|
|
35
26
|
const localUid = useLocalUid();
|
|
36
27
|
const [hostUids, setHostUids] = useState<UidType[]>([]);
|
|
37
28
|
const [attendeeUids, setAttendeeUids] = useState<UidType[]>([]);
|
|
38
|
-
const [, forceUpdate] = useReducer((x) => x + 1, 0);
|
|
39
|
-
const hostUidsRef = useRef({hostUids});
|
|
40
|
-
const attendeeUidsRef = useRef({attendeeUids});
|
|
41
|
-
|
|
42
|
-
useEffect(() => {
|
|
43
|
-
hostUidsRef.current.hostUids = hostUids;
|
|
44
|
-
}, [hostUids]);
|
|
45
|
-
|
|
46
|
-
useEffect(() => {
|
|
47
|
-
attendeeUidsRef.current.attendeeUids = attendeeUids;
|
|
48
|
-
}, [attendeeUids]);
|
|
49
29
|
|
|
50
30
|
useEffect(() => {
|
|
51
31
|
//set local uid
|
|
@@ -56,8 +36,8 @@ const VideoMeetingDataProvider = (props: VideoMeetingDataProviderProps) => {
|
|
|
56
36
|
events.on(EventNames.VIDEO_MEETING_HOST, (data) => {
|
|
57
37
|
const payload = JSON.parse(data?.payload);
|
|
58
38
|
const hostUid = payload?.uid;
|
|
59
|
-
if (hostUid &&
|
|
60
|
-
setHostUids([...
|
|
39
|
+
if (hostUid && hostUids.indexOf(hostUid) === -1) {
|
|
40
|
+
setHostUids((prevState) => [...prevState, hostUid]);
|
|
61
41
|
}
|
|
62
42
|
});
|
|
63
43
|
|
|
@@ -65,14 +45,8 @@ const VideoMeetingDataProvider = (props: VideoMeetingDataProviderProps) => {
|
|
|
65
45
|
events.on(EventNames.VIDEO_MEETING_ATTENDEE, (data) => {
|
|
66
46
|
const payload = JSON.parse(data?.payload);
|
|
67
47
|
const attendeeUid = payload?.uid;
|
|
68
|
-
if (
|
|
69
|
-
attendeeUid
|
|
70
|
-
attendeeUidsRef?.current?.attendeeUids?.indexOf(attendeeUid) === -1
|
|
71
|
-
) {
|
|
72
|
-
setAttendeeUids([
|
|
73
|
-
...attendeeUidsRef?.current?.attendeeUids,
|
|
74
|
-
attendeeUid,
|
|
75
|
-
]);
|
|
48
|
+
if (attendeeUid && attendeeUids.indexOf(attendeeUid) === -1) {
|
|
49
|
+
setAttendeeUids((prevState) => [...prevState, attendeeUid]);
|
|
76
50
|
}
|
|
77
51
|
});
|
|
78
52
|
|
|
@@ -96,15 +70,11 @@ const VideoMeetingDataProvider = (props: VideoMeetingDataProviderProps) => {
|
|
|
96
70
|
}
|
|
97
71
|
}, [isHost, hasUserJoinedRTM]);
|
|
98
72
|
|
|
99
|
-
useEffect(() => {
|
|
100
|
-
forceUpdate();
|
|
101
|
-
}, [activeUids]);
|
|
102
|
-
|
|
103
73
|
return (
|
|
104
74
|
<VideoMeetingData.Provider
|
|
105
75
|
value={{
|
|
106
|
-
hostUids
|
|
107
|
-
attendeeUids
|
|
76
|
+
hostUids,
|
|
77
|
+
attendeeUids,
|
|
108
78
|
}}>
|
|
109
79
|
{props.children}
|
|
110
80
|
</VideoMeetingData.Provider>
|