agora-appbuilder-core 3.0.8 → 4.0.0-api.0
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 +6 -0
- package/package.json +2 -2
- package/template/_package-lock.json +32828 -2777
- package/template/agora-rn-uikit/src/AgoraUIKit.tsx +6 -6
- package/template/agora-rn-uikit/src/Contexts/ContentContext.tsx +10 -0
- package/template/agora-rn-uikit/src/Contexts/DispatchContext.tsx +22 -0
- package/template/agora-rn-uikit/src/Contexts/LocalUserContext.tsx +10 -6
- package/template/agora-rn-uikit/src/Contexts/PropsContext.tsx +28 -8
- package/template/agora-rn-uikit/src/Contexts/RtcContext.tsx +7 -15
- package/template/agora-rn-uikit/src/Controls/BtnTemplate.tsx +30 -26
- package/template/agora-rn-uikit/src/Controls/Icons.ts +30 -83
- package/template/agora-rn-uikit/src/Controls/ImageIcon.tsx +6 -6
- package/template/agora-rn-uikit/src/Controls/Local/LocalAudioMute.tsx +4 -2
- package/template/agora-rn-uikit/src/Controls/Local/LocalVideoMute.tsx +4 -2
- package/template/agora-rn-uikit/src/Controls/Local/Recording.tsx +0 -2
- package/template/agora-rn-uikit/src/Controls/Local/SwitchCamera.tsx +6 -6
- package/template/agora-rn-uikit/src/Controls/LocalControls.tsx +5 -5
- package/template/agora-rn-uikit/src/Controls/Remote/RemoteAudioMute.tsx +4 -4
- package/template/agora-rn-uikit/src/Controls/Remote/RemoteVideoMute.tsx +4 -4
- package/template/agora-rn-uikit/src/Controls/RemoteControls.tsx +2 -2
- package/template/agora-rn-uikit/src/Reducer/LocalMuteAudio.ts +6 -6
- package/template/agora-rn-uikit/src/Reducer/LocalMuteVideo.ts +6 -6
- package/template/agora-rn-uikit/src/Reducer/LocalPermissionState.ts +23 -0
- package/template/agora-rn-uikit/src/Reducer/RemoteAudioStateChanged.ts +6 -6
- package/template/agora-rn-uikit/src/Reducer/RemoteVideoStateChanged.ts +7 -7
- package/template/agora-rn-uikit/src/Reducer/UpdateDualStreamMode.ts +7 -7
- package/template/agora-rn-uikit/src/Reducer/UserJoined.ts +10 -10
- package/template/agora-rn-uikit/src/Reducer/UserMuteRemoteAudio.ts +6 -6
- package/template/agora-rn-uikit/src/Reducer/UserMuteRemoteVideo.ts +6 -6
- package/template/agora-rn-uikit/src/Reducer/UserOffline.ts +5 -5
- package/template/agora-rn-uikit/src/Reducer/UserPin.ts +11 -0
- package/template/agora-rn-uikit/src/Reducer/index.ts +2 -0
- package/template/agora-rn-uikit/src/Rtc/Create.tsx +74 -7
- package/template/agora-rn-uikit/src/Rtc/Join.tsx +5 -4
- package/template/agora-rn-uikit/src/RtcConfigure.tsx +76 -49
- package/template/agora-rn-uikit/src/Views/MaxVideoView.native.tsx +17 -7
- package/template/agora-rn-uikit/src/Views/MaxVideoView.tsx +17 -11
- package/template/agora-rn-uikit/src/Views/MinVideoView.tsx +2 -2
- package/template/agora-rn-uikit/src/index.ts +17 -9
- package/template/android/app/build.gradle +1 -0
- package/template/android/app/src/main/AndroidManifest.xml +22 -15
- 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/java/com/helloworld/MainActivity.java +50 -0
- package/template/android/app/src/main/res/values/colors.xml +7 -0
- package/template/android/build.gradle +3 -3
- package/template/babel.config.js +1 -0
- package/template/bridge/rtc/webNg/RtcEngine.ts +110 -17
- package/template/customization-api/action-library.ts +10 -14
- package/template/customization-api/app-state.ts +4 -6
- package/template/customization-api/customEvents.ts +2 -2
- package/template/customization-api/customize.ts +1 -1
- package/template/customization-api/sub-components.ts +4 -12
- package/template/customization-api/typeDefinition.ts +15 -38
- package/template/customization-implementation/createHook.ts +24 -6
- package/template/customization-implementation/index.ts +1 -1
- package/template/customization-implementation/useCustomization.tsx +5 -7
- package/template/electron/index.html +27 -27
- package/template/electron/renderer/index.js +1 -0
- package/template/global.d.ts +26 -4
- package/template/index.rsdk.tsx +1 -0
- package/template/index.web.js +2 -1
- package/template/index.wsdk.tsx +9 -2
- package/template/ios/HelloWorld/Info.plist +14 -1
- package/template/ios/HelloWorld.xcodeproj/project.pbxproj +17 -0
- package/template/metro.config.js +1 -1
- package/template/package.json +18 -7
- package/template/react-native-toast-message/index.d.ts +43 -43
- package/template/react-native-toast-message/src/colors/index.js +3 -2
- package/template/react-native-toast-message/src/components/base/index.js +46 -59
- package/template/react-native-toast-message/src/components/base/styles.js +16 -32
- package/template/react-native-toast-message/src/components/checkbox.js +178 -0
- package/template/react-native-toast-message/src/components/error.js +3 -2
- package/template/react-native-toast-message/src/components/info.js +3 -2
- package/template/react-native-toast-message/src/components/success.js +3 -2
- package/template/react-native-toast-message/src/index.js +122 -31
- package/template/react-native-toast-message/src/index.sdk.tsx +125 -35
- package/template/react-native-toast-message/src/styles.js +3 -4
- package/template/react-native-toast-message/src/styles.sdk.ts +3 -4
- package/template/react-native.config.js +7 -0
- package/template/src/App.tsx +19 -14
- package/template/src/AppWrapper.tsx +74 -29
- package/template/src/SDKAppWrapper.tsx +60 -64
- package/template/src/app-state/useLocalUserInfo.ts +3 -3
- package/template/src/assets/font-styles.css +329 -0
- 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 +1 -0
- package/template/src/atoms/ActionMenu.tsx +236 -0
- package/template/src/atoms/AnimatedActiveSpeaker.native.tsx +71 -0
- package/template/src/atoms/AnimatedActiveSpeaker.tsx +84 -0
- package/template/src/atoms/AnimatedRings.native.tsx +68 -0
- package/template/src/atoms/AnimatedRings.tsx +70 -0
- package/template/src/atoms/Card.tsx +61 -0
- package/template/src/atoms/CircularProgress.native.tsx +121 -0
- package/template/src/atoms/CircularProgress.tsx +102 -0
- package/template/src/atoms/CustomIcon.tsx +88 -0
- package/template/src/atoms/CustomSwitch.tsx +287 -0
- package/template/src/atoms/Dropdown.tsx +306 -0
- package/template/src/atoms/HorizontalRule.tsx +3 -1
- package/template/src/atoms/IconButton.tsx +162 -0
- package/template/src/atoms/ImageIcon.tsx +98 -0
- package/template/src/atoms/InfoBubble.tsx +291 -0
- package/template/src/atoms/Input.tsx +87 -0
- package/template/src/atoms/InviteInfo.tsx +166 -0
- package/template/src/atoms/LinkButton.tsx +28 -0
- package/template/src/atoms/OutlineButton.tsx +61 -0
- package/template/src/atoms/ParticipantsCount.tsx +74 -0
- package/template/src/atoms/Popup.tsx +147 -0
- package/template/src/atoms/PrimaryButton.tsx +51 -26
- package/template/src/atoms/RecordingInfo.tsx +52 -0
- package/template/src/atoms/SecondaryButton.tsx +8 -5
- package/template/src/atoms/Spacer.tsx +22 -0
- package/template/src/atoms/TertiaryButton.tsx +78 -0
- package/template/src/atoms/TextInput.tsx +12 -14
- package/template/src/atoms/Toggle.tsx +47 -0
- package/template/src/atoms/Toolbar.tsx +68 -0
- package/template/src/atoms/ToolbarItem.tsx +63 -0
- package/template/src/atoms/Tooltip.native.tsx +65 -0
- package/template/src/atoms/Tooltip.tsx +94 -0
- package/template/src/atoms/UserAvatar.tsx +60 -0
- package/template/src/components/Chat.tsx +164 -278
- package/template/src/components/ChatContext.ts +8 -1
- package/template/src/components/ColorConfigure.tsx +1 -1
- package/template/src/components/ColorContext.ts +1 -1
- package/template/src/components/CommonStyles.ts +44 -0
- package/template/src/components/Controls.tsx +331 -73
- package/template/src/components/{Controls.native.tsx → Controls1.native.tsx} +8 -6
- package/template/src/components/DeviceConfigure.tsx +511 -102
- package/template/src/components/DeviceContext.tsx +8 -4
- package/template/src/components/EventsConfigure.tsx +192 -10
- package/template/src/components/GraphQLProvider.tsx +1 -1
- package/template/src/components/GridVideo.tsx +60 -45
- package/template/src/components/HostControlView.tsx +114 -35
- package/template/src/components/Navbar.tsx +219 -437
- package/template/src/components/Navigation.tsx +15 -1
- package/template/src/components/NetworkQualityContext.tsx +22 -22
- package/template/src/components/ParticipantsView.tsx +178 -156
- package/template/src/components/PinnedVideo.tsx +206 -121
- package/template/src/components/Precall.native.tsx +358 -119
- package/template/src/components/Precall.tsx +272 -138
- package/template/src/components/RTMConfigure.tsx +66 -19
- package/template/src/components/Router.electron.ts +1 -0
- package/template/src/components/Router.native.ts +1 -0
- package/template/src/components/Router.sdk.ts +1 -0
- package/template/src/components/Router.ts +1 -0
- package/template/src/components/SdkApiContext.tsx +161 -0
- package/template/src/components/Settings.tsx +26 -95
- package/template/src/components/SettingsView.tsx +251 -56
- package/template/src/components/Share.tsx +305 -276
- package/template/src/components/StorageContext.tsx +30 -3
- package/template/src/components/ToastComponent.tsx +8 -0
- package/template/src/components/chat-messages/useChatMessages.tsx +97 -50
- package/template/src/components/chat-ui/useChatUIControls.tsx +76 -0
- package/template/src/components/common/Error.tsx +20 -6
- package/template/src/components/common/Logo.tsx +16 -15
- package/template/src/components/contexts/LiveStreamDataContext.tsx +16 -11
- package/template/src/components/contexts/VideoMeetingDataContext.tsx +41 -11
- package/template/src/components/contexts/WhiteboardContext.tsx +3 -3
- package/template/src/components/livestream/LiveStreamContext.tsx +284 -50
- package/template/src/components/livestream/Types.ts +39 -14
- package/template/src/components/livestream/index.ts +1 -0
- package/template/src/components/livestream/views/LiveStreamControls.tsx +9 -4
- package/template/src/components/participants/AllAudienceParticipants.tsx +102 -31
- package/template/src/components/participants/AllHostParticipants.tsx +106 -35
- package/template/src/components/participants/Participant.tsx +300 -0
- package/template/src/components/participants/ParticipantName.tsx +13 -7
- package/template/src/components/participants/ParticipantSectionTitle.tsx +35 -10
- package/template/src/components/participants/ScreenshareParticipants.tsx +144 -12
- package/template/src/components/participants/UserActionMenuOptions.tsx +396 -0
- package/template/src/components/popups/InvitePopup.tsx +115 -0
- package/template/src/components/popups/StopRecordingPopup.tsx +114 -0
- package/template/src/components/precall/LocalMute.tsx +84 -14
- package/template/src/components/precall/{LocalMute.native.tsx → LocalMute1.native.tsx} +21 -5
- package/template/src/components/precall/PermissionHelper.native.tsx +5 -0
- package/template/src/components/precall/PermissionHelper.tsx +126 -0
- package/template/src/components/precall/PreCallSettings.tsx +52 -0
- package/template/src/components/precall/VideoPreview.native.tsx +51 -6
- package/template/src/components/precall/VideoPreview.tsx +164 -8
- package/template/src/components/precall/joinCallBtn.native.tsx +2 -2
- package/template/src/components/precall/joinCallBtn.tsx +17 -4
- package/template/src/components/precall/meetingTitle.tsx +17 -14
- package/template/src/components/precall/selectDevice.tsx +1 -21
- package/template/src/components/precall/textInput.tsx +34 -6
- package/template/src/components/precall/usePreCall.tsx +39 -1
- package/template/src/components/{meeting-info/useMeetingInfo.tsx → room-info/useRoomInfo.tsx} +34 -10
- package/template/src/components/{meeting-info/useSetMeetingInfo.tsx → room-info/useSetRoomInfo.tsx} +12 -12
- package/template/src/components/styles.ts +42 -21
- package/template/src/components/useShareLink.tsx +19 -21
- package/template/src/components/useToast.tsx +41 -0
- package/template/src/components/useUserPreference.tsx +9 -6
- package/template/src/components/useVideoCall.tsx +84 -0
- package/template/src/language/default-labels/createScreenLabels.ts +3 -3
- package/template/src/language/default-labels/joinScreenLabels.ts +2 -2
- package/template/src/language/default-labels/precallScreenLabels.ts +3 -3
- package/template/src/language/default-labels/shareLinkScreenLabels.ts +5 -5
- package/template/src/language/default-labels/videoCallScreenLabels.ts +5 -5
- package/template/src/pages/Authenticate.tsx +5 -15
- package/template/src/pages/Create.tsx +304 -191
- package/template/src/pages/Endcall.tsx +148 -0
- package/template/src/pages/Join.tsx +96 -70
- package/template/src/pages/VideoCall.tsx +179 -69
- package/template/src/pages/video-call/ActionSheet.native.tsx +215 -0
- package/template/src/pages/video-call/ActionSheet.tsx +226 -0
- package/template/src/pages/video-call/ActionSheetContent.tsx +479 -0
- package/template/src/pages/video-call/ActionSheetHandle.tsx +38 -0
- package/template/src/pages/video-call/ActionSheetStyles.css +138 -0
- package/template/src/pages/video-call/DefaultLayouts.ts +6 -6
- package/template/src/pages/video-call/NameWithMicIcon.tsx +93 -49
- package/template/src/pages/video-call/RenderComponent.tsx +6 -30
- package/template/src/pages/video-call/SidePanelHeader.tsx +186 -0
- package/template/src/pages/video-call/VideoCallMobileView.tsx +138 -0
- package/template/src/pages/video-call/VideoCallScreen.native.tsx +37 -0
- package/template/src/pages/video-call/VideoCallScreen.tsx +109 -66
- package/template/src/pages/video-call/VideoComponent.tsx +20 -4
- package/template/src/pages/video-call/VideoRenderer.tsx +227 -61
- package/template/src/pages/video-call/index.ts +35 -7
- package/template/src/rtm/RTMEngine.ts +8 -0
- package/template/src/rtm-events/constants.ts +3 -1
- package/template/src/rtm-events-api/Events.ts +5 -4
- package/template/src/rtm-events-api/LocalEvents.ts +6 -0
- package/template/src/rtm-events-api/types.ts +5 -5
- package/template/src/subComponents/ChatBubble.tsx +125 -84
- package/template/src/subComponents/ChatContainer.tsx +280 -93
- package/template/src/subComponents/ChatInput.ios.tsx +175 -0
- package/template/src/subComponents/ChatInput.tsx +72 -115
- package/template/src/subComponents/Checkbox.native.tsx +16 -5
- package/template/src/subComponents/Checkbox.tsx +2 -2
- package/template/src/subComponents/CopyJoinInfo.tsx +36 -58
- package/template/src/subComponents/EndcallPopup.tsx +107 -0
- package/template/src/subComponents/FallbackLogo.tsx +122 -40
- package/template/src/subComponents/LanguageSelector.tsx +1 -1
- package/template/src/subComponents/LayoutIconButton.tsx +201 -0
- package/template/src/subComponents/LayoutIconDropdown.tsx +131 -134
- package/template/src/subComponents/{LayoutIconDropdown.native.tsx → LayoutIconDropdown1.native.tsx} +4 -18
- package/template/src/subComponents/LocalAudioMute.tsx +119 -27
- package/template/src/subComponents/LocalEndCall.tsx +73 -35
- package/template/src/subComponents/LocalSwitchCamera.tsx +19 -32
- package/template/src/subComponents/LocalVideoMute.tsx +117 -27
- package/template/src/subComponents/Logo.tsx +3 -4
- package/template/src/subComponents/LogoutButton.tsx +1 -1
- package/template/src/subComponents/NetworkQualityPill.tsx +66 -68
- package/template/src/subComponents/OpenInNativeButton.tsx +3 -3
- package/template/src/subComponents/Recording.tsx +28 -29
- package/template/src/subComponents/RemoteAudioMute.tsx +83 -29
- package/template/src/subComponents/RemoteEndCall.tsx +8 -5
- package/template/src/subComponents/RemoteMutePopup.tsx +193 -0
- package/template/src/subComponents/RemoteVideoMute.tsx +74 -21
- package/template/src/subComponents/RemoveMeetingPopup.tsx +109 -0
- package/template/src/subComponents/RemoveScreensharePopup.tsx +109 -0
- package/template/src/subComponents/ScreenShareNotice.tsx +83 -8
- package/template/src/subComponents/SelectDevice.tsx +404 -61
- package/template/src/subComponents/SelectDeviceSettings.backup.tsx +207 -0
- package/template/src/subComponents/SelectOAuth.tsx +9 -8
- package/template/src/subComponents/SidePanelButtons.ts +0 -3
- package/template/src/subComponents/SidePanelHeader.tsx +112 -0
- package/template/src/subComponents/ToastConfig.tsx +150 -10
- package/template/src/subComponents/chat/ChatParticipants.tsx +188 -79
- package/template/src/subComponents/livestream/CurrentLiveStreamRequestsView.tsx +97 -34
- package/template/src/subComponents/livestream/controls/LocalRaiseHand.tsx +29 -33
- package/template/src/subComponents/livestream/controls/RemoteLiveStreamApprovedRequestRecall.tsx +8 -8
- package/template/src/subComponents/livestream/controls/RemoteLiveStreamRequestApprove.tsx +24 -11
- package/template/src/subComponents/livestream/controls/RemoteLiveStreamRequestReject.tsx +17 -10
- package/template/src/subComponents/recording/useRecording.tsx +81 -29
- package/template/src/subComponents/screenshare/ScreenshareButton.tsx +52 -70
- package/template/src/subComponents/screenshare/ScreenshareConfigure.native.tsx +23 -12
- package/template/src/subComponents/screenshare/ScreenshareConfigure.tsx +44 -19
- package/template/src/theme/index.ts +46 -0
- package/template/src/utils/PlatformWrapper.tsx +21 -0
- package/template/src/utils/SdkEvents.ts +23 -14
- package/template/src/utils/SdkMethodEvents.ts +81 -0
- package/template/src/utils/common.tsx +155 -1
- package/template/src/utils/hexadecimalTransparency.ts +108 -0
- package/template/src/utils/index.tsx +19 -0
- package/template/src/utils/isMobileOrTablet.ts +7 -2
- package/template/src/utils/pendingStateUpdateHelper.ts +19 -0
- package/template/src/utils/useActiveSpeaker.ts +42 -0
- package/template/src/utils/{useCreateMeeting.ts → useCreateRoom.ts} +19 -14
- package/template/src/utils/{useButtonTemplate.tsx → useFocus.tsx} +19 -16
- package/template/src/utils/useGetMeetingPhrase.ts +10 -10
- package/template/src/utils/useIsAudioEnabled.ts +3 -3
- package/template/src/utils/useIsHandRaised.ts +13 -0
- package/template/src/utils/useIsPSTN.ts +3 -3
- package/template/src/utils/useIsVideoEnabled.ts +3 -3
- package/template/src/utils/{useJoinMeeting.ts → useJoinRoom.ts} +27 -21
- package/template/src/utils/useMutePSTN.ts +2 -2
- package/template/src/utils/useMuteToggleLocal.ts +58 -5
- package/template/src/utils/useRemoteEndCall.ts +4 -4
- package/template/src/utils/useRemoteEndScreenshare.ts +26 -0
- package/template/src/utils/useRemoteMute.ts +7 -7
- package/template/src/utils/useRemoteRequest.ts +84 -0
- package/template/src/utils/useSwitchCamera.native.tsx +25 -0
- package/template/src/utils/useSwitchCamera.tsx +19 -0
- package/template/src/utils/useToolbar.tsx +59 -0
- package/template/web/index.html +5 -0
- package/template/webpack.commons.js +13 -8
- package/template/webpack.rsdk.config.js +1 -2
- package/template/webpack.web.config.js +1 -0
- package/template/agora-rn-uikit/.git/HEAD +0 -1
- package/template/agora-rn-uikit/.git/config +0 -16
- package/template/agora-rn-uikit/.git/description +0 -1
- package/template/agora-rn-uikit/.git/hooks/applypatch-msg.sample +0 -15
- package/template/agora-rn-uikit/.git/hooks/commit-msg.sample +0 -24
- package/template/agora-rn-uikit/.git/hooks/fsmonitor-watchman.sample +0 -174
- package/template/agora-rn-uikit/.git/hooks/post-update.sample +0 -8
- package/template/agora-rn-uikit/.git/hooks/pre-applypatch.sample +0 -14
- package/template/agora-rn-uikit/.git/hooks/pre-commit.sample +0 -49
- package/template/agora-rn-uikit/.git/hooks/pre-merge-commit.sample +0 -13
- package/template/agora-rn-uikit/.git/hooks/pre-push.sample +0 -53
- package/template/agora-rn-uikit/.git/hooks/pre-rebase.sample +0 -169
- package/template/agora-rn-uikit/.git/hooks/pre-receive.sample +0 -24
- package/template/agora-rn-uikit/.git/hooks/prepare-commit-msg.sample +0 -42
- package/template/agora-rn-uikit/.git/hooks/push-to-checkout.sample +0 -78
- package/template/agora-rn-uikit/.git/hooks/update.sample +0 -128
- package/template/agora-rn-uikit/.git/index +0 -0
- package/template/agora-rn-uikit/.git/info/exclude +0 -6
- package/template/agora-rn-uikit/.git/logs/HEAD +0 -2
- package/template/agora-rn-uikit/.git/logs/refs/heads/master +0 -1
- package/template/agora-rn-uikit/.git/logs/refs/heads/release/fpe-1.0.1 +0 -1
- package/template/agora-rn-uikit/.git/logs/refs/remotes/origin/HEAD +0 -1
- package/template/agora-rn-uikit/.git/objects/pack/pack-baa9cf4109c3e8528f39535764621cee252b2b77.idx +0 -0
- package/template/agora-rn-uikit/.git/objects/pack/pack-baa9cf4109c3e8528f39535764621cee252b2b77.pack +0 -0
- package/template/agora-rn-uikit/.git/packed-refs +0 -49
- package/template/agora-rn-uikit/.git/refs/heads/master +0 -1
- package/template/agora-rn-uikit/.git/refs/heads/release/fpe-1.0.1 +0 -1
- package/template/agora-rn-uikit/.git/refs/remotes/origin/HEAD +0 -1
- package/template/agora-rn-uikit/.gitignore +0 -63
- package/template/agora-rn-uikit/package-lock.json +0 -7612
- package/template/agora-rn-uikit/src/Contexts/RenderContext.tsx +0 -10
- package/template/package-lock.json +0 -22543
- package/template/react-native-toast-message/.gitignore +0 -5
- package/template/react-native-toast-message/.npmignore +0 -5
- package/template/react-native-toast-message/package-lock.json +0 -10553
- package/template/src/.DS_Store +0 -0
- package/template/src/assets/icons.ts +0 -102
- package/template/src/components/chat-ui/useChatUIControl.tsx +0 -69
- package/template/src/components/participants/MeParticipant.tsx +0 -38
- package/template/src/components/participants/RemoteParticipants.tsx +0 -71
- package/template/src/pages/video-call/CustomUserContextHolder.tsx +0 -20
- package/template/src/subComponents/.DS_Store +0 -0
|
@@ -10,66 +10,71 @@
|
|
|
10
10
|
*********************************************
|
|
11
11
|
*/
|
|
12
12
|
import React, {useContext, useState} from 'react';
|
|
13
|
-
import {
|
|
14
|
-
|
|
13
|
+
import {
|
|
14
|
+
View,
|
|
15
|
+
Text,
|
|
16
|
+
StyleSheet,
|
|
17
|
+
TextStyle,
|
|
18
|
+
useWindowDimensions,
|
|
19
|
+
} from 'react-native';
|
|
15
20
|
import Settings, {
|
|
16
21
|
SettingsWithViewWrapper,
|
|
17
22
|
SettingsIconButtonProps,
|
|
18
23
|
} from './Settings';
|
|
19
24
|
import CopyJoinInfo, {CopyJoinInfoProps} from '../subComponents/CopyJoinInfo';
|
|
20
25
|
import {SidePanelType} from '../subComponents/SidePanelEnum';
|
|
21
|
-
import {navHolder} from '../../theme.json';
|
|
22
26
|
import ChatContext from '../components/ChatContext';
|
|
23
27
|
import isMobileOrTablet from '../utils/isMobileOrTablet';
|
|
24
|
-
import {
|
|
25
|
-
BtnTemplate,
|
|
26
|
-
BtnTemplateInterface,
|
|
27
|
-
ImageIcon,
|
|
28
|
-
} from '../../agora-rn-uikit';
|
|
29
28
|
import LiveStreamContext from './livestream';
|
|
30
29
|
import {numFormatter} from '../utils/index';
|
|
31
30
|
import {useLayout} from '../utils/useLayout';
|
|
32
31
|
import {useChatNotification} from '../components/chat-notification/useChatNotification';
|
|
33
32
|
import useLayoutsData from '../pages/video-call/useLayoutsData';
|
|
34
33
|
import {
|
|
34
|
+
BREAKPOINTS,
|
|
35
35
|
isAndroid,
|
|
36
36
|
isIOS,
|
|
37
|
+
isMobileUA,
|
|
37
38
|
isValidReactComponent,
|
|
38
39
|
isWebInternal,
|
|
40
|
+
trimText,
|
|
41
|
+
useIsDesktop,
|
|
39
42
|
} from '../utils/common';
|
|
40
43
|
import {useChangeDefaultLayout} from '../pages/video-call/DefaultLayouts';
|
|
41
44
|
import {useRecording} from '../subComponents/recording/useRecording';
|
|
42
45
|
import LayoutIconDropdown from '../subComponents/LayoutIconDropdown';
|
|
43
|
-
import DimensionContext from './dimension/DimensionContext';
|
|
44
46
|
import {useString} from '../utils/useString';
|
|
45
|
-
import {
|
|
47
|
+
import {useRoomInfo} from './room-info/useRoomInfo';
|
|
46
48
|
import {useSidePanel} from '../utils/useSidePanel';
|
|
47
|
-
import {
|
|
48
|
-
import
|
|
49
|
-
|
|
50
|
-
useButtonTemplate,
|
|
51
|
-
} from '../utils/useButtonTemplate';
|
|
49
|
+
import {ChatType, useChatUIControls} from './chat-ui/useChatUIControls';
|
|
50
|
+
import LayoutIconButton from '../subComponents/LayoutIconButton';
|
|
51
|
+
import {ToolbarPosition, useToolbar} from '../utils/useToolbar';
|
|
52
52
|
import Styles from './styles';
|
|
53
|
+
import IconButton, {IconButtonProps} from '../atoms/IconButton';
|
|
54
|
+
import ThemeConfig from '../theme';
|
|
55
|
+
import hexadecimalTransparency from '../utils/hexadecimalTransparency';
|
|
56
|
+
import Spacer from '../atoms/Spacer';
|
|
57
|
+
import {useLiveStreamDataContext} from './contexts/LiveStreamDataContext';
|
|
58
|
+
import ParticipantsCount from '../atoms/ParticipantsCount';
|
|
59
|
+
import styles from 'react-native-toast-message/src/styles';
|
|
60
|
+
import RecordingInfo from '../atoms/RecordingInfo';
|
|
61
|
+
import Toolbar from '../atoms/Toolbar';
|
|
62
|
+
import ToolbarItem from '../atoms/ToolbarItem';
|
|
53
63
|
|
|
54
|
-
const
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
<View style={style.navItemSeparator}></View>
|
|
60
|
-
</View>
|
|
61
|
-
) : (
|
|
62
|
-
<View style={{marginHorizontal: 2}}></View>
|
|
63
|
-
);
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
const ParticipantsCountView = () => {
|
|
64
|
+
export const ParticipantsCountView = ({
|
|
65
|
+
isMobileView = false,
|
|
66
|
+
}: {
|
|
67
|
+
isMobileView?: boolean;
|
|
68
|
+
}) => {
|
|
67
69
|
const {onlineUsersCount} = useContext(ChatContext);
|
|
68
|
-
|
|
69
|
-
|
|
70
|
+
return isMobileView ? (
|
|
71
|
+
<Text>
|
|
72
|
+
People {'\n'} ({numFormatter(onlineUsersCount)})
|
|
73
|
+
</Text>
|
|
74
|
+
) : (
|
|
70
75
|
<>
|
|
71
76
|
{onlineUsersCount !== 0 && (
|
|
72
|
-
<View style={[
|
|
77
|
+
<View style={[{justifyContent: 'center'}]}>
|
|
73
78
|
<View style={style.chip}>
|
|
74
79
|
{onlineUsersCount > 0 && (
|
|
75
80
|
<Text style={style.chipText}>
|
|
@@ -83,61 +88,68 @@ const ParticipantsCountView = () => {
|
|
|
83
88
|
);
|
|
84
89
|
};
|
|
85
90
|
|
|
86
|
-
interface ParticipantsIconButtonProps {
|
|
91
|
+
export interface ParticipantsIconButtonProps {
|
|
87
92
|
liveStreamingRequestAlertIconPosition?: {
|
|
88
93
|
top?: number;
|
|
89
94
|
right?: number;
|
|
90
95
|
left?: number;
|
|
91
96
|
bottom?: number;
|
|
92
97
|
};
|
|
93
|
-
|
|
94
|
-
render?: (
|
|
95
|
-
onPress: () => void,
|
|
96
|
-
isPanelActive: boolean,
|
|
97
|
-
buttonTemplateName?: ButtonTemplateName,
|
|
98
|
-
) => JSX.Element;
|
|
98
|
+
isOnActionSheet?: boolean;
|
|
99
|
+
render?: (onPress: () => void, isPanelActive: boolean) => JSX.Element;
|
|
99
100
|
}
|
|
100
|
-
const ParticipantsIconButton = (props: ParticipantsIconButtonProps) => {
|
|
101
|
+
export const ParticipantsIconButton = (props: ParticipantsIconButtonProps) => {
|
|
101
102
|
const {
|
|
102
103
|
liveStreamingRequestAlertIconPosition = {
|
|
103
|
-
top:
|
|
104
|
+
top: 0,
|
|
105
|
+
right: 0,
|
|
104
106
|
left: undefined,
|
|
105
|
-
right: undefined,
|
|
106
107
|
bottom: undefined,
|
|
107
108
|
},
|
|
109
|
+
isOnActionSheet = false,
|
|
108
110
|
} = props;
|
|
109
111
|
const {sidePanel, setSidePanel} = useSidePanel();
|
|
110
112
|
const {isPendingRequestToReview, setLastCheckedRequestTimestamp} =
|
|
111
113
|
useContext(LiveStreamContext);
|
|
112
114
|
//commented for v1 release
|
|
113
115
|
//const participantsLabel = useString('participantsLabel')();
|
|
114
|
-
const
|
|
115
|
-
const
|
|
116
|
-
const
|
|
116
|
+
const {onlineUsersCount} = useContext(ChatContext);
|
|
117
|
+
//const participantsLabel = `Participants (${numFormatter(onlineUsersCount)})`;
|
|
118
|
+
const participantsLabel = `People`;
|
|
117
119
|
const isPanelActive = sidePanel === SidePanelType.Participants;
|
|
120
|
+
|
|
118
121
|
const onPress = () => {
|
|
119
122
|
isPanelActive
|
|
120
123
|
? setSidePanel(SidePanelType.None)
|
|
121
124
|
: setSidePanel(SidePanelType.Participants);
|
|
122
|
-
$config.EVENT_MODE && $config.RAISE_HAND;
|
|
123
|
-
setLastCheckedRequestTimestamp(new Date().getTime());
|
|
125
|
+
// $config.EVENT_MODE && $config.RAISE_HAND;
|
|
126
|
+
//setLastCheckedRequestTimestamp(new Date().getTime());
|
|
124
127
|
};
|
|
125
|
-
let
|
|
128
|
+
let iconButtonProps: IconButtonProps = {
|
|
126
129
|
onPress: onPress,
|
|
127
|
-
|
|
130
|
+
iconProps: {
|
|
131
|
+
name: 'participants',
|
|
132
|
+
tintColor: isPanelActive
|
|
133
|
+
? $config.PRIMARY_ACTION_TEXT_COLOR
|
|
134
|
+
: $config.SECONDARY_ACTION_COLOR,
|
|
135
|
+
iconBackgroundColor: isPanelActive
|
|
136
|
+
? $config.PRIMARY_ACTION_BRAND_COLOR
|
|
137
|
+
: '',
|
|
138
|
+
},
|
|
139
|
+
btnTextProps: {
|
|
140
|
+
text: isOnActionSheet || !$config.ICON_TEXT ? '' : participantsLabel,
|
|
141
|
+
textColor: $config.FONT_COLOR,
|
|
142
|
+
},
|
|
128
143
|
};
|
|
144
|
+
iconButtonProps.isOnActionSheet = isOnActionSheet;
|
|
129
145
|
|
|
130
|
-
if (buttonTemplateName === ButtonTemplateName.bottomBar) {
|
|
131
|
-
btnTemplateProps.btnText = participantsLabel;
|
|
132
|
-
btnTemplateProps.style = Styles.localButtonWithoutBG as Object;
|
|
133
|
-
} else {
|
|
134
|
-
btnTemplateProps.style = style.btnHolder;
|
|
135
|
-
}
|
|
136
146
|
return props?.render ? (
|
|
137
|
-
props.render(onPress, isPanelActive
|
|
147
|
+
props.render(onPress, isPanelActive)
|
|
138
148
|
) : (
|
|
139
149
|
<>
|
|
140
|
-
<
|
|
150
|
+
<View>
|
|
151
|
+
<IconButton {...iconButtonProps} />
|
|
152
|
+
</View>
|
|
141
153
|
{$config.EVENT_MODE && $config.RAISE_HAND && isPendingRequestToReview && (
|
|
142
154
|
<View
|
|
143
155
|
style={{
|
|
@@ -146,20 +158,17 @@ const ParticipantsIconButton = (props: ParticipantsIconButtonProps) => {
|
|
|
146
158
|
bottom: liveStreamingRequestAlertIconPosition.bottom,
|
|
147
159
|
right: liveStreamingRequestAlertIconPosition.right,
|
|
148
160
|
left: liveStreamingRequestAlertIconPosition.left,
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
/>
|
|
155
|
-
</View>
|
|
156
|
-
</View>
|
|
161
|
+
backgroundColor: $config.SEMANTIC_ERROR,
|
|
162
|
+
width: 12,
|
|
163
|
+
height: 12,
|
|
164
|
+
borderRadius: 10,
|
|
165
|
+
}}></View>
|
|
157
166
|
)}
|
|
158
167
|
</>
|
|
159
168
|
);
|
|
160
169
|
};
|
|
161
170
|
|
|
162
|
-
interface ChatIconButtonProps {
|
|
171
|
+
export interface ChatIconButtonProps {
|
|
163
172
|
badgeContainerPosition?: {
|
|
164
173
|
top?: number;
|
|
165
174
|
right?: number;
|
|
@@ -167,61 +176,97 @@ interface ChatIconButtonProps {
|
|
|
167
176
|
bottom?: number;
|
|
168
177
|
};
|
|
169
178
|
badgeTextStyle?: TextStyle;
|
|
170
|
-
buttonTemplateName?: ButtonTemplateName;
|
|
171
179
|
render?: (
|
|
172
180
|
onPress: () => void,
|
|
173
181
|
isPanelActive: boolean,
|
|
174
182
|
totalUnreadCount: number,
|
|
175
|
-
buttonTemplateName?: ButtonTemplateName,
|
|
176
183
|
) => JSX.Element;
|
|
184
|
+
isMobileView?: boolean;
|
|
185
|
+
isOnActionSheet?: boolean;
|
|
177
186
|
}
|
|
178
187
|
|
|
179
|
-
const ChatIconButton = (props: ChatIconButtonProps) => {
|
|
188
|
+
export const ChatIconButton = (props: ChatIconButtonProps) => {
|
|
189
|
+
const {sidePanel, setSidePanel} = useSidePanel();
|
|
180
190
|
const {
|
|
181
191
|
badgeContainerPosition = {
|
|
182
|
-
top:
|
|
192
|
+
top: 0,
|
|
193
|
+
right: 0,
|
|
183
194
|
left: undefined,
|
|
184
|
-
right: undefined,
|
|
185
195
|
bottom: undefined,
|
|
196
|
+
zIndex: 999,
|
|
186
197
|
},
|
|
187
198
|
badgeTextStyle = {
|
|
188
|
-
color: $config.
|
|
199
|
+
color: $config.PRIMARY_ACTION_TEXT_COLOR,
|
|
189
200
|
fontSize: 12,
|
|
201
|
+
textAlign: 'center',
|
|
190
202
|
},
|
|
203
|
+
isOnActionSheet = false,
|
|
191
204
|
} = props;
|
|
192
205
|
const {setUnreadGroupMessageCount, totalUnreadCount} = useChatNotification();
|
|
193
|
-
const {
|
|
194
|
-
|
|
195
|
-
const {sidePanel, setSidePanel} = useSidePanel();
|
|
206
|
+
const {setChatType, setPrivateChatUser} = useChatUIControls();
|
|
207
|
+
|
|
196
208
|
//commented for v1 release
|
|
197
209
|
//const chatLabel = useString('chatLabel')();
|
|
198
210
|
const chatLabel = 'Chat';
|
|
199
|
-
const defaultTemplateValue = useButtonTemplate().buttonTemplateName;
|
|
200
|
-
const {buttonTemplateName = defaultTemplateValue} = props;
|
|
201
211
|
const isPanelActive = sidePanel === SidePanelType.Chat;
|
|
202
212
|
const onPress = () => {
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
213
|
+
{
|
|
214
|
+
if (isPanelActive) {
|
|
215
|
+
setSidePanel(SidePanelType.None);
|
|
216
|
+
setChatType(ChatType.Group);
|
|
217
|
+
setPrivateChatUser(0);
|
|
218
|
+
} else {
|
|
219
|
+
//move this logic into ChatContainer
|
|
220
|
+
//setUnreadGroupMessageCount(0);
|
|
221
|
+
setChatType(ChatType.Group);
|
|
222
|
+
setSidePanel(SidePanelType.Chat);
|
|
223
|
+
}
|
|
212
224
|
}
|
|
213
225
|
};
|
|
214
|
-
let
|
|
226
|
+
let iconButtonProps: IconButtonProps = {
|
|
215
227
|
onPress: onPress,
|
|
216
|
-
|
|
228
|
+
iconProps: {
|
|
229
|
+
name: 'chat-nav',
|
|
230
|
+
tintColor: isPanelActive
|
|
231
|
+
? $config.PRIMARY_ACTION_TEXT_COLOR
|
|
232
|
+
: $config.SECONDARY_ACTION_COLOR,
|
|
233
|
+
iconBackgroundColor: isPanelActive
|
|
234
|
+
? $config.PRIMARY_ACTION_BRAND_COLOR
|
|
235
|
+
: '',
|
|
236
|
+
},
|
|
237
|
+
btnTextProps: {
|
|
238
|
+
text: isOnActionSheet || !$config.ICON_TEXT ? '' : chatLabel,
|
|
239
|
+
textColor: $config.FONT_COLOR,
|
|
240
|
+
},
|
|
217
241
|
};
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
242
|
+
|
|
243
|
+
iconButtonProps.isOnActionSheet = isOnActionSheet;
|
|
244
|
+
|
|
245
|
+
// const renderBadgeOld = (badgeCount: any) => {
|
|
246
|
+
// return (
|
|
247
|
+
// <View
|
|
248
|
+
// style={{
|
|
249
|
+
// position: 'absolute',
|
|
250
|
+
// top: badgeContainerPosition?.top,
|
|
251
|
+
// bottom: badgeContainerPosition?.bottom,
|
|
252
|
+
// left: badgeContainerPosition?.left,
|
|
253
|
+
// right: badgeContainerPosition?.right,
|
|
254
|
+
// borderRadius: 10,
|
|
255
|
+
// width: 20,
|
|
256
|
+
// height: 20,
|
|
257
|
+
// backgroundColor: $config.PRIMARY_ACTION_BRAND_COLOR,
|
|
258
|
+
// justifyContent: 'center',
|
|
259
|
+
// }}>
|
|
260
|
+
// <Text
|
|
261
|
+
// style={{
|
|
262
|
+
// ...badgeTextStyle,
|
|
263
|
+
// }}>
|
|
264
|
+
// {numFormatter(badgeCount)}
|
|
265
|
+
// </Text>
|
|
266
|
+
// </View>
|
|
267
|
+
// );
|
|
268
|
+
// };
|
|
269
|
+
const renderUnreadMessageIndicator = () => {
|
|
225
270
|
return (
|
|
226
271
|
<View
|
|
227
272
|
style={{
|
|
@@ -230,26 +275,21 @@ const ChatIconButton = (props: ChatIconButtonProps) => {
|
|
|
230
275
|
bottom: badgeContainerPosition?.bottom,
|
|
231
276
|
left: badgeContainerPosition?.left,
|
|
232
277
|
right: badgeContainerPosition?.right,
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
}}>
|
|
239
|
-
{numFormatter(badgeCount)}
|
|
240
|
-
</Text>
|
|
241
|
-
</View>
|
|
242
|
-
</View>
|
|
278
|
+
borderRadius: 10,
|
|
279
|
+
width: 12,
|
|
280
|
+
height: 12,
|
|
281
|
+
backgroundColor: $config.SEMANTIC_ERROR,
|
|
282
|
+
}}></View>
|
|
243
283
|
);
|
|
244
284
|
};
|
|
245
285
|
return props?.render ? (
|
|
246
|
-
props.render(onPress, isPanelActive, totalUnreadCount
|
|
286
|
+
props.render(onPress, isPanelActive, totalUnreadCount)
|
|
247
287
|
) : (
|
|
248
288
|
<>
|
|
249
|
-
<
|
|
250
|
-
|
|
251
|
-
totalUnreadCount !== 0 &&
|
|
252
|
-
|
|
289
|
+
<View>
|
|
290
|
+
<IconButton {...iconButtonProps} />
|
|
291
|
+
{totalUnreadCount !== 0 && renderUnreadMessageIndicator()}
|
|
292
|
+
</View>
|
|
253
293
|
</>
|
|
254
294
|
);
|
|
255
295
|
};
|
|
@@ -261,90 +301,11 @@ interface LayoutIconButtonProps {
|
|
|
261
301
|
left?: number;
|
|
262
302
|
bottom?: number;
|
|
263
303
|
};
|
|
264
|
-
buttonTemplateName?: ButtonTemplateName;
|
|
265
|
-
render?: (
|
|
266
|
-
onPress: () => void,
|
|
267
|
-
buttonTemplateName?: ButtonTemplateName,
|
|
268
|
-
) => JSX.Element;
|
|
269
|
-
}
|
|
270
304
|
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
//commented for v1 release
|
|
275
|
-
//const layoutLabel = useString('layoutLabel')('');
|
|
276
|
-
const layoutLabel = 'Layouts';
|
|
277
|
-
const defaultTemplateValue = useButtonTemplate().buttonTemplateName;
|
|
278
|
-
const {buttonTemplateName = defaultTemplateValue} = props;
|
|
279
|
-
const [showDropdown, setShowDropdown] = useState(false);
|
|
280
|
-
const layouts = useLayoutsData();
|
|
281
|
-
const changeLayout = useChangeDefaultLayout();
|
|
282
|
-
const {currentLayout} = useLayout();
|
|
283
|
-
const layout = layouts.findIndex((item) => item.name === currentLayout);
|
|
284
|
-
const renderLayoutIcon = (showDropdown?: boolean) => {
|
|
285
|
-
let onPress = () => {};
|
|
286
|
-
let renderContent = [];
|
|
287
|
-
if (!showDropdown) {
|
|
288
|
-
onPress = () => {
|
|
289
|
-
changeLayout();
|
|
290
|
-
};
|
|
291
|
-
} else {
|
|
292
|
-
onPress = () => {
|
|
293
|
-
setShowDropdown(true);
|
|
294
|
-
};
|
|
295
|
-
}
|
|
296
|
-
let btnTemplateProps = {
|
|
297
|
-
onPress: onPress,
|
|
298
|
-
style: {},
|
|
299
|
-
btnText: '',
|
|
300
|
-
};
|
|
301
|
-
if (buttonTemplateName === ButtonTemplateName.bottomBar) {
|
|
302
|
-
btnTemplateProps.style = Styles.localButtonWithoutBG as Object;
|
|
303
|
-
btnTemplateProps.btnText = layoutLabel;
|
|
304
|
-
} else {
|
|
305
|
-
btnTemplateProps.style = style.btnHolder;
|
|
306
|
-
delete btnTemplateProps['btnText'];
|
|
307
|
-
}
|
|
308
|
-
renderContent.push(
|
|
309
|
-
props?.render ? (
|
|
310
|
-
props.render(onPress, buttonTemplateName)
|
|
311
|
-
) : layouts[layout]?.iconName ? (
|
|
312
|
-
<BtnTemplate
|
|
313
|
-
key={'defaultLayoutIconWithName'}
|
|
314
|
-
name={layouts[layout]?.iconName}
|
|
315
|
-
{...btnTemplateProps}
|
|
316
|
-
/>
|
|
317
|
-
) : (
|
|
318
|
-
<BtnTemplate
|
|
319
|
-
key={'defaultLayoutIconWithIcon'}
|
|
320
|
-
icon={layouts[layout]?.icon}
|
|
321
|
-
{...btnTemplateProps}
|
|
322
|
-
/>
|
|
323
|
-
),
|
|
324
|
-
);
|
|
325
|
-
return renderContent;
|
|
326
|
-
};
|
|
327
|
-
return (
|
|
328
|
-
<>
|
|
329
|
-
{/**
|
|
330
|
-
* Based on the flag. it will render the dropdown
|
|
331
|
-
*/}
|
|
332
|
-
<LayoutIconDropdown
|
|
333
|
-
showDropdown={showDropdown}
|
|
334
|
-
setShowDropdown={setShowDropdown}
|
|
335
|
-
modalPosition={modalPosition}
|
|
336
|
-
/>
|
|
337
|
-
{/**
|
|
338
|
-
* If layout contains more than 2 data. it will render the dropdown.
|
|
339
|
-
*/}
|
|
340
|
-
{layouts && Array.isArray(layouts) && layouts.length > 2
|
|
341
|
-
? renderLayoutIcon(true)
|
|
342
|
-
: renderLayoutIcon(false)}
|
|
343
|
-
</>
|
|
344
|
-
);
|
|
345
|
-
};
|
|
305
|
+
render?: (onPress: () => void) => JSX.Element;
|
|
306
|
+
}
|
|
346
307
|
|
|
347
|
-
const SettingsIconButton = (props: SettingsIconButtonProps) => {
|
|
308
|
+
export const SettingsIconButton = (props: SettingsIconButtonProps) => {
|
|
348
309
|
return <Settings {...props} />;
|
|
349
310
|
};
|
|
350
311
|
const SettingsIconButtonWithWrapper = (props: SettingsIconButtonProps) => {
|
|
@@ -354,216 +315,89 @@ const SettingsIconButtonWithWrapper = (props: SettingsIconButtonProps) => {
|
|
|
354
315
|
const Navbar = () => {
|
|
355
316
|
//commented for v1 release
|
|
356
317
|
//const recordingLabel = useString('recordingLabel')();
|
|
318
|
+
const {isHorizontal} = useToolbar();
|
|
357
319
|
const recordingLabel = 'Recording';
|
|
320
|
+
const {audienceUids, hostUids} = useLiveStreamDataContext();
|
|
358
321
|
const {
|
|
359
322
|
data: {meetingTitle},
|
|
360
|
-
} =
|
|
323
|
+
} = useRoomInfo();
|
|
361
324
|
|
|
362
325
|
const {isRecordingActive} = useRecording();
|
|
363
|
-
const {
|
|
364
|
-
const {
|
|
365
|
-
const layoutsData = useLayoutsData();
|
|
366
|
-
const isNative = isIOS() || isAndroid();
|
|
367
|
-
|
|
326
|
+
const {onlineUsersCount} = useContext(ChatContext);
|
|
327
|
+
const {width} = useWindowDimensions();
|
|
368
328
|
return (
|
|
369
|
-
<
|
|
370
|
-
style={[
|
|
371
|
-
isWebInternal() ? style.navHolder : style.navHolderNative,
|
|
372
|
-
{backgroundColor: $config.SECONDARY_FONT_COLOR + 80},
|
|
373
|
-
isWebInternal()
|
|
374
|
-
? {
|
|
375
|
-
justifyContent: isMobileOrTablet() ? 'space-between' : 'flex-end',
|
|
376
|
-
}
|
|
377
|
-
: {},
|
|
378
|
-
]}>
|
|
379
|
-
{isRecordingActive ? (
|
|
380
|
-
<View
|
|
381
|
-
style={[
|
|
382
|
-
style.recordingView,
|
|
383
|
-
{backgroundColor: $config.SECONDARY_FONT_COLOR},
|
|
384
|
-
]}>
|
|
385
|
-
<ImageIcon
|
|
386
|
-
name={'recordingActiveIcon'}
|
|
387
|
-
style={{
|
|
388
|
-
width: 20,
|
|
389
|
-
height: 20,
|
|
390
|
-
margin: 1,
|
|
391
|
-
}}
|
|
392
|
-
color="#FD0845"
|
|
393
|
-
/>
|
|
394
|
-
{!isMobileOrTablet() && (
|
|
395
|
-
<Text
|
|
396
|
-
style={{
|
|
397
|
-
fontSize: isWebInternal() ? 16 : 12,
|
|
398
|
-
color: '#FD0845',
|
|
399
|
-
fontWeight: '400',
|
|
400
|
-
alignSelf: 'center',
|
|
401
|
-
textAlign: 'center',
|
|
402
|
-
flex: 1,
|
|
403
|
-
}}>
|
|
404
|
-
{recordingLabel}
|
|
405
|
-
</Text>
|
|
406
|
-
)}
|
|
407
|
-
</View>
|
|
408
|
-
) : (
|
|
409
|
-
<></>
|
|
410
|
-
)}
|
|
329
|
+
<Toolbar>
|
|
411
330
|
<View
|
|
412
331
|
style={[
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
? {transform: [{translateX: '50%'}]}
|
|
417
|
-
: {},
|
|
332
|
+
isHorizontal
|
|
333
|
+
? {flexDirection: 'row'}
|
|
334
|
+
: {flexDirection: 'column', justifyContent: 'center'},
|
|
418
335
|
]}>
|
|
419
|
-
|
|
420
|
-
<
|
|
421
|
-
style={
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
}
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
<View
|
|
437
|
-
style={{
|
|
438
|
-
backgroundColor: $config.PRIMARY_FONT_COLOR + '80',
|
|
439
|
-
width: 1,
|
|
440
|
-
height: 'auto',
|
|
441
|
-
marginHorizontal: 10,
|
|
442
|
-
}}
|
|
336
|
+
<ToolbarItem>
|
|
337
|
+
<Text
|
|
338
|
+
style={style.roomNameText}
|
|
339
|
+
testID="videocall-meetingName"
|
|
340
|
+
numberOfLines={1}
|
|
341
|
+
ellipsizeMode="tail">
|
|
342
|
+
{trimText(meetingTitle)}
|
|
343
|
+
</Text>
|
|
344
|
+
</ToolbarItem>
|
|
345
|
+
{/* <Spacer size={8} horizontal={isHorizontal ? true : false} /> */}
|
|
346
|
+
<ToolbarItem>
|
|
347
|
+
<ParticipantsCount />
|
|
348
|
+
</ToolbarItem>
|
|
349
|
+
{!isRecordingActive ? (
|
|
350
|
+
<ToolbarItem>
|
|
351
|
+
<RecordingInfo
|
|
352
|
+
recordingLabel={isHorizontal ? recordingLabel : ''}
|
|
443
353
|
/>
|
|
444
|
-
|
|
445
|
-
<CopyJoinInfo />
|
|
446
|
-
</View>
|
|
447
|
-
</View>
|
|
354
|
+
</ToolbarItem>
|
|
448
355
|
) : (
|
|
449
|
-
|
|
450
|
-
<Text style={style.roomNameText}>
|
|
451
|
-
{meetingTitle.length > 13
|
|
452
|
-
? meetingTitle.slice(0, 13) + '..'
|
|
453
|
-
: meetingTitle}
|
|
454
|
-
</Text>
|
|
455
|
-
</View>
|
|
356
|
+
<></>
|
|
456
357
|
)}
|
|
457
358
|
</View>
|
|
458
|
-
|
|
359
|
+
{width > BREAKPOINTS.sm || isMobileUA() ? (
|
|
459
360
|
<View
|
|
460
361
|
style={[
|
|
461
|
-
style.
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
layoutsData && layoutsData.length === 1 && isNative
|
|
469
|
-
? 130
|
|
470
|
-
: 160
|
|
471
|
-
: 200,
|
|
472
|
-
},
|
|
473
|
-
]}>
|
|
474
|
-
<ParticipantsCountView />
|
|
475
|
-
<View style={[style.navItem, style.navSmItem]}>
|
|
362
|
+
style.navControlBar,
|
|
363
|
+
isHorizontal
|
|
364
|
+
? {flexDirection: 'row', width: '50%'}
|
|
365
|
+
: {flexDirection: 'column'},
|
|
366
|
+
]}
|
|
367
|
+
testID="videocall-navcontrols">
|
|
368
|
+
<ToolbarItem testID="videocall-participantsicon">
|
|
476
369
|
<ParticipantsIconButton />
|
|
477
|
-
</
|
|
478
|
-
{$config.CHAT
|
|
370
|
+
</ToolbarItem>
|
|
371
|
+
{$config.CHAT && (
|
|
479
372
|
<>
|
|
480
|
-
<
|
|
481
|
-
<View style={[style.navItem, style.navSmItem]}>
|
|
373
|
+
<ToolbarItem testID="videocall-chaticon">
|
|
482
374
|
<ChatIconButton />
|
|
483
|
-
</
|
|
484
|
-
</>
|
|
485
|
-
) : (
|
|
486
|
-
<></>
|
|
487
|
-
)}
|
|
488
|
-
{/**
|
|
489
|
-
* In custom-layout - show the layout icon if more than 1 layout provided otherwise hide it from the ui
|
|
490
|
-
*/}
|
|
491
|
-
{layoutsData && layoutsData.length > 1 && (
|
|
492
|
-
<>
|
|
493
|
-
<RenderSeparator />
|
|
494
|
-
<View
|
|
495
|
-
style={[style.navItem, style.navSmItem]}
|
|
496
|
-
/**
|
|
497
|
-
* .measure returns undefined on Android unless collapsable=false or onLayout are specified
|
|
498
|
-
* so added collapsable property
|
|
499
|
-
* https://github.com/facebook/react-native/issues/29712
|
|
500
|
-
* */
|
|
501
|
-
collapsable={false}>
|
|
502
|
-
<LayoutIconButton />
|
|
503
|
-
</View>
|
|
375
|
+
</ToolbarItem>
|
|
504
376
|
</>
|
|
505
377
|
)}
|
|
506
|
-
<
|
|
507
|
-
|
|
378
|
+
<ToolbarItem testID="videocall-settingsicon">
|
|
379
|
+
<SettingsIconButtonWithWrapper />
|
|
380
|
+
</ToolbarItem>
|
|
508
381
|
</View>
|
|
509
|
-
|
|
510
|
-
|
|
382
|
+
) : (
|
|
383
|
+
<></>
|
|
384
|
+
)}
|
|
385
|
+
</Toolbar>
|
|
511
386
|
);
|
|
512
387
|
};
|
|
513
|
-
type NavBarComponentsArrayProps = [
|
|
514
|
-
(props: CopyJoinInfoProps) => JSX.Element,
|
|
515
|
-
() => JSX.Element,
|
|
516
|
-
(props: ParticipantsIconButtonProps) => JSX.Element,
|
|
517
|
-
(props: ChatIconButtonProps) => JSX.Element,
|
|
518
|
-
(props: LayoutIconButtonProps) => JSX.Element,
|
|
519
|
-
(props: SettingsIconButtonProps) => JSX.Element,
|
|
520
|
-
];
|
|
521
|
-
export const NavBarComponentsArray: NavBarComponentsArrayProps = [
|
|
522
|
-
CopyJoinInfo,
|
|
523
|
-
ParticipantsCountView,
|
|
524
|
-
ParticipantsIconButton,
|
|
525
|
-
ChatIconButton,
|
|
526
|
-
LayoutIconButton,
|
|
527
|
-
SettingsIconButton,
|
|
528
|
-
];
|
|
529
388
|
|
|
530
389
|
const style = StyleSheet.create({
|
|
531
|
-
|
|
532
|
-
position: 'absolute',
|
|
533
|
-
top: 0,
|
|
534
|
-
bottom: 0,
|
|
535
|
-
left: 0,
|
|
536
|
-
right: 0,
|
|
537
|
-
backgroundColor: 'rgba(0,0,0,0.3)',
|
|
538
|
-
},
|
|
539
|
-
navHolder: navHolder as ViewStyle,
|
|
540
|
-
navHolderNative: {
|
|
541
|
-
position: 'relative',
|
|
542
|
-
width: '100%',
|
|
543
|
-
height: '8%',
|
|
544
|
-
backgroundColor: $config.SECONDARY_FONT_COLOR + '80',
|
|
545
|
-
flexDirection: 'row',
|
|
546
|
-
alignItems: 'center',
|
|
547
|
-
paddingHorizontal: 10,
|
|
548
|
-
justifyContent: 'space-between',
|
|
549
|
-
},
|
|
550
|
-
recordingView: {
|
|
551
|
-
height: 35,
|
|
552
|
-
maxHeight: 30,
|
|
553
|
-
position: 'absolute',
|
|
554
|
-
left: isMobileOrTablet() ? '48%' : 10,
|
|
555
|
-
paddingHorizontal: 5,
|
|
390
|
+
participantCountView: {
|
|
556
391
|
flexDirection: 'row',
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
width:
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
resizeMode: 'contain',
|
|
392
|
+
padding: 12,
|
|
393
|
+
backgroundColor: $config.ICON_BG_COLOR,
|
|
394
|
+
borderRadius: 25,
|
|
395
|
+
borderWidth: 1,
|
|
396
|
+
borderColor: $config.CARD_LAYER_3_COLOR,
|
|
397
|
+
shadowColor: $config.HARD_CODED_BLACK_COLOR,
|
|
398
|
+
shadowOffset: {width: 0, height: 4},
|
|
399
|
+
shadowOpacity: 0.1,
|
|
400
|
+
shadowRadius: 20,
|
|
567
401
|
},
|
|
568
402
|
btnHolder: {
|
|
569
403
|
marginHorizontal: isMobileOrTablet() ? 2 : 0,
|
|
@@ -577,38 +411,21 @@ const style = StyleSheet.create({
|
|
|
577
411
|
resizeMode: 'contain',
|
|
578
412
|
},
|
|
579
413
|
roomNameContainer: {
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
height: 35,
|
|
583
|
-
maxHeight: 30,
|
|
414
|
+
zIndex: 10,
|
|
415
|
+
flex: 1,
|
|
584
416
|
flexDirection: 'row',
|
|
585
|
-
justifyContent: 'flex-end',
|
|
586
417
|
alignItems: 'center',
|
|
587
|
-
zIndex: 10,
|
|
588
418
|
},
|
|
419
|
+
|
|
589
420
|
roomNameText: {
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
lineHeight: 1,
|
|
596
|
-
height: 20,
|
|
597
|
-
minWidth: 20,
|
|
598
|
-
display: 'flex',
|
|
599
|
-
alignItems: 'center',
|
|
600
|
-
justifyContent: 'center',
|
|
601
|
-
backgroundColor: $config.PRIMARY_COLOR,
|
|
602
|
-
color: $config.SECONDARY_FONT_COLOR,
|
|
603
|
-
fontFamily: isIOS() ? 'Helvetica' : 'sans-serif',
|
|
604
|
-
borderRadius: 10,
|
|
605
|
-
position: 'absolute',
|
|
606
|
-
paddingHorizontal: 5,
|
|
607
|
-
top: 0,
|
|
608
|
-
left: -2,
|
|
421
|
+
alignSelf: 'center',
|
|
422
|
+
fontSize: ThemeConfig.FontSize.normal,
|
|
423
|
+
color: $config.FONT_COLOR,
|
|
424
|
+
fontWeight: '600',
|
|
425
|
+
fontFamily: ThemeConfig.FontFamily.sansPro,
|
|
609
426
|
},
|
|
610
427
|
chip: {
|
|
611
|
-
backgroundColor: $config.
|
|
428
|
+
backgroundColor: $config.PRIMARY_ACTION_BRAND_COLOR,
|
|
612
429
|
borderRadius: 2.5,
|
|
613
430
|
paddingHorizontal: 5,
|
|
614
431
|
marginLeft: 5,
|
|
@@ -621,52 +438,17 @@ const style = StyleSheet.create({
|
|
|
621
438
|
chipText: {
|
|
622
439
|
fontFamily: isIOS() ? 'Helvetica' : 'sans-serif',
|
|
623
440
|
fontSize: 12,
|
|
624
|
-
color: $config.
|
|
441
|
+
color: $config.SECONDARY_ACTION_COLOR,
|
|
625
442
|
},
|
|
626
443
|
navControlBar: {
|
|
627
|
-
width: '50%',
|
|
628
|
-
flexDirection: 'row',
|
|
629
444
|
justifyContent: 'flex-end',
|
|
630
445
|
zIndex: 9,
|
|
631
446
|
},
|
|
632
|
-
navContainer: {
|
|
633
|
-
display: 'flex',
|
|
634
|
-
flexDirection: 'row',
|
|
635
|
-
justifyContent: 'space-around',
|
|
636
|
-
backgroundColor: isWebInternal()
|
|
637
|
-
? $config.SECONDARY_FONT_COLOR
|
|
638
|
-
: $config.SECONDARY_FONT_COLOR + '00',
|
|
639
|
-
paddingVertical: 4,
|
|
640
|
-
paddingHorizontal: isMobileOrTablet() ? 0 : 10,
|
|
641
|
-
minHeight: 35,
|
|
642
|
-
borderRadius: 10,
|
|
643
|
-
},
|
|
644
|
-
navItem: {
|
|
645
|
-
height: '100%',
|
|
646
|
-
alignItems: 'center',
|
|
647
|
-
position: 'relative',
|
|
648
|
-
},
|
|
649
447
|
navSmItem: {
|
|
650
448
|
flexGrow: 0,
|
|
651
449
|
flexShrink: 0,
|
|
652
450
|
flexBasis: '15%',
|
|
653
451
|
},
|
|
654
|
-
navItemSeparator: {
|
|
655
|
-
backgroundColor: $config.PRIMARY_FONT_COLOR + '80',
|
|
656
|
-
width: 1,
|
|
657
|
-
height: '100%',
|
|
658
|
-
marginHorizontal: 10,
|
|
659
|
-
alignSelf: 'center',
|
|
660
|
-
opacity: 0.8,
|
|
661
|
-
},
|
|
662
|
-
navItemSeparatorHorizontal: {
|
|
663
|
-
backgroundColor: $config.PRIMARY_FONT_COLOR + '80',
|
|
664
|
-
width: '100%',
|
|
665
|
-
height: 1,
|
|
666
|
-
marginVertical: 10,
|
|
667
|
-
alignSelf: 'center',
|
|
668
|
-
opacity: 0.8,
|
|
669
|
-
},
|
|
670
452
|
dropdownIconContainer: {
|
|
671
453
|
flex: 1,
|
|
672
454
|
paddingHorizontal: 5,
|