agora-appbuilder-core 3.0.10 → 3.0.11

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 (248) hide show
  1. package/Readme.md +0 -6
  2. package/package.json +2 -2
  3. package/template/_package-lock.json +4719 -5862
  4. package/template/agora-rn-uikit/src/Contexts/LocalUserContext.tsx +0 -4
  5. package/template/agora-rn-uikit/src/Contexts/PropsContext.tsx +0 -18
  6. package/template/agora-rn-uikit/src/Contexts/RtcContext.tsx +0 -2
  7. package/template/agora-rn-uikit/src/Controls/BtnTemplate.tsx +26 -30
  8. package/template/agora-rn-uikit/src/Controls/Icons.ts +83 -30
  9. package/template/agora-rn-uikit/src/Controls/ImageIcon.tsx +6 -6
  10. package/template/agora-rn-uikit/src/Reducer/LocalMuteAudio.ts +0 -1
  11. package/template/agora-rn-uikit/src/Reducer/LocalMuteVideo.ts +0 -1
  12. package/template/agora-rn-uikit/src/Reducer/RemoteAudioStateChanged.ts +0 -1
  13. package/template/agora-rn-uikit/src/Reducer/RemoteVideoStateChanged.ts +0 -1
  14. package/template/agora-rn-uikit/src/Reducer/UpdateDualStreamMode.ts +0 -1
  15. package/template/agora-rn-uikit/src/Reducer/UserJoined.ts +0 -2
  16. package/template/agora-rn-uikit/src/Reducer/UserMuteRemoteAudio.ts +0 -1
  17. package/template/agora-rn-uikit/src/Reducer/UserMuteRemoteVideo.ts +0 -1
  18. package/template/agora-rn-uikit/src/Reducer/UserOffline.ts +0 -1
  19. package/template/agora-rn-uikit/src/Reducer/index.ts +0 -3
  20. package/template/agora-rn-uikit/src/Rtc/Create.tsx +1 -89
  21. package/template/agora-rn-uikit/src/RtcConfigure.tsx +2 -39
  22. package/template/agora-rn-uikit/src/Views/MaxVideoView.native.tsx +5 -15
  23. package/template/agora-rn-uikit/src/Views/MaxVideoView.tsx +9 -15
  24. package/template/agora-rn-uikit/src/index.ts +1 -3
  25. package/template/android/app/build.gradle +0 -1
  26. package/template/android/app/src/main/AndroidManifest.xml +15 -22
  27. package/template/android/app/src/main/java/com/helloworld/MainActivity.java +0 -50
  28. package/template/android/build.gradle +3 -3
  29. package/template/babel.config.js +0 -1
  30. package/template/bridge/rtc/webNg/RtcEngine.ts +17 -110
  31. package/template/customization-api/sub-components.ts +1 -1
  32. package/template/customization-api/typeDefinition.ts +1 -2
  33. package/template/electron/index.html +27 -27
  34. package/template/electron/renderer/index.js +0 -1
  35. package/template/global.d.ts +4 -25
  36. package/template/index.rsdk.tsx +0 -1
  37. package/template/index.web.js +1 -2
  38. package/template/index.wsdk.tsx +1 -1
  39. package/template/ios/HelloWorld/Info.plist +1 -14
  40. package/template/ios/HelloWorld.xcodeproj/project.pbxproj +0 -17
  41. package/template/metro.config.js +1 -1
  42. package/template/package.json +7 -18
  43. package/template/react-native-toast-message/index.d.ts +43 -43
  44. package/template/react-native-toast-message/src/colors/index.js +2 -3
  45. package/template/react-native-toast-message/src/components/base/index.js +59 -46
  46. package/template/react-native-toast-message/src/components/base/styles.js +32 -16
  47. package/template/react-native-toast-message/src/components/error.js +2 -3
  48. package/template/react-native-toast-message/src/components/info.js +2 -3
  49. package/template/react-native-toast-message/src/components/success.js +2 -3
  50. package/template/react-native-toast-message/src/index.js +31 -122
  51. package/template/react-native-toast-message/src/index.sdk.tsx +35 -125
  52. package/template/react-native-toast-message/src/styles.js +4 -3
  53. package/template/react-native-toast-message/src/styles.sdk.ts +4 -3
  54. package/template/src/App.tsx +0 -6
  55. package/template/src/AppWrapper.tsx +28 -63
  56. package/template/src/assets/icons.ts +102 -0
  57. package/template/src/atoms/HorizontalRule.tsx +1 -3
  58. package/template/src/atoms/PrimaryButton.tsx +26 -51
  59. package/template/src/atoms/SecondaryButton.tsx +5 -8
  60. package/template/src/atoms/TextInput.tsx +14 -12
  61. package/template/src/components/Chat.tsx +214 -86
  62. package/template/src/components/ChatContext.ts +1 -8
  63. package/template/src/components/ColorConfigure.tsx +1 -1
  64. package/template/src/components/ColorContext.ts +1 -1
  65. package/template/src/components/{Controls1.native.tsx → Controls.native.tsx} +4 -6
  66. package/template/src/components/Controls.tsx +42 -342
  67. package/template/src/components/DeviceConfigure.tsx +101 -461
  68. package/template/src/components/DeviceContext.tsx +4 -8
  69. package/template/src/components/EventsConfigure.tsx +7 -144
  70. package/template/src/components/GraphQLProvider.tsx +1 -1
  71. package/template/src/components/GridVideo.tsx +44 -59
  72. package/template/src/components/HostControlView.tsx +35 -114
  73. package/template/src/components/Navbar.tsx +398 -216
  74. package/template/src/components/NetworkQualityContext.tsx +20 -20
  75. package/template/src/components/ParticipantsView.tsx +154 -177
  76. package/template/src/components/PinnedVideo.tsx +120 -207
  77. package/template/src/components/Precall.native.tsx +119 -358
  78. package/template/src/components/Precall.tsx +135 -269
  79. package/template/src/components/RTMConfigure.tsx +4 -27
  80. package/template/src/components/Router.electron.ts +0 -1
  81. package/template/src/components/Router.native.ts +0 -1
  82. package/template/src/components/Router.sdk.ts +0 -1
  83. package/template/src/components/Router.ts +0 -1
  84. package/template/src/components/Settings.tsx +95 -26
  85. package/template/src/components/SettingsView.tsx +56 -251
  86. package/template/src/components/Share.tsx +273 -302
  87. package/template/src/components/StorageContext.tsx +3 -30
  88. package/template/src/components/chat-messages/useChatMessages.tsx +23 -69
  89. package/template/src/components/chat-ui/useChatUIControl.tsx +0 -7
  90. package/template/src/components/common/Error.tsx +6 -20
  91. package/template/src/components/common/Logo.tsx +15 -16
  92. package/template/src/components/contexts/LiveStreamDataContext.tsx +5 -10
  93. package/template/src/components/contexts/VideoMeetingDataContext.tsx +7 -37
  94. package/template/src/components/livestream/LiveStreamContext.tsx +36 -270
  95. package/template/src/components/livestream/Types.ts +14 -39
  96. package/template/src/components/livestream/index.ts +0 -1
  97. package/template/src/components/livestream/views/LiveStreamControls.tsx +4 -12
  98. package/template/src/components/participants/AllAudienceParticipants.tsx +30 -101
  99. package/template/src/components/participants/AllHostParticipants.tsx +34 -103
  100. package/template/src/components/participants/MeParticipant.tsx +38 -0
  101. package/template/src/components/participants/ParticipantName.tsx +7 -13
  102. package/template/src/components/participants/ParticipantSectionTitle.tsx +10 -35
  103. package/template/src/components/participants/RemoteParticipants.tsx +71 -0
  104. package/template/src/components/participants/ScreenshareParticipants.tsx +12 -144
  105. package/template/src/components/precall/{LocalMute1.native.tsx → LocalMute.native.tsx} +5 -21
  106. package/template/src/components/precall/LocalMute.tsx +14 -84
  107. package/template/src/components/precall/VideoPreview.native.tsx +3 -48
  108. package/template/src/components/precall/VideoPreview.tsx +7 -163
  109. package/template/src/components/precall/joinCallBtn.tsx +2 -15
  110. package/template/src/components/precall/meetingTitle.tsx +12 -15
  111. package/template/src/components/precall/selectDevice.tsx +21 -1
  112. package/template/src/components/precall/textInput.tsx +4 -32
  113. package/template/src/components/precall/usePreCall.tsx +0 -16
  114. package/template/src/components/styles.ts +21 -42
  115. package/template/src/components/useShareLink.tsx +14 -12
  116. package/template/src/language/default-labels/precallScreenLabels.ts +3 -3
  117. package/template/src/pages/Authenticate.tsx +15 -5
  118. package/template/src/pages/Create.tsx +165 -293
  119. package/template/src/pages/Join.tsx +67 -93
  120. package/template/src/pages/VideoCall.tsx +64 -89
  121. package/template/src/pages/video-call/DefaultLayouts.ts +4 -4
  122. package/template/src/pages/video-call/NameWithMicIcon.tsx +44 -120
  123. package/template/src/pages/video-call/RenderComponent.tsx +2 -3
  124. package/template/src/pages/video-call/VideoCallScreen.tsx +9 -45
  125. package/template/src/pages/video-call/VideoComponent.tsx +3 -18
  126. package/template/src/pages/video-call/VideoRenderer.tsx +60 -218
  127. package/template/src/rtm-events/constants.ts +0 -2
  128. package/template/src/subComponents/ChatBubble.tsx +83 -123
  129. package/template/src/subComponents/ChatContainer.tsx +84 -257
  130. package/template/src/subComponents/ChatInput.tsx +46 -61
  131. package/template/src/subComponents/Checkbox.native.tsx +5 -16
  132. package/template/src/subComponents/Checkbox.tsx +2 -2
  133. package/template/src/subComponents/CopyJoinInfo.tsx +58 -36
  134. package/template/src/subComponents/FallbackLogo.tsx +40 -122
  135. package/template/src/subComponents/LanguageSelector.tsx +1 -1
  136. package/template/src/subComponents/{LayoutIconDropdown1.native.tsx → LayoutIconDropdown.native.tsx} +18 -4
  137. package/template/src/subComponents/LayoutIconDropdown.tsx +134 -131
  138. package/template/src/subComponents/LocalAudioMute.tsx +27 -119
  139. package/template/src/subComponents/LocalEndCall.tsx +33 -71
  140. package/template/src/subComponents/LocalSwitchCamera.tsx +30 -17
  141. package/template/src/subComponents/LocalVideoMute.tsx +27 -117
  142. package/template/src/subComponents/Logo.tsx +4 -3
  143. package/template/src/subComponents/LogoutButton.tsx +1 -1
  144. package/template/src/subComponents/NetworkQualityPill.tsx +63 -60
  145. package/template/src/subComponents/OpenInNativeButton.tsx +3 -3
  146. package/template/src/subComponents/Recording.tsx +29 -28
  147. package/template/src/subComponents/RemoteAudioMute.tsx +29 -83
  148. package/template/src/subComponents/RemoteEndCall.tsx +5 -8
  149. package/template/src/subComponents/RemoteVideoMute.tsx +21 -74
  150. package/template/src/subComponents/ScreenShareNotice.tsx +8 -83
  151. package/template/src/subComponents/SelectDevice.tsx +61 -404
  152. package/template/src/subComponents/SelectOAuth.tsx +8 -9
  153. package/template/src/subComponents/ToastConfig.tsx +10 -150
  154. package/template/src/subComponents/chat/ChatParticipants.tsx +78 -187
  155. package/template/src/subComponents/livestream/CurrentLiveStreamRequestsView.tsx +32 -95
  156. package/template/src/subComponents/livestream/controls/LocalRaiseHand.tsx +33 -29
  157. package/template/src/subComponents/livestream/controls/RemoteLiveStreamApprovedRequestRecall.tsx +6 -6
  158. package/template/src/subComponents/livestream/controls/RemoteLiveStreamRequestApprove.tsx +11 -24
  159. package/template/src/subComponents/livestream/controls/RemoteLiveStreamRequestReject.tsx +10 -17
  160. package/template/src/subComponents/recording/useRecording.tsx +27 -79
  161. package/template/src/subComponents/screenshare/ScreenshareButton.tsx +70 -52
  162. package/template/src/subComponents/screenshare/ScreenshareConfigure.native.tsx +2 -11
  163. package/template/src/subComponents/screenshare/ScreenshareConfigure.tsx +4 -26
  164. package/template/src/utils/common.tsx +1 -155
  165. package/template/src/utils/index.tsx +0 -19
  166. package/template/src/utils/isMobileOrTablet.ts +2 -7
  167. package/template/src/utils/useButtonTemplate.tsx +0 -1
  168. package/template/src/utils/useMuteToggleLocal.ts +3 -54
  169. package/template/web/index.html +0 -5
  170. package/template/webpack.commons.js +8 -13
  171. package/template/webpack.web.config.js +0 -1
  172. package/template/agora-rn-uikit/src/Reducer/ActiveSpeakerDetected.ts +0 -11
  173. package/template/agora-rn-uikit/src/Reducer/LocalPermissionState.ts +0 -24
  174. package/template/agora-rn-uikit/src/Reducer/UserPin.ts +0 -11
  175. package/template/android/app/src/main/assets/fonts/SourceSansPro-Regular.ttf +0 -0
  176. package/template/android/app/src/main/assets/fonts/icomoon.ttf +0 -0
  177. package/template/android/app/src/main/res/values/colors.xml +0 -7
  178. package/template/react-native-toast-message/src/components/checkbox.js +0 -178
  179. package/template/react-native.config.js +0 -7
  180. package/template/src/assets/font-styles.css +0 -329
  181. package/template/src/assets/fonts/SourceSansPro-Regular.ttf +0 -0
  182. package/template/src/assets/fonts/icomoon.ttf +0 -0
  183. package/template/src/assets/permission.png +0 -0
  184. package/template/src/assets/selection.json +0 -1
  185. package/template/src/atoms/ActionMenu.tsx +0 -236
  186. package/template/src/atoms/AnimatedActiveSpeaker.native.tsx +0 -71
  187. package/template/src/atoms/AnimatedActiveSpeaker.tsx +0 -84
  188. package/template/src/atoms/AnimatedRings.native.tsx +0 -68
  189. package/template/src/atoms/AnimatedRings.tsx +0 -70
  190. package/template/src/atoms/Card.tsx +0 -61
  191. package/template/src/atoms/CircularProgress.native.tsx +0 -121
  192. package/template/src/atoms/CircularProgress.tsx +0 -102
  193. package/template/src/atoms/CustomIcon.tsx +0 -88
  194. package/template/src/atoms/CustomSwitch.tsx +0 -287
  195. package/template/src/atoms/Dropdown.tsx +0 -306
  196. package/template/src/atoms/IconButton.tsx +0 -162
  197. package/template/src/atoms/ImageIcon.tsx +0 -98
  198. package/template/src/atoms/InfoBubble.tsx +0 -291
  199. package/template/src/atoms/Input.tsx +0 -87
  200. package/template/src/atoms/InviteInfo.tsx +0 -166
  201. package/template/src/atoms/LinkButton.tsx +0 -28
  202. package/template/src/atoms/OutlineButton.tsx +0 -61
  203. package/template/src/atoms/ParticipantsCount.tsx +0 -73
  204. package/template/src/atoms/Popup.tsx +0 -147
  205. package/template/src/atoms/RecordingInfo.tsx +0 -49
  206. package/template/src/atoms/Spacer.tsx +0 -22
  207. package/template/src/atoms/TertiaryButton.tsx +0 -78
  208. package/template/src/atoms/Toggle.tsx +0 -47
  209. package/template/src/atoms/Tooltip.native.tsx +0 -65
  210. package/template/src/atoms/Tooltip.tsx +0 -94
  211. package/template/src/atoms/UserAvatar.tsx +0 -60
  212. package/template/src/components/CommonStyles.ts +0 -44
  213. package/template/src/components/ToastComponent.tsx +0 -8
  214. package/template/src/components/participants/Participant.tsx +0 -302
  215. package/template/src/components/participants/UserActionMenuOptions.tsx +0 -398
  216. package/template/src/components/popups/InvitePopup.tsx +0 -115
  217. package/template/src/components/popups/StopRecordingPopup.tsx +0 -114
  218. package/template/src/components/precall/PermissionHelper.native.tsx +0 -5
  219. package/template/src/components/precall/PermissionHelper.tsx +0 -126
  220. package/template/src/components/precall/PreCallSettings.tsx +0 -52
  221. package/template/src/components/useToast.tsx +0 -41
  222. package/template/src/components/useVideoCall.tsx +0 -65
  223. package/template/src/pages/Endcall.tsx +0 -148
  224. package/template/src/pages/video-call/ActionSheet.native.tsx +0 -215
  225. package/template/src/pages/video-call/ActionSheet.tsx +0 -226
  226. package/template/src/pages/video-call/ActionSheetContent.tsx +0 -479
  227. package/template/src/pages/video-call/ActionSheetHandle.tsx +0 -38
  228. package/template/src/pages/video-call/ActionSheetStyles.css +0 -138
  229. package/template/src/pages/video-call/SidePanelHeader.tsx +0 -190
  230. package/template/src/pages/video-call/VideoCallMobileView.tsx +0 -139
  231. package/template/src/pages/video-call/VideoCallScreen.native.tsx +0 -37
  232. package/template/src/subComponents/ChatInput.ios.tsx +0 -237
  233. package/template/src/subComponents/EndcallPopup.tsx +0 -107
  234. package/template/src/subComponents/LayoutIconButton.tsx +0 -201
  235. package/template/src/subComponents/RemoteMutePopup.tsx +0 -193
  236. package/template/src/subComponents/RemoveMeetingPopup.tsx +0 -109
  237. package/template/src/subComponents/RemoveScreensharePopup.tsx +0 -109
  238. package/template/src/subComponents/SelectDeviceSettings.backup.tsx +0 -207
  239. package/template/src/subComponents/SidePanelHeader.tsx +0 -112
  240. package/template/src/theme/index.ts +0 -46
  241. package/template/src/utils/PlatformWrapper.tsx +0 -21
  242. package/template/src/utils/hexadecimalTransparency.ts +0 -108
  243. package/template/src/utils/pendingStateUpdateHelper.ts +0 -19
  244. package/template/src/utils/useFocus.tsx +0 -46
  245. package/template/src/utils/useIsActiveSpeaker.ts +0 -27
  246. package/template/src/utils/useIsHandRaised.ts +0 -13
  247. package/template/src/utils/useRemoteEndScreenshare.ts +0 -26
  248. package/template/src/utils/useRemoteRequest.ts +0 -84
