agora-appbuilder-core 2.2.0 → 2.3.0-beta.2

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.
Files changed (301) hide show
  1. package/Readme.md +7 -1
  2. package/package.json +4 -3
  3. package/template/Gulpfile.js +306 -87
  4. package/template/_gitignore +4 -1
  5. package/template/_package-lock.json +32186 -3078
  6. package/template/agora-rn-uikit/src/AgoraUIKit.tsx +23 -20
  7. package/template/agora-rn-uikit/src/Contexts/LocalUserContext.tsx +13 -8
  8. package/template/agora-rn-uikit/src/Contexts/PropsContext.tsx +25 -9
  9. package/template/agora-rn-uikit/src/Contexts/RenderContext.tsx +10 -0
  10. package/template/agora-rn-uikit/src/Contexts/RtcContext.tsx +11 -5
  11. package/template/agora-rn-uikit/src/Controls/BtnTemplate.tsx +6 -2
  12. package/template/agora-rn-uikit/src/Controls/ImageIcon.tsx +1 -1
  13. package/template/agora-rn-uikit/src/Controls/Local/EndCall.tsx +6 -2
  14. package/template/agora-rn-uikit/src/Controls/Local/LocalAudioMute.tsx +2 -2
  15. package/template/agora-rn-uikit/src/Controls/Local/LocalVideoMute.tsx +2 -2
  16. package/template/agora-rn-uikit/src/Controls/Local/SwitchCamera.tsx +6 -2
  17. package/template/agora-rn-uikit/src/Controls/LocalControls.tsx +11 -6
  18. package/template/agora-rn-uikit/src/Controls/Remote/RemoteAudioMute.tsx +10 -6
  19. package/template/agora-rn-uikit/src/Controls/Remote/RemoteSwap.tsx +7 -6
  20. package/template/agora-rn-uikit/src/Controls/Remote/RemoteVideoMute.tsx +6 -5
  21. package/template/agora-rn-uikit/src/Controls/RemoteControls.tsx +3 -3
  22. package/template/agora-rn-uikit/src/Reducer/LocalMuteAudio.ts +16 -13
  23. package/template/agora-rn-uikit/src/Reducer/LocalMuteVideo.ts +16 -13
  24. package/template/agora-rn-uikit/src/Reducer/RemoteAudioStateChanged.ts +13 -13
  25. package/template/agora-rn-uikit/src/Reducer/RemoteVideoStateChanged.ts +16 -13
  26. package/template/agora-rn-uikit/src/Reducer/UpdateDualStreamMode.ts +28 -31
  27. package/template/agora-rn-uikit/src/Reducer/UserJoined.ts +48 -35
  28. package/template/agora-rn-uikit/src/Reducer/UserMuteRemoteAudio.ts +11 -13
  29. package/template/agora-rn-uikit/src/Reducer/UserMuteRemoteVideo.ts +11 -13
  30. package/template/agora-rn-uikit/src/Reducer/UserOffline.ts +18 -15
  31. package/template/agora-rn-uikit/src/Rtc/Create.tsx +14 -2
  32. package/template/agora-rn-uikit/src/Rtc/Join.tsx +19 -3
  33. package/template/agora-rn-uikit/src/RtcConfigure.tsx +161 -44
  34. package/template/agora-rn-uikit/src/Utils/useLocalUid.ts +8 -0
  35. package/template/agora-rn-uikit/src/Views/MaxVideoView.native.tsx +8 -6
  36. package/template/agora-rn-uikit/src/Views/MaxVideoView.tsx +8 -6
  37. package/template/agora-rn-uikit/src/Views/MinVideoView.tsx +18 -9
  38. package/template/agora-rn-uikit/src/index.ts +12 -12
  39. package/template/babel.config.js +17 -1
  40. package/template/bridge/rtc/webNg/RtcEngine.ts +34 -28
  41. package/template/bridge/rtc/webNg/SurfaceView.tsx +3 -2
  42. package/template/bridge/rtc/webNg/Types.ts +14 -0
  43. package/template/bridge/rtc/webNg/index.ts +5 -2
  44. package/template/bridge/rtm/web/index.ts +13 -7
  45. package/template/electron-builder.js +3 -2
  46. package/template/esbuild.rsdk.go +226 -0
  47. package/template/{src/subComponents/LayoutEnum.tsx → esbuildConfigTransform.js} +1 -5
  48. package/template/fpe-api/components.ts +42 -0
  49. package/template/fpe-api/context.ts +45 -0
  50. package/template/fpe-api/fpeEvents.ts +9 -0
  51. package/template/fpe-api/index.ts +21 -0
  52. package/template/fpe-api/install.ts +128 -0
  53. package/template/fpe-api/typeDefinition.ts +143 -0
  54. package/template/fpe-api/useFpe.tsx +35 -0
  55. package/template/fpe-api/utils.ts +62 -0
  56. package/template/fpe-implementation/createHook.ts +33 -0
  57. package/template/fpe-implementation/dummyFpe.ts +17 -0
  58. package/template/fpe-implementation/index.ts +1 -0
  59. package/template/fpe-todo.txt +14 -0
  60. package/template/fpe.config.js +29 -0
  61. package/template/global.d.ts +4 -0
  62. package/template/index.rsdk.tsx +27 -0
  63. package/template/index.wsdk.tsx +27 -0
  64. package/template/package.json +28 -12
  65. package/template/react-native-toast-message/src/index.js +9 -10
  66. package/template/react-native-toast-message/src/index.wsdk.js +419 -0
  67. package/template/src/App.tsx +97 -65
  68. package/template/src/AppWrapper.tsx +79 -0
  69. package/template/src/SDKAppWrapper.tsx +67 -0
  70. package/template/src/atoms/PrimaryButton.tsx +14 -8
  71. package/template/src/atoms/TextInput.tsx +13 -5
  72. package/template/src/components/Chat.tsx +171 -139
  73. package/template/src/components/ChatContext.ts +14 -22
  74. package/template/src/components/ColorConfigure.tsx +2 -2
  75. package/template/src/components/Controls.native.tsx +72 -62
  76. package/template/src/components/Controls.tsx +90 -69
  77. package/template/src/components/DeviceConfigure.tsx +1 -1
  78. package/template/src/components/DeviceContext.tsx +14 -7
  79. package/template/src/components/GraphQLProvider.tsx +9 -2
  80. package/template/src/components/GridVideo.tsx +20 -159
  81. package/template/src/components/HostControlView.tsx +54 -15
  82. package/template/src/components/Navbar.tsx +408 -157
  83. package/template/src/components/NetworkQualityContext.tsx +29 -22
  84. package/template/src/components/ParticipantsView.tsx +91 -115
  85. package/template/src/components/PinnedVideo.tsx +41 -188
  86. package/template/src/components/Precall.native.tsx +131 -97
  87. package/template/src/components/Precall.tsx +193 -158
  88. package/template/src/components/RTMConfigure.tsx +328 -416
  89. package/template/src/components/Router.sdk.ts +20 -0
  90. package/template/src/components/SessionContext.tsx +6 -3
  91. package/template/src/components/Settings.native.tsx +3 -0
  92. package/template/src/components/Settings.tsx +65 -31
  93. package/template/src/components/SettingsView.tsx +14 -8
  94. package/template/src/components/Share.tsx +188 -220
  95. package/template/src/components/StorageContext.tsx +5 -5
  96. package/template/src/components/StoreToken.tsx +5 -1
  97. package/template/src/components/chat-messages/useChatMessages.tsx +208 -0
  98. package/template/src/components/chat-notification/useChatNotification.tsx +78 -0
  99. package/template/src/components/chat-ui/useChatUIControl.tsx +66 -0
  100. package/template/src/components/common/Error.tsx +54 -0
  101. package/template/src/components/common/Logo.tsx +35 -0
  102. package/template/src/components/common/index.tsx +8 -0
  103. package/template/src/components/contexts/LiveStreamDataContext.tsx +79 -0
  104. package/template/src/components/contexts/ScreenShareContext.tsx +47 -0
  105. package/template/src/components/contexts/WhiteboardContext.tsx +59 -0
  106. package/template/src/components/dimension/DimensionContext.ts +27 -0
  107. package/template/src/components/dimension/DimensionProvider.tsx +34 -0
  108. package/template/src/components/livestream/LiveStreamContext.tsx +293 -272
  109. package/template/src/components/livestream/Types.ts +26 -7
  110. package/template/src/components/livestream/index.ts +13 -2
  111. package/template/src/components/livestream/views/LiveStreamControls.tsx +5 -1
  112. package/template/src/components/meeting-info/useMeetingInfo.tsx +63 -0
  113. package/template/src/components/meeting-info/useSetMeetingInfo.tsx +38 -0
  114. package/template/src/components/participants/AllAudienceParticipants.tsx +26 -21
  115. package/template/src/components/participants/AllHostParticipants.tsx +41 -53
  116. package/template/src/components/participants/MeParticipant.tsx +9 -10
  117. package/template/src/components/participants/ParticipantName.tsx +2 -1
  118. package/template/src/components/participants/RemoteParticipants.tsx +3 -3
  119. package/template/src/components/precall/LocalMute.native.tsx +91 -0
  120. package/template/src/components/precall/LocalMute.tsx +90 -0
  121. package/template/src/components/precall/VideoPreview.native.tsx +35 -0
  122. package/template/src/components/precall/VideoPreview.tsx +33 -0
  123. package/template/src/components/precall/index.tsx +28 -0
  124. package/template/src/components/precall/joinCallBtn.native.tsx +69 -0
  125. package/template/src/components/precall/joinCallBtn.tsx +91 -0
  126. package/template/src/components/precall/meetingTitle.tsx +26 -0
  127. package/template/src/components/precall/selectDevice.tsx +46 -0
  128. package/template/src/components/precall/textInput.tsx +43 -0
  129. package/template/src/components/precall/usePreCall.tsx +41 -0
  130. package/template/src/components/styles.ts +20 -3
  131. package/template/src/components/useShareLink.tsx +239 -0
  132. package/template/src/components/useWakeLock.tsx +3 -3
  133. package/template/src/custom-events/CustomEvents.ts +221 -0
  134. package/template/src/custom-events/index.tsx +4 -0
  135. package/template/src/custom-events/types.ts +51 -0
  136. package/template/src/language/default-labels/commonLabels.ts +21 -0
  137. package/template/src/language/default-labels/createScreenLabels.ts +22 -0
  138. package/template/src/language/default-labels/index.ts +38 -0
  139. package/template/src/language/default-labels/joinScreenLabels.ts +13 -0
  140. package/template/src/language/default-labels/precallScreenLabels.ts +33 -0
  141. package/template/src/language/default-labels/shareLinkScreenLabels.ts +44 -0
  142. package/template/src/language/default-labels/videoCallScreenLabels.ts +189 -0
  143. package/template/src/language/i18nTypes.ts +10 -0
  144. package/template/src/language/index.ts +18 -0
  145. package/template/src/language/useLanguage.tsx +92 -0
  146. package/template/src/pages/Authenticate.tsx +21 -15
  147. package/template/src/pages/Create.tsx +176 -159
  148. package/template/src/pages/Join.tsx +44 -32
  149. package/template/src/pages/VideoCall.tsx +134 -406
  150. package/template/src/pages/create/useCreate.tsx +37 -0
  151. package/template/src/pages/video-call/CustomLayout.ts +17 -0
  152. package/template/src/pages/video-call/CustomUserContextHolder.tsx +12 -0
  153. package/template/src/pages/video-call/DefaultLayouts.ts +65 -0
  154. package/template/src/pages/video-call/NameWithMicStatus.tsx +62 -0
  155. package/template/src/pages/video-call/RenderComponent.tsx +52 -0
  156. package/template/src/pages/video-call/VideoCallScreen.tsx +191 -0
  157. package/template/src/pages/video-call/VideoComponent.tsx +34 -0
  158. package/template/src/pages/video-call/VideoRenderer.tsx +86 -0
  159. package/template/src/pages/video-call/index.ts +20 -0
  160. package/template/src/rtm/RTMEngine.ts +58 -0
  161. package/template/src/rtm/utils.ts +44 -0
  162. package/template/src/rtm-events/EventUtils.ts +267 -0
  163. package/template/src/rtm-events/EventsQueue.ts +38 -0
  164. package/template/src/rtm-events/constants.ts +40 -0
  165. package/template/src/rtm-events/index.tsx +8 -0
  166. package/template/src/rtm-events/types.ts +7 -0
  167. package/template/src/subComponents/ChatBubble.tsx +18 -11
  168. package/template/src/subComponents/ChatContainer.tsx +79 -30
  169. package/template/src/subComponents/ChatInput.tsx +146 -70
  170. package/template/src/subComponents/CopyJoinInfo.tsx +52 -67
  171. package/template/src/subComponents/Error.tsx +35 -24
  172. package/template/src/subComponents/LanguageSelector.tsx +85 -0
  173. package/template/src/subComponents/LayoutIconDropdown.native.tsx +163 -0
  174. package/template/src/subComponents/LayoutIconDropdown.tsx +198 -0
  175. package/template/src/subComponents/LocalAudioMute.tsx +52 -30
  176. package/template/src/subComponents/LocalEndCall.tsx +52 -0
  177. package/template/src/subComponents/LocalSwitchCamera.tsx +61 -0
  178. package/template/src/subComponents/LocalVideoMute.tsx +48 -30
  179. package/template/src/subComponents/LogoutButton.tsx +20 -5
  180. package/template/src/subComponents/NetworkQualityPill.tsx +43 -13
  181. package/template/src/subComponents/OpenInNativeButton.tsx +3 -2
  182. package/template/src/subComponents/Recording.tsx +46 -138
  183. package/template/src/subComponents/RemoteAudioMute.tsx +30 -34
  184. package/template/src/subComponents/RemoteEndCall.tsx +18 -7
  185. package/template/src/subComponents/RemoteVideoMute.tsx +17 -9
  186. package/template/src/subComponents/ScreenShareNotice.tsx +40 -40
  187. package/template/src/subComponents/SelectDevice.tsx +88 -45
  188. package/template/src/subComponents/SelectOAuth.tsx +30 -6
  189. package/template/src/subComponents/SidePanelButtons.ts +39 -0
  190. package/template/src/subComponents/TextWithTooltip.native.tsx +2 -1
  191. package/template/src/subComponents/TextWithTooltip.tsx +15 -20
  192. package/template/src/subComponents/chat/ChatParticipants.tsx +31 -32
  193. package/template/src/subComponents/livestream/ApprovedLiveStreamControlsView.tsx +7 -3
  194. package/template/src/subComponents/livestream/CurrentLiveStreamRequestsView.tsx +32 -18
  195. package/template/src/subComponents/livestream/controls/LocalRaiseHand.tsx +22 -8
  196. package/template/src/subComponents/livestream/controls/RemoteLiveStreamApprovedRequestRecall.tsx +12 -7
  197. package/template/src/subComponents/livestream/controls/RemoteLiveStreamRequestApprove.tsx +24 -27
  198. package/template/src/subComponents/livestream/controls/RemoteLiveStreamRequestReject.tsx +23 -26
  199. package/template/src/subComponents/livestream/index.ts +10 -2
  200. package/template/src/subComponents/recording/useRecording.tsx +209 -0
  201. package/template/src/subComponents/recording/useRecordingLayoutQuery.tsx +64 -0
  202. package/template/src/subComponents/screenshare/ScreenshareButton.native.tsx +18 -0
  203. package/template/src/subComponents/screenshare/ScreenshareButton.tsx +61 -31
  204. package/template/src/subComponents/screenshare/ScreenshareConfigure.native.tsx +57 -52
  205. package/template/src/subComponents/screenshare/ScreenshareConfigure.tsx +102 -143
  206. package/template/src/subComponents/screenshare/useScreenshare.tsx +29 -0
  207. package/template/src/subComponents/toastConfig.tsx +25 -20
  208. package/template/src/utils/IsAttendeeUser.ts +34 -0
  209. package/template/src/utils/SdkEvents.ts +68 -0
  210. package/template/src/utils/common.tsx +40 -0
  211. package/template/src/utils/eventEmitter.ts +29 -0
  212. package/template/src/utils/getMeetingInvite.ts +30 -0
  213. package/template/src/utils/index.tsx +11 -2
  214. package/template/src/utils/isAudioEnabled.ts +29 -0
  215. package/template/src/utils/isHostUser.ts +33 -0
  216. package/template/src/utils/isMobileOrTablet.native.ts +5 -0
  217. package/template/src/utils/{mobileWebTest.tsx → isMobileOrTablet.ts} +5 -2
  218. package/template/src/utils/isPSTNUser.ts +30 -0
  219. package/template/src/utils/isSDK.sdk.ts +5 -0
  220. package/template/src/utils/isSDK.ts +5 -0
  221. package/template/src/utils/isScreenShareUser.ts +31 -0
  222. package/template/src/utils/isVideoEnabled.ts +29 -0
  223. package/template/src/utils/useButtonTemplate.tsx +43 -0
  224. package/template/src/utils/useCreateMeeting.ts +74 -0
  225. package/template/src/utils/useGetLiveStreamingRequests.ts +24 -0
  226. package/template/src/utils/useGetMeetingPhrase.ts +68 -0
  227. package/template/src/utils/useGetName.ts +20 -0
  228. package/template/src/{subComponents/screenshare/ScreenshareContext.tsx → utils/useGroupMessages.ts} +10 -7
  229. package/template/src/utils/useJoinMeeting.ts +120 -0
  230. package/template/src/utils/useLayout.tsx +40 -0
  231. package/template/src/utils/useLiveStreamingUids.ts +26 -0
  232. package/template/src/utils/useMutePSTN.ts +43 -0
  233. package/template/src/utils/useMuteToggleLocal.ts +109 -0
  234. package/template/src/utils/useNavParams.ts +6 -0
  235. package/template/src/utils/useNavigateTo.ts +8 -0
  236. package/template/src/utils/usePrivateMessages.ts +33 -0
  237. package/template/src/utils/useRemoteEndCall.ts +27 -0
  238. package/template/src/utils/useRemoteMute.ts +64 -0
  239. package/template/src/utils/useSendControlMessage.ts +51 -0
  240. package/template/src/utils/useSendMessage.ts +40 -0
  241. package/template/src/utils/useSetName.ts +20 -0
  242. package/template/src/utils/useSetUnreadMessageCount.ts +43 -0
  243. package/template/src/utils/useSidePanel.tsx +41 -0
  244. package/template/src/utils/useString.ts +61 -0
  245. package/template/src/utils/useUnreadMessageCount.ts +50 -0
  246. package/template/src/utils/useUserList.ts +26 -0
  247. package/template/tsconfig.json +4 -4
  248. package/template/tsconfig_fpeApi.json +103 -0
  249. package/template/tsconfig_rsdk_index.json +105 -0
  250. package/template/tsconfig_wsdk_index.json +104 -0
  251. package/template/webpack.commons.js +40 -16
  252. package/template/webpack.main.config.js +2 -1
  253. package/template/webpack.renderer.config.js +1 -1
  254. package/template/webpack.rsdk.config.js +33 -0
  255. package/template/webpack.ts.config.js +89 -0
  256. package/template/webpack.web.config.js +8 -1
  257. package/template/webpack.wsdk.config.js +34 -0
  258. package/template/agora-rn-uikit/.git/HEAD +0 -1
  259. package/template/agora-rn-uikit/.git/config +0 -16
  260. package/template/agora-rn-uikit/.git/description +0 -1
  261. package/template/agora-rn-uikit/.git/hooks/applypatch-msg.sample +0 -15
  262. package/template/agora-rn-uikit/.git/hooks/commit-msg.sample +0 -24
  263. package/template/agora-rn-uikit/.git/hooks/fsmonitor-watchman.sample +0 -173
  264. package/template/agora-rn-uikit/.git/hooks/post-update.sample +0 -8
  265. package/template/agora-rn-uikit/.git/hooks/pre-applypatch.sample +0 -14
  266. package/template/agora-rn-uikit/.git/hooks/pre-commit.sample +0 -49
  267. package/template/agora-rn-uikit/.git/hooks/pre-merge-commit.sample +0 -13
  268. package/template/agora-rn-uikit/.git/hooks/pre-push.sample +0 -53
  269. package/template/agora-rn-uikit/.git/hooks/pre-rebase.sample +0 -169
  270. package/template/agora-rn-uikit/.git/hooks/pre-receive.sample +0 -24
  271. package/template/agora-rn-uikit/.git/hooks/prepare-commit-msg.sample +0 -42
  272. package/template/agora-rn-uikit/.git/hooks/push-to-checkout.sample +0 -78
  273. package/template/agora-rn-uikit/.git/hooks/update.sample +0 -128
  274. package/template/agora-rn-uikit/.git/index +0 -0
  275. package/template/agora-rn-uikit/.git/info/exclude +0 -6
  276. package/template/agora-rn-uikit/.git/logs/HEAD +0 -2
  277. package/template/agora-rn-uikit/.git/logs/refs/heads/ab-dev-auto +0 -1
  278. package/template/agora-rn-uikit/.git/logs/refs/heads/master +0 -1
  279. package/template/agora-rn-uikit/.git/logs/refs/remotes/origin/HEAD +0 -1
  280. package/template/agora-rn-uikit/.git/objects/pack/pack-0061d00cd98162a329a32b537488a35d0abeb069.idx +0 -0
  281. package/template/agora-rn-uikit/.git/objects/pack/pack-0061d00cd98162a329a32b537488a35d0abeb069.pack +0 -0
  282. package/template/agora-rn-uikit/.git/packed-refs +0 -24
  283. package/template/agora-rn-uikit/.git/refs/heads/ab-dev-auto +0 -1
  284. package/template/agora-rn-uikit/.git/refs/heads/master +0 -1
  285. package/template/agora-rn-uikit/.git/refs/remotes/origin/HEAD +0 -1
  286. package/template/agora-rn-uikit/.gitignore +0 -63
  287. package/template/agora-rn-uikit/package-lock.json +0 -7612
  288. package/template/agora-rn-uikit/src/Contexts/MaxUidContext.tsx +0 -7
  289. package/template/agora-rn-uikit/src/Contexts/MinUidContext.tsx +0 -8
  290. package/template/package-lock.json +0 -22923
  291. package/template/react-native-toast-message/.gitignore +0 -5
  292. package/template/react-native-toast-message/.npmignore +0 -5
  293. package/template/react-native-toast-message/package-lock.json +0 -10553
  294. package/template/src/.DS_Store +0 -0
  295. package/template/src/components/participants/context/ParticipantContext.tsx +0 -97
  296. package/template/src/subComponents/.DS_Store +0 -0
  297. package/template/src/subComponents/ScreenshareButton.tsx +0 -257
  298. package/template/src/subComponents/SwitchCamera.tsx +0 -35
  299. package/template/src/utils/hasBrandLogo.tsx +0 -3
  300. package/template/src/utils/mobileWebTest.native.tsx +0 -5
  301. package/template/src/utils/shouldAuthenticate.tsx +0 -7