@@ -9,151 +9,61 @@
9
9
  information visit https://appbuilder.agora.io.
10
10
  *********************************************
11
11
  */
12
- import React, {useContext} from 'react';
12
+ import React from 'react';
13
13
  import {
14
+ BtnTemplate,
14
15
  ToggleState,
15
- PermissionState,
16
- ImageIcon as UIKitImageIcon,
17
- ClientRole,
18
- PropsContext,
16
+ BtnTemplateInterface,
19
17
  } from '../../agora-rn-uikit';
20
18
  import useMuteToggleLocal, {MUTE_LOCAL_TYPE} from '../utils/useMuteToggleLocal';
21
19
  import Styles from '../components/styles';
20
+ import {
21
+ ButtonTemplateName,
22
+ useButtonTemplate,
23
+ } from '../utils/useButtonTemplate';
22
24
  import {useString} from '../utils/useString';
23
- import {useLocalUserInfo, useMeetingInfo} from 'customization-api';
24
- import IconButton, {IconButtonProps} from '../atoms/IconButton';
25
- import ThemeConfig from '../theme';
26
- import {ImageIconProps} from '../atoms/ImageIcon';
27
- import useIsHandRaised from '../utils/useIsHandRaised';
25
+ import {useLocalUserInfo} from 'customization-api';
26
+
28
27
  /**
29
28
  * A component to mute / unmute the local video
30
29
  */
31
30
  export interface LocalVideoMuteProps {
32
- plainIconHoverEffect?: boolean;
33
- showToolTip?: boolean;
34
- showLabel?: boolean;
35
- render?: (onPress: () => void, isVideoEnabled: boolean) => JSX.Element;
36
- disabled?: boolean;
37
- isOnActionSheet?: boolean;
38
- iconProps?: (
31
+ buttonTemplateName?: ButtonTemplateName;
32
+ render?: (
33
+ onPress: () => void,
39
34
  isVideoEnabled: boolean,
40
- isPermissionDenied: boolean,
41
- ) => Partial<ImageIconProps>;
42
- showWarningIcon?: boolean;
43
- isMobileView?: boolean;
35
+ buttonTemplateName?: ButtonTemplateName,
36
+ ) => JSX.Element;
44
37
  }
45
38
 
46
39
  function LocalVideoMute(props: LocalVideoMuteProps) {
47
- const {rtcProps} = useContext(PropsContext);
48
- const {
49
- data: {isHost},
50
- } = useMeetingInfo();
51
40
  const local = useLocalUserInfo();
52
- const isHandRaised = useIsHandRaised();
53
41
  const localMute = useMuteToggleLocal();
54
- const {
55
- showToolTip = false,
56
- showLabel = $config.ICON_TEXT,
57
- disabled = false,
58
- isOnActionSheet = false,
59
- showWarningIcon = true,
60
- isMobileView = false,
61
- } = props;
62
42
  //commented for v1 release
63
43
  //const videoLabel = useString('toggleVideoButton')();
64
-
44
+ const videoLabel = 'Video';
45
+ const defaultTemplateValue = useButtonTemplate().buttonTemplateName;
46
+ const {buttonTemplateName = defaultTemplateValue} = props;
65
47
  const onPress = () => {
66
48
  localMute(MUTE_LOCAL_TYPE.video);
67
49
  };
68
50
  const isVideoEnabled = local.video === ToggleState.enabled;
69
-
70
- const permissionDenied =
71
- local.permissionStatus === PermissionState.REJECTED ||
72
- local.permissionStatus === PermissionState.GRANTED_FOR_MIC_ONLY;
73
-
74
- const videoLabel = permissionDenied
75
- ? 'Video'
76
- : isVideoEnabled
77
- ? 'Video On'
78
- : 'Video Off';
79
-
80
- let iconProps: IconButtonProps['iconProps'] = {
81
- showWarningIcon: permissionDenied && showWarningIcon ? true : false,
82
- name: isVideoEnabled ? 'video-on' : 'video-off',
83
- iconBackgroundColor: isVideoEnabled
84
- ? $config.PRIMARY_ACTION_BRAND_COLOR
85
- : '',
86
- tintColor: isVideoEnabled
87
- ? $config.PRIMARY_ACTION_TEXT_COLOR
88
- : disabled
89
- ? $config.SEMANTIC_NEUTRAL
90
- : permissionDenied
91
- ? $config.SEMANTIC_NEUTRAL
92
- : $config.SEMANTIC_ERROR,
93
- ...(props?.iconProps
94
- ? props.iconProps(isVideoEnabled, permissionDenied)
95
- : {}),
51
+ let btnTemplateProps: BtnTemplateInterface = {
52
+ onPress: onPress,
53
+ name: isVideoEnabled ? 'videocam' : 'videocamOff',
96
54
  };
97
55
 
98
- let iconButtonProps: IconButtonProps = {
99
- hoverEffect: !permissionDenied
100
- ? props?.plainIconHoverEffect
101
- ? true
102
- : false
103
- : false,
104
- hoverEffectStyle: props?.plainIconHoverEffect
105
- ? {backgroundColor: $config.ICON_BG_COLOR, borderRadius: 20}
106
- : {},
107
- onPress,
108
- iconProps,
109
- btnTextProps: {
110
- text: showLabel ? videoLabel : '',
111
- textColor: $config.FONT_COLOR,
112
- },
113
- disabled: permissionDenied || disabled ? true : false,
114
- };
115
-
116
- iconButtonProps.isOnActionSheet = isOnActionSheet;
117
- if (!isMobileView) {
118
- iconButtonProps.toolTipMessage = showToolTip
119
- ? permissionDenied
120
- ? 'Give Permissions'
121
- : isVideoEnabled
122
- ? 'Disable Camera'
123
- : 'Enable Camera'
124
- : '';
56
+ if (buttonTemplateName === ButtonTemplateName.topBar) {
57
+ btnTemplateProps.style = Styles.fullWidthButton as Object;
58
+ } else {
59
+ btnTemplateProps.style = Styles.localButton as Object;
60
+ btnTemplateProps.btnText = videoLabel;
125
61
  }
126
62
 
127
- if (
128
- rtcProps.role == ClientRole.Audience &&
129
- $config.EVENT_MODE &&
130
- !$config.RAISE_HAND
131
- ) {
132
- return null;
133
- }
134
-
135
- if (
136
- rtcProps.role == ClientRole.Audience &&
137
- $config.EVENT_MODE &&
138
- $config.RAISE_HAND &&
139
- !isHost
140
- ) {
141
- iconButtonProps.iconProps = {
142
- ...iconButtonProps.iconProps,
143
- name: 'video-off',
144
- tintColor: $config.SEMANTIC_NEUTRAL,
145
- };
146
- iconButtonProps.toolTipMessage = showToolTip
147
- ? isHandRaised(local.uid)
148
- ? 'Waiting for host to appove the request'
149
- : 'Raise Hand in order to turn video on'
150
- : '';
151
- iconButtonProps.disabled = true;
152
- }
153
63
  return props?.render ? (
154
- props.render(onPress, isVideoEnabled)
64
+ props.render(onPress, isVideoEnabled, buttonTemplateName)
155
65
  ) : (
156
- <IconButton {...iconButtonProps} />
66
+ <BtnTemplate {...btnTemplateProps} />
157
67
  );
158
68
  }
159
69
 
@@ -20,7 +20,7 @@ export default function Logo() {
20
20
  const history = useHistory();
21
21
 
22
22
  return (
23
- <TouchableOpacity onPress={() => history.replace('/')}>
23
+ <TouchableOpacity onPress={() => history.replace('/')} style={styles.marginAuto}>
24
24
  <Image
25
25
  source={{uri: $config.LOGO}}
26
26
  style={styles.logo}
@@ -32,8 +32,8 @@ export default function Logo() {
32
32
 
33
33
  const styles = StyleSheet.create({
34
34
  logo: {
35
- minWidth: 60,
36
- minHeight: 30,
35
+ width: '100%',
36
+ height: '100%',
37
37
  },
38
38
  marginAuto: {
39
39
  width: '30%',
@@ -41,5 +41,6 @@ const styles = StyleSheet.create({
41
41
  minWidth: 60,
42
42
  minHeight: 30,
43
43
  // height: 'auto',
44
+ marginHorizontal: 'auto',
44
45
  },
45
46
  });
@@ -87,7 +87,7 @@ const style = StyleSheet.create({
87
87
  fontWeight: '500',
88
88
  textAlign: 'center',
89
89
  textAlignVertical: 'center',
90
- color: $config.FONT_COLOR,
90
+ color: $config.PRIMARY_FONT_COLOR,
91
91
  textDecorationLine: 'underline',
92
92
  },
93
93
  });
@@ -1,3 +1,4 @@
1
+ // @ts-nocheck
1
2
  import React, {useContext, useState} from 'react';
2
3
  import {
3
4
  View,
@@ -11,15 +12,10 @@ import {
11
12
  } from 'react-native';
12
13
  import {useString} from '../utils/useString';
13
14
  import {networkIconsObject} from '../components/NetworkQualityContext';
14
- //import {NetworkQualities} from 'src/language/default-labels/videoCallScreenLabels';
15
- import {isMobileUA, isWebInternal} from '../utils/common';
15
+ import {NetworkQualities} from 'src/language/default-labels/videoCallScreenLabels';
16
+ import {isWebInternal} from '../utils/common';
16
17
  import NetworkQualityContext from '../components/NetworkQualityContext';
17
18
  import {RenderInterface, UidType} from '../../agora-rn-uikit';
18
- import ThemeConfig from '../theme';
19
- import ImageIcon from '../atoms/ImageIcon';
20
- import hexadecimalTransparency from '../utils/hexadecimalTransparency';
21
- import {useLayout, useRender} from 'customization-api';
22
- import {getGridLayoutName} from '../pages/video-call/DefaultLayouts';
23
19
 
24
20
  /**
25
21
  *
@@ -33,28 +29,31 @@ import {getGridLayoutName} from '../pages/video-call/DefaultLayouts';
33
29
  */
34
30
  interface NetworkQualityPillProps {
35
31
  user: RenderInterface;
32
+ primaryColor: any;
33
+ small?: boolean;
34
+ rootStyle?: StyleProp<ViewStyle>;
36
35
  }
37
36
  const NetworkQualityPill = (props: NetworkQualityPillProps) => {
38
- const {user} = props;
37
+ const {user, primaryColor, small, rootStyle} = props;
39
38
  const [networkTextVisible, setNetworkTextVisible] = useState(false);
40
39
  //commented for v1 release
41
40
  //const getLabel = useString<NetworkQualities>('networkQualityLabel');
42
41
  const getLabel = (quality: string) => {
43
42
  switch (quality) {
44
43
  case 'unknown':
45
- return 'Network Unsupported';
44
+ return 'Unknown';
46
45
  case 'excellent':
47
- return 'Excellent Network';
46
+ return 'Excellent';
48
47
  case 'good':
49
- return 'Good Network';
48
+ return 'Good';
50
49
  case 'bad':
51
- return 'Bad Network';
50
+ return 'Bad';
52
51
  case 'veryBad':
53
- return 'Very Bad Network';
52
+ return 'Very Bad';
54
53
  case 'unpublished':
55
- return 'Network Unpublished';
54
+ return 'Unpublished';
56
55
  case 'loading':
57
- return 'Network Loading';
56
+ return 'Loading';
58
57
  default:
59
58
  return 'Loading';
60
59
  }
@@ -65,48 +64,41 @@ const NetworkQualityPill = (props: NetworkQualityPillProps) => {
65
64
  : user.audio || user.video
66
65
  ? 8
67
66
  : 7;
68
- const {activeUids} = useRender();
69
- const {currentLayout} = useLayout();
70
- const reduceSpace =
71
- isMobileUA() &&
72
- activeUids.length > 4 &&
73
- currentLayout === getGridLayoutName();
67
+
74
68
  return (
75
69
  <View
76
- testID="videocall-networkpill"
77
70
  style={[
78
71
  style.networkPill,
79
- style.rootStyle,
80
72
  {
81
- backgroundColor: networkTextVisible
82
- ? networkIconsObject[networkStat].tint +
83
- hexadecimalTransparency['50%']
84
- : $config.CARD_LAYER_5_COLOR + hexadecimalTransparency['10%'],
73
+ opacity: networkTextVisible ? 1 : 0.8,
85
74
  },
86
- reduceSpace ? {top: 2, right: 2} : {},
75
+ rootStyle,
87
76
  ]}>
88
- <PlatformSpecificWrapper
89
- {...{
90
- networkTextVisible,
91
- setNetworkTextVisible,
92
- reduceSpace,
93
- activeUids,
94
- }}>
95
- <View>
96
- <ImageIcon
97
- iconType="plain"
98
- tintColor={
99
- networkTextVisible
100
- ? $config.PRIMARY_ACTION_TEXT_COLOR
101
- : networkIconsObject[networkStat].tint +
102
- hexadecimalTransparency['30%']
103
- }
104
- name={networkIconsObject[networkStat].icon}
105
- iconSize={16}
77
+ <PlatformSpecificWrapper {...{networkTextVisible, setNetworkTextVisible}}>
78
+ <View style={[style.networkIndicatorBackdrop]}>
79
+ <Image
80
+ source={{
81
+ uri: networkIconsObject[networkStat].icon,
82
+ }}
83
+ style={[
84
+ style.networkIcon,
85
+ {
86
+ tintColor:
87
+ networkIconsObject[networkStat].tint === 'primary'
88
+ ? primaryColor
89
+ : networkIconsObject[networkStat].tint,
90
+ },
91
+ ]}
92
+ resizeMode={'contain'}
106
93
  />
107
94
  </View>
108
95
  {networkTextVisible && (
109
- <Text textBreakStrategy={'simple'} style={style.networkPillText}>
96
+ <Text
97
+ textBreakStrategy={'simple'}
98
+ style={[
99
+ style.networkPillText,
100
+ {fontSize: small ? 14 : 15, userSelect: 'none'},
101
+ ]}>
110
102
  {getLabel(networkIconsObject[networkStat].text)}
111
103
  </Text>
112
104
  )}
@@ -119,8 +111,6 @@ const PlatformSpecificWrapper = ({
119
111
  networkTextVisible,
120
112
  setNetworkTextVisible,
121
113
  children,
122
- reduceSpace,
123
- activeUids,
124
114
  }: any) => {
125
115
  return !isWebInternal() ? (
126
116
  <Pressable
@@ -129,7 +119,6 @@ const PlatformSpecificWrapper = ({
129
119
  display: 'flex',
130
120
  flexDirection: 'row',
131
121
  alignItems: 'center',
132
- padding: reduceSpace && activeUids.length > 12 ? 2 : 8,
133
122
  }}
134
123
  onPress={() => {
135
124
  setNetworkTextVisible((visible: boolean) => !visible);
@@ -143,7 +132,6 @@ const PlatformSpecificWrapper = ({
143
132
  display: 'flex',
144
133
  flexDirection: 'row',
145
134
  alignItems: 'center',
146
- padding: reduceSpace && activeUids.length > 12 ? 2 : 8,
147
135
  }}
148
136
  onClick={(e) => {
149
137
  e.preventDefault();
@@ -162,13 +150,12 @@ const PlatformSpecificWrapper = ({
162
150
 
163
151
  const style = StyleSheet.create({
164
152
  networkPill: {
153
+ height: 30,
154
+ backgroundColor: $config.SECONDARY_FONT_COLOR + 'bb',
165
155
  position: 'absolute',
166
156
  zIndex: 2,
167
- borderRadius: 50,
168
- },
169
- rootStyle: {
170
- top: 8,
171
- right: 8,
157
+ paddingHorizontal: 0,
158
+ borderRadius: 15,
172
159
  },
173
160
  networkPillContent: {
174
161
  display: 'flex',
@@ -176,11 +163,27 @@ const style = StyleSheet.create({
176
163
  alignItems: 'center',
177
164
  },
178
165
  networkPillText: {
179
- color: $config.VIDEO_AUDIO_TILE_TEXT_COLOR,
180
- fontSize: ThemeConfig.FontSize.small,
181
- fontFamily: ThemeConfig.FontFamily.sansPro,
166
+ color: $config.PRIMARY_FONT_COLOR,
167
+ lineHeight: 30,
168
+ fontSize: 15,
182
169
  fontWeight: '600',
183
- marginLeft: 8,
170
+ marginLeft: 5,
171
+ marginRight: 15,
172
+ },
173
+ networkIcon: {
174
+ width: '80%',
175
+ height: '80%',
176
+ alignSelf: 'center',
177
+ },
178
+ networkIndicatorBackdrop: {
179
+ width: 20,
180
+ height: 20,
181
+ borderRadius: 10,
182
+ alignSelf: 'center',
183
+ marginLeft: 5,
184
+ marginRight: 5,
185
+ backgroundColor: $config.SECONDARY_FONT_COLOR,
186
+ justifyContent: 'center',
184
187
  },
185
188
  });
186
189
 
@@ -37,13 +37,13 @@ const OpenInNativeButton = () => {
37
37
 
38
38
  const style = StyleSheet.create({
39
39
  btn: {
40
- backgroundColor: $config.PRIMARY_ACTION_BRAND_COLOR,
40
+ backgroundColor: $config.PRIMARY_COLOR,
41
41
  // width: 110,
42
42
  flex: 1,
43
43
  paddingHorizontal: 10,
44
44
  height: 30,
45
45
  // borderWidth: 1,
46
- // borderColor: $config.PRIMARY_ACTION_BRAND_COLOR,
46
+ // borderColor: $config.PRIMARY_COLOR,
47
47
  borderRadius: 100,
48
48
  // marginTop: 5,
49
49
  // marginRight: 10,
@@ -53,7 +53,7 @@ const style = StyleSheet.create({
53
53
  lineHeight: 29,
54
54
  // fontWeight: '500',
55
55
  textAlign: 'center',
56
- color: $config.SECONDARY_ACTION_COLOR,
56
+ color: $config.SECONDARY_FONT_COLOR,
57
57
  },
58
58
  });
59
59
 
@@ -10,55 +10,56 @@
10
10
  *********************************************
11
11
  */
12
12
  import React from 'react';
13
+ import {BtnTemplate, BtnTemplateInterface} from '../../agora-rn-uikit';
13
14
  import {useRecording} from './recording/useRecording';
14
- import IconButton, {IconButtonProps} from '../atoms/IconButton';
15
- import {useVideoCall} from '../components/useVideoCall';
15
+ import {useString} from '../utils/useString';
16
+ import {
17
+ ButtonTemplateName,
18
+ useButtonTemplate,
19
+ } from '../utils/useButtonTemplate';
20
+ import Styles from '../components/styles';
16
21
 
17
22
  export interface RecordingButtonProps {
18
- showLabel?: boolean;
19
- render?: (onPress: () => void, isRecordingActive: boolean) => JSX.Element;
20
- isOnActionSheet?: boolean;
23
+ buttonTemplateName?: ButtonTemplateName;
24
+ render?: (
25
+ onPress: () => void,
26
+ isRecordingActive: boolean,
27
+ buttonTemplateName?: ButtonTemplateName,
28
+ ) => JSX.Element;
21
29
  }
22
30
 
23
31
  const Recording = (props: RecordingButtonProps) => {
24
- const {startRecording, inProgress, isRecordingActive} = useRecording();
32
+ const {startRecording, stopRecording, isRecordingActive} = useRecording();
25
33
  //commented for v1 release
26
34
  //const recordingButton = useString<boolean>('recordingButton');
27
35
  const recordingButton = (recording: boolean) =>
28
- recording ? 'Stop Rec' : 'Record';
29
- const {showLabel = $config.ICON_TEXT, isOnActionSheet = false} = props;
30
- const {setShowStopRecordingPopup} = useVideoCall();
36
+ recording ? 'Recording' : 'Record';
37
+ const defaultTemplateValue = useButtonTemplate().buttonTemplateName;
38
+ const {buttonTemplateName = defaultTemplateValue} = props;
31
39
  const onPress = () => {
32
40
  if (!isRecordingActive) {
33
41
  startRecording && startRecording();
34
42
  } else {
35
- setShowStopRecordingPopup(true);
43
+ stopRecording && stopRecording();
36
44
  }
37
45
  };
38
- let iconButtonProps: IconButtonProps = {
39
- iconProps: {
40
- name: isRecordingActive ? 'stop-recording' : 'recording',
41
- tintColor: isRecordingActive
42
- ? $config.SEMANTIC_ERROR
43
- : $config.SECONDARY_ACTION_COLOR,
44
- },
45
- btnTextProps: {
46
- text: showLabel ? recordingButton(isRecordingActive) : '',
47
- textColor: $config.FONT_COLOR,
48
- },
46
+ let btnTemplateProps: BtnTemplateInterface = {
47
+ name: isRecordingActive ? 'recordingActiveIcon' : 'recordingIcon',
49
48
  onPress,
50
- disabled: inProgress,
51
- containerStyle: inProgress ? {opacity: 0.6} : {},
49
+ color: isRecordingActive ? '#FD0845' : $config.PRIMARY_COLOR,
52
50
  };
53
51
 
54
- iconButtonProps.isOnActionSheet = isOnActionSheet;
52
+ if (buttonTemplateName === ButtonTemplateName.topBar) {
53
+ btnTemplateProps.style = Styles.fullWidthButton as Object;
54
+ } else {
55
+ btnTemplateProps.btnText = recordingButton(isRecordingActive);
56
+ btnTemplateProps.style = Styles.localButton as Object;
57
+ }
55
58
 
56
59
  return props?.render ? (
57
- props.render(onPress, isRecordingActive)
60
+ props.render(onPress, isRecordingActive, buttonTemplateName)
58
61
  ) : (
59
- <>
60
- <IconButton {...iconButtonProps} />
61
- </>
62
+ <BtnTemplate {...btnTemplateProps} />
62
63
  );
63
64
  };
64
65
 
@@ -9,23 +9,17 @@
9
9
  information visit https://appbuilder.agora.io.
10
10
  *********************************************
11
11
  */
12
- import React, {useRef, useState} from 'react';
13
- import {useWindowDimensions} from 'react-native';
14
- import {UidType} from '../../agora-rn-uikit';
12
+ import React from 'react';
13
+ import {StyleSheet} from 'react-native';
14
+ import {BtnTemplate, UidType} from '../../agora-rn-uikit';
15
15
  import useIsPSTN from '../utils/useIsPSTN';
16
16
  import useMutePSTN from '../utils/useMutePSTN';
17
- import Styles from '../components/styles';
18
17
  import useRemoteMute, {MUTE_REMOTE_TYPE} from '../utils/useRemoteMute';
19
- import IconButton from '../atoms/IconButton';
20
- import RemoteMutePopup from './RemoteMutePopup';
21
- import {useRender} from 'customization-api';
22
- import {calculatePosition} from '../utils/common';
23
- import useRemoteRequest, {REQUEST_REMOTE_TYPE} from '../utils/useRemoteRequest';
18
+
24
19
  export interface RemoteAudioMuteProps {
25
20
  uid: UidType;
26
21
  audio: boolean;
27
22
  isHost: boolean;
28
- userContainerRef: any;
29
23
  }
30
24
  /**
31
25
  * Component to mute / unmute remote audio.
@@ -33,84 +27,36 @@ export interface RemoteAudioMuteProps {
33
27
  * If the local user is not a host, it simply renders an image
34
28
  */
35
29
  const RemoteAudioMute = (props: RemoteAudioMuteProps) => {
36
- const btnRef = useRef(null);
37
- const {isHost = false, userContainerRef} = props;
30
+ const {isHost = false} = props;
38
31
  const muteRemoteAudio = useRemoteMute();
39
- const requestRemoteAudio = useRemoteRequest();
40
- const [showModal, setShowModal] = useState(false);
41
- const [pos, setPos] = useState({});
42
- const {renderList} = useRender();
32
+
43
33
  const isPSTN = useIsPSTN();
44
34
  const mutePSTN = useMutePSTN();
45
- const {width: globalWidth, height: globalHeight} = useWindowDimensions();
46
- const onPress = () => {
47
- if (isPSTN(props.uid)) {
48
- try {
49
- mutePSTN(props.uid);
50
- } catch (error) {
51
- console.error('An error occurred while muting the PSTN user.');
52
- }
53
- } else {
54
- props?.audio
55
- ? muteRemoteAudio(MUTE_REMOTE_TYPE.audio, props.uid)
56
- : requestRemoteAudio(REQUEST_REMOTE_TYPE.audio, props.uid);
57
- }
58
- setShowModal(false);
59
- };
60
35
  return (
61
- <>
62
- <RemoteMutePopup
63
- action={props?.audio ? 'mute' : 'request'}
64
- type="audio"
65
- actionMenuVisible={showModal}
66
- setActionMenuVisible={setShowModal}
67
- name={renderList[props.uid]?.name}
68
- modalPosition={pos}
69
- onMutePress={onPress}
70
- />
71
- <IconButton
72
- setRef={(ref) => (btnRef.current = ref)}
73
- disabled={!isHost}
74
- onPress={() => {
75
- btnRef?.current?.measure(
76
- (
77
- _fx: number,
78
- _fy: number,
79
- localWidth: number,
80
- localHeight: number,
81
- px: number,
82
- py: number,
83
- ) => {
84
- const data = calculatePosition({
85
- px,
86
- py,
87
- localHeight,
88
- localWidth,
89
- globalHeight,
90
- globalWidth,
91
- });
92
- setPos(data);
93
- setShowModal(true);
94
- },
95
- );
96
- }}
97
- hoverEffect={true}
98
- hoverEffectStyle={{
99
- backgroundColor: $config.ICON_BG_COLOR,
100
- borderRadius: 20,
101
- }}
102
- iconProps={{
103
- iconContainerStyle: {padding: 8},
104
- iconSize: 20,
105
- iconType: 'plain',
106
- name: props.audio ? 'mic-on' : 'mic-off',
107
- tintColor: props.audio
108
- ? $config.PRIMARY_ACTION_BRAND_COLOR
109
- : $config.SEMANTIC_NEUTRAL,
110
- }}
111
- />
112
- </>
36
+ <BtnTemplate
37
+ disabled={!isHost}
38
+ onPress={() => {
39
+ if (isPSTN(props.uid)) {
40
+ try {
41
+ mutePSTN(props.uid);
42
+ } catch (error) {
43
+ console.error('An error occurred while muting the PSTN user.');
44
+ }
45
+ } else {
46
+ muteRemoteAudio(MUTE_REMOTE_TYPE.audio, props.uid);
47
+ }
48
+ }}
49
+ style={style.buttonIconMic}
50
+ name={props.audio ? 'mic' : 'micOff'}
51
+ />
113
52
  );
114
53
  };
115
54
 
55
+ const style = StyleSheet.create({
56
+ buttonIconMic: {
57
+ width: 25,
58
+ height: 24,
59
+ },
60
+ });
61
+
116
62
  export default RemoteAudioMute;