@@ -12,16 +12,32 @@
12
12
  import React, {useContext} from 'react';
13
13
  import {View, TouchableOpacity, Text, StyleSheet, Image} from 'react-native';
14
14
  import ColorContext from '../components/ColorContext';
15
+ // @ts-ignore
15
16
  import google from '../assets/google.png';
17
+ // @ts-ignore
16
18
  import apple from '../assets/apple.png';
19
+ // @ts-ignore
17
20
  import slack from '../assets/slack.png';
21
+ // @ts-ignore
18
22
  import microsoft from '../assets/microsoft.png';
19
23
  import Logo from './Logo';
20
- import hasBrandLogo from '../utils/hasBrandLogo';
24
+ import {hasBrandLogo} from '../utils/common';
25
+ import {useString} from '../utils/useString';
21
26
 
22
27
  const SelectOAuth = ({onSelectOAuth}) => {
23
28
  // Linking.openURL(url);
24
29
  const {primaryColor} = useContext(ColorContext);
30
+ //commented for v1 release
31
+ // const oauthLoginLabel = useString('oauthLoginLabel')();
32
+ // const googleAuthButton = useString('googleAuthButton')();
33
+ // const microsoftAuthButton = useString('microsoftAuthButton')();
34
+ // const slackAuthButton = useString('slackAuthButton')();
35
+ // const appleAuthButton = useString('appleAuthButton')();
36
+ const oauthLoginLabel = 'Login using OAuth';
37
+ const googleAuthButton = 'Google';
38
+ const microsoftAuthButton = 'Microsoft';
39
+ const slackAuthButton = 'Slack';
40
+ const appleAuthButton = 'Apple';
25
41
  return (
26
42
  <View style={style.main}>
27
43
  <View style={style.nav}>{hasBrandLogo && <Logo />}</View>
@@ -38,14 +54,16 @@ const SelectOAuth = ({onSelectOAuth}) => {
38
54
  marginBottom: 20,
39
55
  color: $config.PRIMARY_FONT_COLOR,
40
56
  }}>
41
- Login using OAuth
57
+ {oauthLoginLabel}
42
58
  </Text>
43
59
  {$config.ENABLE_GOOGLE_OAUTH ? (
44
60
  <TouchableOpacity
45
61
  style={[style.secondaryBtn, {borderColor: primaryColor}]}
46
62
  onPress={() => onSelectOAuth({oAuthSystem: 'google'})}>
47
63
  <Image source={google} style={style.logo} />
48
- <Text style={[style.secondaryBtnText]}>Google</Text>
64
+ <Text style={[style.secondaryBtnText]}>
65
+ {googleAuthButton}
66
+ </Text>
49
67
  </TouchableOpacity>
50
68
  ) : (
51
69
  <></>
@@ -55,7 +73,9 @@ const SelectOAuth = ({onSelectOAuth}) => {
55
73
  style={[style.secondaryBtn, {borderColor: primaryColor}]}
56
74
  onPress={() => onSelectOAuth({oAuthSystem: 'microsoft'})}>
57
75
  <Image source={microsoft} style={style.logo} />
58
- <Text style={[style.secondaryBtnText]}>Microsoft</Text>
76
+ <Text style={[style.secondaryBtnText]}>
77
+ {microsoftAuthButton}
78
+ </Text>
59
79
  </TouchableOpacity>
60
80
  ) : (
61
81
  <></>
@@ -65,7 +85,9 @@ const SelectOAuth = ({onSelectOAuth}) => {
65
85
  style={[style.secondaryBtn, {borderColor: primaryColor}]}
66
86
  onPress={() => onSelectOAuth({oAuthSystem: 'slack'})}>
67
87
  <Image source={slack} style={style.logo} />
68
- <Text style={[style.secondaryBtnText]}>Slack</Text>
88
+ <Text style={[style.secondaryBtnText]}>
89
+ {slackAuthButton}
90
+ </Text>
69
91
  </TouchableOpacity>
70
92
  ) : (
71
93
  <></>
@@ -75,7 +97,9 @@ const SelectOAuth = ({onSelectOAuth}) => {
75
97
  style={[style.secondaryBtn, {borderColor: primaryColor}]}
76
98
  onPress={() => onSelectOAuth({oAuthSystem: 'apple'})}>
77
99
  <Image source={apple} style={style.logo} />
78
- <Text style={[style.secondaryBtnText]}>Apple</Text>
100
+ <Text style={[style.secondaryBtnText]}>
101
+ {appleAuthButton}
102
+ </Text>
79
103
  </TouchableOpacity>
80
104
  ) : (
81
105
  <></>
@@ -0,0 +1,39 @@
1
+ import {ChatSendButton, ChatSendButtonProps} from './ChatInput';
2
+ import {
3
+ RemoteLiveStreamApprovedRequestRecall,
4
+ RemoteLiveStreamRequestApprove,
5
+ RemoteLiveStreamRequestReject,
6
+ RemoteLiveStreamApprovedRequestRecallProps,
7
+ RemoteLiveStreamControlInterface,
8
+ } from './livestream';
9
+ import RemoteAudioMute, {RemoteAudioMuteProps} from './RemoteAudioMute';
10
+ import RemoteVideoMute, {RemoteVideoMuteProps} from './RemoteVideoMute';
11
+ import RemoteEndCall, {RemoteEndCallProps} from './RemoteEndCall';
12
+ import {
13
+ MuteAllAudioButton,
14
+ MuteAllAudioButtonProps,
15
+ MuteAllVideoButton,
16
+ MuteAllVideoButtonProps,
17
+ } from '../components/HostControlView';
18
+
19
+ export const SidePanelButtonsArray: [
20
+ (props: RemoteAudioMuteProps) => JSX.Element,
21
+ (props: RemoteVideoMuteProps) => JSX.Element,
22
+ (props: RemoteEndCallProps) => JSX.Element,
23
+ (props: RemoteLiveStreamApprovedRequestRecallProps) => JSX.Element,
24
+ (props: RemoteLiveStreamControlInterface) => JSX.Element,
25
+ (props: RemoteLiveStreamControlInterface) => JSX.Element,
26
+ (props: ChatSendButtonProps) => JSX.Element,
27
+ (props: MuteAllAudioButtonProps) => JSX.Element,
28
+ (props: MuteAllVideoButtonProps) => JSX.Element,
29
+ ] = [
30
+ RemoteAudioMute,
31
+ RemoteVideoMute,
32
+ RemoteEndCall,
33
+ RemoteLiveStreamApprovedRequestRecall,
34
+ RemoteLiveStreamRequestApprove,
35
+ RemoteLiveStreamRequestReject,
36
+ ChatSendButton,
37
+ MuteAllAudioButton,
38
+ MuteAllVideoButton,
39
+ ];
@@ -9,12 +9,13 @@
9
9
  information visit https://appbuilder.agora.io.
10
10
  *********************************************
11
11
  */
12
+ // @ts-nocheck
12
13
  import React, {useState, useRef} from 'react';
13
14
  import {View, Text, Modal, TouchableOpacity, TouchableWithoutFeedback, StyleSheet, useWindowDimensions} from 'react-native';
14
15
  /**
15
16
  * Component showing text with tooltip on mobile native
16
17
  */
17
- const TextWithToolTip = (props: any) => {
18
+ const TextWithToolTip = (props: {value: string, style: object, touchable?: boolean}) => {
18
19
  const {width:globalWidth, height:globalHeight} = useWindowDimensions();
19
20
  const [toolTipVisible, setToolTipVisible] = useState(false);
20
21
  const [position, setPosition] = useState({})
@@ -11,34 +11,29 @@
11
11
  */
12
12
  import React from 'react';
13
13
  import {Text} from 'react-native';
14
- import mobileAndTabletCheck from '../utils/mobileWebTest';
14
+ import isMobileOrTablet from '../utils/isMobileOrTablet';
15
15
  import TextWithToolTipNative from './TextWithTooltip.native';
16
16
  /**
17
17
  * Text with tooltip
18
18
  * web - used title attribute to show the tooltip
19
19
  */
20
- const TextWithToolTip = (props: any) => {
21
- return(
22
- <div
23
- style={style.containerStyle}
24
- title={props.value}
25
- >
26
- <Text
27
- numberOfLines={1}
28
- textBreakStrategy='simple'
29
- style={[props.style]}
30
- >{props.value}</Text>
31
- </div>
32
- )
20
+ const TextWithToolTip = (props: {touchable?: boolean;value: string; style: object}) => {
21
+ return (
22
+ <div style={style.containerStyle} title={props.value}>
23
+ <Text numberOfLines={1} textBreakStrategy="simple" style={[props.style]}>
24
+ {props.value}
25
+ </Text>
26
+ </div>
27
+ );
33
28
  };
34
29
 
35
30
  const style = {
36
- containerStyle:{
37
- display: 'flex'
38
- },
39
- }
31
+ containerStyle: {
32
+ display: 'flex',
33
+ },
34
+ };
40
35
  /**
41
- * Web and Desktop : using the TextWithToolTip - which have the browser tooltip
36
+ * Web and Desktop : using the TextWithToolTip - which have the browser tooltip
42
37
  * Mobile and Mobile Web : using the TextWithToolTipNative - which have the custom tooltip using modal
43
38
  */
44
- export default mobileAndTabletCheck() ? TextWithToolTipNative : TextWithToolTip;
39
+ export default isMobileOrTablet() ? TextWithToolTipNative : TextWithToolTip;
@@ -6,55 +6,50 @@ import {
6
6
  ScrollView,
7
7
  useWindowDimensions,
8
8
  StyleSheet,
9
- Platform,
10
9
  } from 'react-native';
11
10
  import {RFValue} from 'react-native-responsive-fontsize';
12
- import {UserType} from '../../components/RTMConfigure';
13
11
  import TextWithTooltip from '../TextWithTooltip';
14
- import chatContext from '../../components/ChatContext';
12
+ import {useString} from '../../utils/useString';
13
+ import {isIOS, isWeb} from '../../utils/common';
14
+ import {useChatNotification} from '../../components/chat-notification/useChatNotification';
15
+ import useUserList from '../../utils/useUserList';
16
+ import {UidType, useLocalUid} from '../../../agora-rn-uikit';
15
17
 
16
18
  const ChatParticipants = (props: any) => {
17
- const {
18
- selectUser,
19
- setPrivateMessageLastSeen,
20
- privateMessageCountMap,
21
- lastCheckedPrivateState,
22
- } = props;
19
+ //commented for v1 release
20
+ //const remoteUserDefaultLabel = useString('remoteUserDefaultLabel')();
21
+ const remoteUserDefaultLabel = 'User';
22
+ const {selectUser} = props;
23
23
  const {height, width} = useWindowDimensions();
24
- const {userList, localUid} = useContext(chatContext);
25
-
26
- const isChatUser = (userId: string, userInfo: any) => {
24
+ const {renderList} = useUserList();
25
+ const localUid = useLocalUid();
26
+ const {unreadIndividualMessageCount} = useChatNotification();
27
+ const isChatUser = (userId: UidType, userInfo: any) => {
27
28
  return (
28
- userId !== localUid &&
29
- parseInt(userId) !== 1 &&
30
- userInfo?.type !== UserType.ScreenShare &&
29
+ userId !== localUid && //user can't chat with own user
30
+ // @ts-ignore
31
+ userId !== '1' && //user can't chat with pstn user
32
+ userInfo?.type === 'rtc' &&
31
33
  !userInfo?.offline
32
34
  );
33
35
  };
34
36
 
35
37
  return (
36
38
  <ScrollView>
37
- {Object.entries(userList).map(([uid, value]) => {
38
- if (isChatUser(uid, value)) {
39
+ {Object.entries(renderList).map(([uid, value]) => {
40
+ const uidAsNumber = parseInt(uid);
41
+ if (isChatUser(uidAsNumber, value)) {
39
42
  return (
40
43
  <TouchableOpacity
41
44
  style={style.participantContainer}
42
45
  key={uid}
43
46
  onPress={() => {
44
- selectUser(uid);
45
- setPrivateMessageLastSeen({
46
- userId: uid,
47
- lastSeenCount: privateMessageCountMap[uid],
48
- });
47
+ selectUser(uidAsNumber);
49
48
  }}>
50
- {(privateMessageCountMap[uid] || 0) -
51
- (lastCheckedPrivateState[uid] || 0) !==
52
- 0 ? (
49
+ {unreadIndividualMessageCount &&
50
+ unreadIndividualMessageCount[uidAsNumber] ? (
53
51
  <View style={style.chatNotificationPrivate}>
54
- <Text>
55
- {(privateMessageCountMap[uid] || 0) -
56
- (lastCheckedPrivateState[uid] || 0)}
57
- </Text>
52
+ <Text>{unreadIndividualMessageCount[uidAsNumber]}</Text>
58
53
  </View>
59
54
  ) : null}
60
55
  <View style={{flex: 1}}>
@@ -66,7 +61,11 @@ const ChatParticipants = (props: any) => {
66
61
  fontSize: RFValue(16, height > width ? height : width),
67
62
  },
68
63
  ]}
69
- value={userList[uid] ? userList[uid].name + ' ' : 'User '}
64
+ value={
65
+ renderList[uidAsNumber]
66
+ ? renderList[uidAsNumber].name + ''
67
+ : remoteUserDefaultLabel
68
+ }
70
69
  />
71
70
  </View>
72
71
  <View>
@@ -96,7 +95,7 @@ const style = StyleSheet.create({
96
95
  },
97
96
  participantText: {
98
97
  flex: 1,
99
- fontWeight: Platform.OS === 'web' ? '500' : '700',
98
+ fontWeight: isWeb ? '500' : '700',
100
99
  flexDirection: 'row',
101
100
  color: $config.PRIMARY_FONT_COLOR,
102
101
  textAlign: 'left',
@@ -111,7 +110,7 @@ const style = StyleSheet.create({
111
110
  justifyContent: 'center',
112
111
  backgroundColor: $config.PRIMARY_COLOR,
113
112
  color: $config.SECONDARY_FONT_COLOR,
114
- fontFamily: Platform.OS === 'ios' ? 'Helvetica' : 'sans-serif',
113
+ fontFamily: isIOS ? 'Helvetica' : 'sans-serif',
115
114
  borderRadius: 10,
116
115
  position: 'absolute',
117
116
  right: 20,
@@ -1,16 +1,20 @@
1
1
  import React, {useContext} from 'react';
2
2
  import {View} from 'react-native';
3
3
  import RemoteLiveStreamApprovedRequestRecall from './controls/RemoteLiveStreamApprovedRequestRecall';
4
- import LiveStreamContext, {requestStatus} from '../../components/livestream';
4
+ import LiveStreamContext, {RaiseHandValue} from '../../components/livestream';
5
+ import {ClientRole} from '../../../agora-rn-uikit';
5
6
 
6
7
  const ApprovedLiveStreamControlsView = (props: {
7
8
  uid: number;
8
9
  p_styles: any;
9
10
  }) => {
10
11
  const {uid, p_styles} = props;
11
- const {currLiveStreamRequest} = useContext(LiveStreamContext);
12
+ const {raiseHandList} = useContext(LiveStreamContext);
12
13
 
13
- if (currLiveStreamRequest[uid]?.status === requestStatus.Approved) {
14
+ if (
15
+ raiseHandList[uid]?.raised === RaiseHandValue.TRUE &&
16
+ raiseHandList[uid]?.role == ClientRole.Broadcaster
17
+ ) {
14
18
  return (
15
19
  <View style={[p_styles.actionBtnIcon, {marginRight: 10}]}>
16
20
  <RemoteLiveStreamApprovedRequestRecall uid={uid} />
@@ -3,13 +3,28 @@ import {View, Text} from 'react-native';
3
3
  import RemoteLiveStreamRequestApprove from './controls/RemoteLiveStreamRequestApprove';
4
4
  import RemoteLiveStreamRequestReject from './controls/RemoteLiveStreamRequestReject';
5
5
  import ParticipantName from '../../components/participants/ParticipantName';
6
- import LiveStreamContext, {requestStatus} from '../../components/livestream';
6
+ import LiveStreamContext, {RaiseHandValue} from '../../components/livestream';
7
7
  import {filterObject} from '../../utils/index';
8
8
  import ParticipantSectionTitle from '../../components/participants/ParticipantSectionTitle';
9
+ import {useString} from '../../utils/useString';
10
+ import useUserList from '../../utils/useUserList';
11
+ import {ClientRole} from '../../../agora-rn-uikit';
9
12
 
10
13
  const CurrentLiveStreamRequestsView = (props: any) => {
11
- const {userList, p_style} = props;
12
- const {currLiveStreamRequest, setLastCheckedRequestTimestamp} =
14
+ //commented for v1 release
15
+ // const noLiveStreamingRequestsLabel = useString(
16
+ // 'raisedHandsListPlaceholder',
17
+ // )();
18
+ // const remoteUserDefaultLabel = useString('remoteUserDefaultLabel')();
19
+ // const noUserFoundLabel = useString('noUserFoundLabel')();
20
+ // const raisedHandsListTitleLabel = useString('raisedHandsListTitleLabel')();
21
+ const noLiveStreamingRequestsLabel = 'No streaming request(s)';
22
+ const remoteUserDefaultLabel = 'User';
23
+ const noUserFoundLabel = 'User not found';
24
+ const raisedHandsListTitleLabel = 'Streaming Request';
25
+ const {p_style} = props;
26
+ const {renderList} = useUserList();
27
+ const {raiseHandList, setLastCheckedRequestTimestamp} =
13
28
  useContext(LiveStreamContext);
14
29
  const [activeLiveStreamRequests, setActiveLiveStreamRequests] =
15
30
  React.useState({});
@@ -17,11 +32,12 @@ const CurrentLiveStreamRequestsView = (props: any) => {
17
32
  useEffect(() => {
18
33
  setActiveLiveStreamRequests(
19
34
  filterObject(
20
- currLiveStreamRequest,
21
- ([k, v]) => v?.status === requestStatus.AwaitingAction,
35
+ raiseHandList,
36
+ ([k, v]) =>
37
+ v?.raised === RaiseHandValue.TRUE && v?.role == ClientRole.Audience,
22
38
  ),
23
39
  );
24
- }, [currLiveStreamRequest]);
40
+ }, [raiseHandList]);
25
41
 
26
42
  React.useEffect(() => {
27
43
  // On unmount update the timestamp, if the user was already active in this view
@@ -33,31 +49,29 @@ const CurrentLiveStreamRequestsView = (props: any) => {
33
49
  return (
34
50
  <>
35
51
  <ParticipantSectionTitle
36
- title="Streaming Request "
52
+ title={raisedHandsListTitleLabel + ' '}
37
53
  count={Object.keys(activeLiveStreamRequests).length}
38
54
  />
39
55
  <View style={p_style.participantContainer}>
40
- {Object.keys(currLiveStreamRequest).length == 0 ||
56
+ {Object.keys(raiseHandList).length == 0 ||
41
57
  Object.keys(activeLiveStreamRequests).length == 0 ? (
42
- <Text style={p_style.infoText}>No streaming request(s)</Text>
58
+ <Text style={p_style.infoText}>{noLiveStreamingRequestsLabel}</Text>
43
59
  ) : (
44
60
  Object.keys(activeLiveStreamRequests).map(
45
61
  (userUID: any, index: number) =>
46
- userList[userUID] ? (
62
+ renderList[userUID] ? (
47
63
  <View style={p_style.participantRow} key={index}>
48
- <ParticipantName value={userList[userUID]?.name || 'User'} />
64
+ <ParticipantName
65
+ value={renderList[userUID]?.name || remoteUserDefaultLabel}
66
+ />
49
67
  <View style={p_style.participantActionContainer}>
50
- <RemoteLiveStreamRequestApprove
51
- user={{...userList[userUID], uid: userUID}}
52
- />
53
- <RemoteLiveStreamRequestReject
54
- user={{...userList[userUID], uid: userUID}}
55
- />
68
+ <RemoteLiveStreamRequestApprove uid={userUID} />
69
+ <RemoteLiveStreamRequestReject uid={userUID} />
56
70
  </View>
57
71
  </View>
58
72
  ) : (
59
73
  <View style={p_style.participantRow} key={index}>
60
- <ParticipantName value={'User not found'} />
74
+ <ParticipantName value={noUserFoundLabel} />
61
75
  </View>
62
76
  ),
63
77
  )
@@ -11,34 +11,48 @@
11
11
  */
12
12
  import React, {useContext} from 'react';
13
13
  import {StyleSheet} from 'react-native';
14
- import LiveStreamContext from '../../../components/livestream';
14
+ import LiveStreamContext, {
15
+ RaiseHandValue,
16
+ } from '../../../components/livestream';
15
17
  import {PropsContext} from '../../../../agora-rn-uikit';
16
18
  import {BtnTemplate} from '../../../../agora-rn-uikit';
17
19
  import icons from '../../../assets/icons';
20
+ import {useString} from '../../../utils/useString';
21
+ import ChatContext from '../../../components/ChatContext';
18
22
 
19
23
  const LocalRaiseHand = () => {
20
24
  const {styleProps} = useContext(PropsContext);
21
- const {audienceSendsRequest, audienceRecallsRequest, raiseHandRequestActive} =
25
+ const {audienceSendsRequest, audienceRecallsRequest, raiseHandList} =
22
26
  useContext(LiveStreamContext);
27
+ const {localUid} = useContext(ChatContext);
23
28
  const {localBtnStyles} = styleProps || {};
24
29
  const {theme} = styleProps || {};
25
30
  const {muteLocalAudio} = localBtnStyles || {};
26
-
31
+ //commented for v1 release
32
+ //const handStatusText = useString<boolean>('raiseHandButton');
33
+ const handStatusText = (toggle: boolean) =>
34
+ toggle ? 'Lower hand' : 'Raise Hand';
27
35
  return (
28
36
  <BtnTemplate
29
37
  icon={icons['raiseHandIcon']}
30
- btnText={raiseHandRequestActive ? 'Lower hand' : 'Raise Hand'}
31
- color={raiseHandRequestActive ? '#FD0845' : theme}
38
+ btnText={handStatusText(
39
+ raiseHandList[localUid]?.raised === RaiseHandValue.TRUE,
40
+ )}
41
+ color={
42
+ raiseHandList[localUid]?.raised === RaiseHandValue.TRUE
43
+ ? '#FD0845'
44
+ : theme
45
+ }
32
46
  style={{
33
47
  ...style.localBtn,
34
48
  ...(localBtnStyles as object),
35
49
  ...(muteLocalAudio as object),
36
50
  }}
37
51
  onPress={() => {
38
- if (!raiseHandRequestActive) {
39
- audienceSendsRequest();
40
- } else {
52
+ if (raiseHandList[localUid]?.raised === RaiseHandValue.TRUE) {
41
53
  audienceRecallsRequest();
54
+ } else {
55
+ audienceSendsRequest();
42
56
  }
43
57
  }}
44
58
  />
@@ -1,17 +1,22 @@
1
- import React, {useContext} from 'react';
2
- import ChatContext from '../../../components/ChatContext';
3
- import {BtnTemplate} from '../../../../agora-rn-uikit';
1
+ import React from 'react';
2
+ import {BtnTemplate, UidType} from '../../../../agora-rn-uikit';
4
3
  import {LiveStreamControlMessageEnum} from '../../../components/livestream';
5
4
  import icons from '../../../assets/icons';
5
+ import CustomEvents from '../../../custom-events';
6
6
 
7
- const RemoteLiveStreamApprovedRequestRecall = (props: {uid: number}) => {
8
- const {sendControlMessageToUid} = useContext(ChatContext);
7
+ export interface RemoteLiveStreamApprovedRequestRecallProps {
8
+ uid: UidType;
9
+ }
10
+ const RemoteLiveStreamApprovedRequestRecall = (
11
+ props: RemoteLiveStreamApprovedRequestRecallProps,
12
+ ) => {
9
13
  return (
10
14
  <BtnTemplate
11
15
  style={{width: 24, height: 22}}
12
16
  onPress={() => {
13
- sendControlMessageToUid(
14
- LiveStreamControlMessageEnum.raiseHandApprovedRequestRecall,
17
+ CustomEvents.send(
18
+ LiveStreamControlMessageEnum.raiseHandRequestRejected,
19
+ {},
15
20
  props.uid,
16
21
  );
17
22
  }}
@@ -1,38 +1,35 @@
1
1
  import React, {useContext} from 'react';
2
2
  import {View} from 'react-native';
3
- import {
4
- BtnTemplate,
5
- PropsContext,
6
- UidInterface,
7
- } from '../../../../agora-rn-uikit';
3
+ import {BtnTemplate, PropsContext, UidType} from '../../../../agora-rn-uikit';
8
4
  import LiveStreamContext from '../../../components/livestream';
9
5
  import icons from '../../../assets/icons';
10
6
 
11
- interface RemoteLiveStreamControlInterface {
12
- user: UidInterface;
7
+ export interface RemoteLiveStreamControlInterface {
8
+ uid: UidType;
13
9
  }
14
10
 
15
- const RemoteLiveStreamRequestApprove: React.FC<RemoteLiveStreamControlInterface> =
16
- (props) => {
17
- const {user} = props;
18
- const {hostApprovesRequestOfUID} = useContext(LiveStreamContext);
19
- const {styleProps} = useContext(PropsContext);
20
- const {remoteBtnStyles} = styleProps || {};
11
+ const RemoteLiveStreamRequestApprove = (
12
+ props: RemoteLiveStreamControlInterface,
13
+ ) => {
14
+ const {uid} = props;
15
+ const {hostApprovesRequestOfUID} = useContext(LiveStreamContext);
16
+ const {styleProps} = useContext(PropsContext);
17
+ const {remoteBtnStyles} = styleProps || {};
21
18
 
22
- const {liveStreamHostControlBtns} = remoteBtnStyles || {};
19
+ const {liveStreamHostControlBtns} = remoteBtnStyles || {};
23
20
 
24
- return (
25
- <View style={{...(liveStreamHostControlBtns as object), marginRight: 15}}>
26
- <BtnTemplate
27
- disabled={!user?.uid}
28
- icon={icons['checkCircleIcon']}
29
- style={{...(liveStreamHostControlBtns as object)}}
30
- onPress={() => {
31
- hostApprovesRequestOfUID(user?.uid);
32
- }}
33
- />
34
- </View>
35
- );
36
- };
21
+ return (
22
+ <View style={{...(liveStreamHostControlBtns as object), marginRight: 15}}>
23
+ <BtnTemplate
24
+ disabled={!uid}
25
+ icon={icons['checkCircleIcon']}
26
+ style={{...(liveStreamHostControlBtns as object)}}
27
+ onPress={() => {
28
+ hostApprovesRequestOfUID(uid);
29
+ }}
30
+ />
31
+ </View>
32
+ );
33
+ };
37
34
 
38
35
  export default RemoteLiveStreamRequestApprove;
@@ -1,37 +1,34 @@
1
1
  import React, {useContext} from 'react';
2
2
  import {View} from 'react-native';
3
- import {
4
- BtnTemplate,
5
- PropsContext,
6
- UidInterface,
7
- } from '../../../../agora-rn-uikit';
3
+ import {BtnTemplate, PropsContext, UidType} from '../../../../agora-rn-uikit';
8
4
  import LiveStreamContext from '../../../components/livestream';
9
5
  import icons from '../../../assets/icons';
10
6
 
11
7
  interface RemoteLiveStreamControlInterface {
12
- user: UidInterface;
8
+ uid: UidType;
13
9
  }
14
10
 
15
- const RemoteLiveStreamRequestReject: React.FC<RemoteLiveStreamControlInterface> =
16
- (props) => {
17
- const {user} = props;
18
- const {hostRejectsRequestOfUID} = useContext(LiveStreamContext);
19
- const {styleProps} = useContext(PropsContext);
20
- const {remoteBtnStyles} = styleProps || {};
21
- const {liveStreamHostControlBtns} = remoteBtnStyles || {};
11
+ const RemoteLiveStreamRequestReject = (
12
+ props: RemoteLiveStreamControlInterface,
13
+ ) => {
14
+ const {uid} = props;
15
+ const {hostRejectsRequestOfUID} = useContext(LiveStreamContext);
16
+ const {styleProps} = useContext(PropsContext);
17
+ const {remoteBtnStyles} = styleProps || {};
18
+ const {liveStreamHostControlBtns} = remoteBtnStyles || {};
22
19
 
23
- return (
24
- <View style={{...(liveStreamHostControlBtns as object)}}>
25
- <BtnTemplate
26
- disabled={!user?.uid}
27
- icon={icons['crossCircleIcon']}
28
- style={{...(liveStreamHostControlBtns as object)}}
29
- onPress={() => {
30
- hostRejectsRequestOfUID(user.uid);
31
- }}
32
- />
33
- </View>
34
- );
35
- };
20
+ return (
21
+ <View style={{...(liveStreamHostControlBtns as object)}}>
22
+ <BtnTemplate
23
+ disabled={!uid}
24
+ icon={icons['crossCircleIcon']}
25
+ style={{...(liveStreamHostControlBtns as object)}}
26
+ onPress={() => {
27
+ hostRejectsRequestOfUID(uid);
28
+ }}
29
+ />
30
+ </View>
31
+ );
32
+ };
36
33
 
37
34
  export default RemoteLiveStreamRequestReject;
@@ -1,6 +1,10 @@
1
1
  // Remote controls
2
- import RemoteLiveStreamApprovedRequestRecall from './controls/RemoteLiveStreamApprovedRequestRecall';
3
- import RemoteLiveStreamRequestApprove from './controls/RemoteLiveStreamRequestApprove';
2
+ import RemoteLiveStreamApprovedRequestRecall, {
3
+ RemoteLiveStreamApprovedRequestRecallProps,
4
+ } from './controls/RemoteLiveStreamApprovedRequestRecall';
5
+ import RemoteLiveStreamRequestApprove, {
6
+ RemoteLiveStreamControlInterface,
7
+ } from './controls/RemoteLiveStreamRequestApprove';
4
8
  import RemoteLiveStreamRequestReject from './controls/RemoteLiveStreamRequestReject';
5
9
  // Local controls
6
10
  import LocalRaiseHand from './controls/LocalRaiseHand';
@@ -8,6 +12,10 @@ import LocalRaiseHand from './controls/LocalRaiseHand';
8
12
  import CurrentLiveStreamRequestsView from './CurrentLiveStreamRequestsView';
9
13
  import ApprovedLiveStreamControlsView from './ApprovedLiveStreamControlsView';
10
14
 
15
+ export type {
16
+ RemoteLiveStreamApprovedRequestRecallProps,
17
+ RemoteLiveStreamControlInterface,
18
+ };
11
19
  export {
12
20
  RemoteLiveStreamApprovedRequestRecall,
13
21
  RemoteLiveStreamRequestApprove,