agora-appbuilder-core 1.0.8 → 2.0.1

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 (134) hide show
  1. package/package.json +5 -2
  2. package/template/_package-lock.json +22850 -0
  3. package/template/agora-rn-uikit/.git/HEAD +1 -0
  4. package/template/agora-rn-uikit/.git/config +16 -0
  5. package/template/agora-rn-uikit/.git/description +1 -0
  6. package/template/agora-rn-uikit/.git/hooks/applypatch-msg.sample +15 -0
  7. package/template/agora-rn-uikit/.git/hooks/commit-msg.sample +24 -0
  8. package/template/agora-rn-uikit/.git/hooks/fsmonitor-watchman.sample +173 -0
  9. package/template/agora-rn-uikit/.git/hooks/post-update.sample +8 -0
  10. package/template/agora-rn-uikit/.git/hooks/pre-applypatch.sample +14 -0
  11. package/template/agora-rn-uikit/.git/hooks/pre-commit.sample +49 -0
  12. package/template/agora-rn-uikit/.git/hooks/pre-merge-commit.sample +13 -0
  13. package/template/agora-rn-uikit/.git/hooks/pre-push.sample +53 -0
  14. package/template/agora-rn-uikit/.git/hooks/pre-rebase.sample +169 -0
  15. package/template/agora-rn-uikit/.git/hooks/pre-receive.sample +24 -0
  16. package/template/agora-rn-uikit/.git/hooks/prepare-commit-msg.sample +42 -0
  17. package/template/agora-rn-uikit/.git/hooks/push-to-checkout.sample +78 -0
  18. package/template/agora-rn-uikit/.git/hooks/update.sample +128 -0
  19. package/template/agora-rn-uikit/.git/index +0 -0
  20. package/template/agora-rn-uikit/.git/info/exclude +6 -0
  21. package/template/agora-rn-uikit/.git/logs/HEAD +2 -0
  22. package/template/agora-rn-uikit/.git/logs/refs/heads/ab-dev-auto +1 -0
  23. package/template/agora-rn-uikit/.git/logs/refs/heads/master +1 -0
  24. package/template/agora-rn-uikit/.git/logs/refs/remotes/origin/HEAD +1 -0
  25. package/template/agora-rn-uikit/.git/objects/pack/pack-f379286d0537eb68377220b4929979324b8d5d1c.idx +0 -0
  26. package/template/agora-rn-uikit/.git/objects/pack/pack-f379286d0537eb68377220b4929979324b8d5d1c.pack +0 -0
  27. package/template/agora-rn-uikit/.git/packed-refs +12 -0
  28. package/template/agora-rn-uikit/.git/refs/heads/ab-dev-auto +1 -0
  29. package/template/agora-rn-uikit/.git/refs/heads/master +1 -0
  30. package/template/agora-rn-uikit/.git/refs/remotes/origin/HEAD +1 -0
  31. package/template/agora-rn-uikit/.gitignore +63 -0
  32. package/template/agora-rn-uikit/package-lock.json +7612 -0
  33. package/template/agora-rn-uikit/package.json +1 -0
  34. package/template/agora-rn-uikit/src/AgoraUIKit.tsx +8 -8
  35. package/template/agora-rn-uikit/src/{LocalUserContext.tsx → Contexts/LocalUserContext.tsx} +1 -1
  36. package/template/agora-rn-uikit/src/{MaxUidContext.tsx → Contexts/MaxUidContext.tsx} +0 -0
  37. package/template/agora-rn-uikit/src/{MinUidContext.tsx → Contexts/MinUidContext.tsx} +0 -0
  38. package/template/agora-rn-uikit/src/{PropsContext.tsx → Contexts/PropsContext.tsx} +34 -16
  39. package/template/agora-rn-uikit/src/{RtcContext.tsx → Contexts/RtcContext.tsx} +12 -21
  40. package/template/agora-rn-uikit/src/Controls/BtnTemplate.tsx +25 -15
  41. package/template/agora-rn-uikit/src/Controls/Icons.ts +53 -3
  42. package/template/agora-rn-uikit/src/Controls/ImageIcon.tsx +53 -0
  43. package/template/agora-rn-uikit/src/Controls/Local/EndCall.tsx +4 -3
  44. package/template/agora-rn-uikit/src/Controls/Local/FullScreen.tsx +3 -3
  45. package/template/agora-rn-uikit/src/Controls/Local/LocalAudioMute.tsx +58 -14
  46. package/template/agora-rn-uikit/src/Controls/Local/LocalVideoMute.tsx +60 -14
  47. package/template/agora-rn-uikit/src/Controls/Local/Recording.tsx +2 -2
  48. package/template/agora-rn-uikit/src/Controls/Local/Screenshare.tsx +2 -2
  49. package/template/agora-rn-uikit/src/Controls/Local/SwitchCamera.tsx +9 -9
  50. package/template/agora-rn-uikit/src/Controls/LocalControls.tsx +20 -17
  51. package/template/agora-rn-uikit/src/Controls/Remote/RemoteAudioMute.tsx +8 -8
  52. package/template/agora-rn-uikit/src/Controls/Remote/RemoteSwap.tsx +3 -3
  53. package/template/agora-rn-uikit/src/Controls/Remote/RemoteVideoMute.tsx +13 -8
  54. package/template/agora-rn-uikit/src/Controls/RemoteControls.tsx +1 -2
  55. package/template/agora-rn-uikit/src/Reducer/LocalMuteAudio.ts +20 -0
  56. package/template/agora-rn-uikit/src/Reducer/LocalMuteVideo.ts +20 -0
  57. package/template/agora-rn-uikit/src/Reducer/RemoteAudioStateChanged.ts +26 -0
  58. package/template/agora-rn-uikit/src/Reducer/RemoteVideoStateChanged.ts +26 -0
  59. package/template/agora-rn-uikit/src/Reducer/UpdateDualStreamMode.ts +46 -0
  60. package/template/agora-rn-uikit/src/Reducer/UserJoined.ts +47 -0
  61. package/template/agora-rn-uikit/src/Reducer/UserMuteRemoteAudio.ts +20 -0
  62. package/template/agora-rn-uikit/src/Reducer/UserMuteRemoteVideo.ts +20 -0
  63. package/template/agora-rn-uikit/src/Reducer/UserOffline.ts +21 -0
  64. package/template/agora-rn-uikit/src/Reducer/index.ts +9 -0
  65. package/template/agora-rn-uikit/src/Rtc/Create.tsx +138 -0
  66. package/template/agora-rn-uikit/src/Rtc/Join.tsx +100 -0
  67. package/template/agora-rn-uikit/src/RtcConfigure.tsx +197 -0
  68. package/template/agora-rn-uikit/src/Style.ts +3 -3
  69. package/template/agora-rn-uikit/src/Utils/actionTypeGuard.tsx +9 -0
  70. package/template/agora-rn-uikit/src/{events.ts → Utils/events.ts} +0 -0
  71. package/template/agora-rn-uikit/src/{permission.ts → Utils/permission.ts} +0 -0
  72. package/template/agora-rn-uikit/src/{quality.tsx → Utils/quality.tsx} +0 -0
  73. package/template/agora-rn-uikit/src/{MaxVideoView.native.tsx → Views/MaxVideoView.native.tsx} +3 -4
  74. package/template/agora-rn-uikit/src/{MaxVideoView.tsx → Views/MaxVideoView.tsx} +3 -4
  75. package/template/agora-rn-uikit/src/Views/MinVideoView.tsx +86 -0
  76. package/template/agora-rn-uikit/src/index.ts +67 -0
  77. package/template/bridge/rtc/webNg/RtcEngine.ts +23 -6
  78. package/template/package-lock.json +22850 -0
  79. package/template/package.json +6 -4
  80. package/template/react-native-toast-message/.gitignore +5 -0
  81. package/template/react-native-toast-message/.npmignore +5 -0
  82. package/template/react-native-toast-message/package-lock.json +10553 -0
  83. package/template/src/.DS_Store +0 -0
  84. package/template/src/assets/icons.ts +35 -6
  85. package/template/src/atoms/SecondaryButton.tsx +6 -5
  86. package/template/src/atoms/TextInput.tsx +6 -1
  87. package/template/src/components/Chat.tsx +50 -21
  88. package/template/src/components/ChatContext.ts +22 -1
  89. package/template/src/components/Controls.native.tsx +2 -2
  90. package/template/src/components/Controls.tsx +2 -2
  91. package/template/src/components/DeviceConfigure.tsx +1 -1
  92. package/template/src/components/GridVideo.tsx +69 -31
  93. package/template/src/components/Navbar.tsx +136 -113
  94. package/template/src/components/NetworkQualityContext.tsx +134 -0
  95. package/template/src/components/ParticipantsView.tsx +105 -49
  96. package/template/src/components/PinnedVideo.tsx +112 -71
  97. package/template/src/components/Precall.native.tsx +42 -23
  98. package/template/src/components/Precall.tsx +56 -51
  99. package/template/src/components/RTMConfigure.tsx +331 -181
  100. package/template/src/components/RTMEvents.tsx +84 -0
  101. package/template/src/components/Settings.tsx +19 -16
  102. package/template/src/components/Share.tsx +131 -62
  103. package/template/src/components/StorageContext.tsx +2 -0
  104. package/template/src/hooks/useImageDelay.tsx +28 -0
  105. package/template/src/pages/Authenticate.tsx +5 -4
  106. package/template/src/pages/Create.tsx +26 -16
  107. package/template/src/pages/Join.tsx +13 -30
  108. package/template/src/pages/VideoCall.tsx +181 -137
  109. package/template/src/subComponents/.DS_Store +0 -0
  110. package/template/src/subComponents/ChatContainer.tsx +40 -28
  111. package/template/src/subComponents/CopyJoinInfo.tsx +9 -12
  112. package/template/src/subComponents/LocalAudioMute.tsx +9 -9
  113. package/template/src/subComponents/LocalVideoMute.tsx +9 -9
  114. package/template/src/subComponents/LogoutButton.tsx +1 -1
  115. package/template/src/subComponents/NetworkQualityPill.tsx +161 -0
  116. package/template/src/subComponents/Recording.tsx +12 -16
  117. package/template/src/subComponents/RemoteAudioMute.tsx +23 -27
  118. package/template/src/subComponents/RemoteEndCall.tsx +7 -15
  119. package/template/src/subComponents/RemoteVideoMute.tsx +15 -28
  120. package/template/src/subComponents/ScreenShareNotice.tsx +61 -0
  121. package/template/src/subComponents/ScreenshareButton.tsx +76 -75
  122. package/template/src/subComponents/SelectOAuth.tsx +25 -12
  123. package/template/src/subComponents/SwitchCamera.tsx +5 -2
  124. package/template/src/subComponents/TextWithTooltip.native.tsx +128 -0
  125. package/template/src/subComponents/TextWithTooltip.tsx +44 -0
  126. package/template/src/subComponents/toastConfig.tsx +2 -2
  127. package/template/src/utils/hasBrandLogo.tsx +3 -0
  128. package/template/src/utils/isSafariBrowser.tsx +22 -0
  129. package/template/webpack.commons.js +1 -0
  130. package/template/agora-rn-uikit/Components.js +0 -35
  131. package/template/agora-rn-uikit/Contexts.js +0 -7
  132. package/template/agora-rn-uikit/index.js +0 -12
  133. package/template/agora-rn-uikit/src/MinVideoView.tsx +0 -87
  134. package/template/agora-rn-uikit/src/RTCConfigure.tsx +0 -516
@@ -17,6 +17,7 @@ import icons from '../assets/icons';
17
17
  import platform from '../subComponents/Platform';
18
18
  import {useParams} from '../components/Router';
19
19
  import Toast from '../../react-native-toast-message';
20
+ import {BtnTemplate} from '../../agora-rn-uikit';
20
21
 
21
22
  const SHARE = gql`
22
23
  query share($passphrase: String!) {
@@ -72,19 +73,14 @@ const ParticipantView = (props: {showText?: boolean}) => {
72
73
  };
73
74
 
74
75
  return (
75
- <TouchableOpacity
76
+ <BtnTemplate
76
77
  disabled={!data}
77
78
  style={style.backButton}
78
- onPress={() => copyToClipboard()}>
79
- <Image
80
- resizeMode={'contain'}
81
- style={!data ? [style.backIcon] : style.backIcon}
82
- source={{uri: icons.clipboard}}
83
- />
84
- {props.showText ?
85
- <Text style={{color: $config.PRIMARY_FONT_COLOR}}>Copy Meeting Invite</Text>
86
- :<></>}
87
- </TouchableOpacity>
79
+ onPress={() => copyToClipboard()}
80
+ name={'clipboard'}
81
+ btnText={props.showText ? 'Copy Meeting Invite' : ''}
82
+ color={$config.PRIMARY_FONT_COLOR}
83
+ />
88
84
  );
89
85
  };
90
86
 
@@ -94,13 +90,14 @@ const style = StyleSheet.create({
94
90
  flexDirection: 'row',
95
91
  justifyContent: 'center',
96
92
  alignSelf: 'center',
93
+ width: 28,
94
+ height: 20,
97
95
  },
98
96
  backIcon: {
99
97
  width: 28,
100
98
  height: 20,
101
99
  alignSelf: 'center',
102
100
  justifyContent: 'center',
103
- tintColor: $config.PRIMARY_FONT_COLOR,
104
101
  },
105
102
  });
106
103
 
@@ -1,17 +1,17 @@
1
1
  /*
2
2
  ********************************************
3
3
  Copyright © 2021 Agora Lab, Inc., all rights reserved.
4
- AppBuilder and all associated components, source code, APIs, services, and documentation
5
- (the “Materials”) are owned by Agora Lab, Inc. and its licensors. The Materials may not be
6
- accessed, used, modified, or distributed for any purpose without a license from Agora Lab, Inc.
7
- Use without a license or in violation of any license terms and conditions (including use for
8
- any purpose competitive to Agora Lab, Inc.’s business) is strictly prohibited. For more
9
- information visit https://appbuilder.agora.io.
4
+ AppBuilder and all associated components, source code, APIs, services, and documentation
5
+ (the “Materials”) are owned by Agora Lab, Inc. and its licensors. The Materials may not be
6
+ accessed, used, modified, or distributed for any purpose without a license from Agora Lab, Inc.
7
+ Use without a license or in violation of any license terms and conditions (including use for
8
+ any purpose competitive to Agora Lab, Inc.’s business) is strictly prohibited. For more
9
+ information visit https://appbuilder.agora.io.
10
10
  *********************************************
11
11
  */
12
12
  import React, {useContext} from 'react';
13
- import RtcContext, {DispatchType} from '../../agora-rn-uikit/src/RtcContext';
14
- import {LocalContext} from '../../agora-rn-uikit/src/LocalUserContext';
13
+ import {RtcContext} from '../../agora-rn-uikit';
14
+ import {LocalContext} from '../../agora-rn-uikit';
15
15
  import {Image, StyleSheet, TouchableOpacity} from 'react-native';
16
16
  import icons from '../assets/icons';
17
17
  import ColorContext from '../components/ColorContext';
@@ -27,7 +27,7 @@ function LocalAudioMute() {
27
27
  return (
28
28
  <TouchableOpacity
29
29
  onPress={() => {
30
- (dispatch as DispatchType<'LocalMuteAudio'>)({
30
+ dispatch({
31
31
  type: 'LocalMuteAudio',
32
32
  value: [local.audio],
33
33
  });
@@ -1,17 +1,17 @@
1
1
  /*
2
2
  ********************************************
3
3
  Copyright © 2021 Agora Lab, Inc., all rights reserved.
4
- AppBuilder and all associated components, source code, APIs, services, and documentation
5
- (the “Materials”) are owned by Agora Lab, Inc. and its licensors. The Materials may not be
6
- accessed, used, modified, or distributed for any purpose without a license from Agora Lab, Inc.
7
- Use without a license or in violation of any license terms and conditions (including use for
8
- any purpose competitive to Agora Lab, Inc.’s business) is strictly prohibited. For more
9
- information visit https://appbuilder.agora.io.
4
+ AppBuilder and all associated components, source code, APIs, services, and documentation
5
+ (the “Materials”) are owned by Agora Lab, Inc. and its licensors. The Materials may not be
6
+ accessed, used, modified, or distributed for any purpose without a license from Agora Lab, Inc.
7
+ Use without a license or in violation of any license terms and conditions (including use for
8
+ any purpose competitive to Agora Lab, Inc.’s business) is strictly prohibited. For more
9
+ information visit https://appbuilder.agora.io.
10
10
  *********************************************
11
11
  */
12
12
  import React, {useContext} from 'react';
13
- import RtcContext, {DispatchType} from '../../agora-rn-uikit/src/RtcContext';
14
- import {LocalContext} from '../../agora-rn-uikit/src/LocalUserContext';
13
+ import {RtcContext} from '../../agora-rn-uikit';
14
+ import {LocalContext} from '../../agora-rn-uikit';
15
15
  import {Image, StyleSheet, TouchableOpacity} from 'react-native';
16
16
  import icons from '../assets/icons';
17
17
  import ColorContext from '../components/ColorContext';
@@ -27,7 +27,7 @@ function LocalVideoMute() {
27
27
  return (
28
28
  <TouchableOpacity
29
29
  onPress={() => {
30
- (dispatch as DispatchType<'LocalMuteVideo'>)({
30
+ dispatch({
31
31
  type: 'LocalMuteVideo',
32
32
  value: [local.video],
33
33
  });
@@ -31,7 +31,7 @@ const LogoutButton = () => {
31
31
 
32
32
  const logout = () => {
33
33
  if (setStore) {
34
- setStore({token: null});
34
+ setStore({token: null, displayName: ''});
35
35
  }
36
36
  logoutQuery({variables: {token}}).catch((e) => {
37
37
  console.log(e);
@@ -0,0 +1,161 @@
1
+ import React, {useState} from 'react';
2
+ import {
3
+ View,
4
+ Image,
5
+ Text,
6
+ Pressable,
7
+ Platform,
8
+ StyleSheet,
9
+ ViewStyle,
10
+ StyleProp,
11
+ } from 'react-native';
12
+ import {networkIconsObject} from '../components/NetworkQualityContext';
13
+
14
+ /**
15
+ *
16
+ * @param networkStat - Network quality stat [ 0 - 8 ]
17
+ * @param primaryColor - Primary color of the project
18
+ * @param small - Reduced fontsize for pinned view min user panel
19
+ * @param rootStyle - CSS style override primarily used for custom placement
20
+ * @returns This component display overlay network quality indicator with an icon that expands on
21
+ * hover to show network quality text [ ex. Excellent, Good, Bad etc ]
22
+ *
23
+ */
24
+ export const NetworkQualityPill = ({
25
+ networkStat,
26
+ primaryColor,
27
+ small,
28
+ rootStyle,
29
+ }: {
30
+ networkStat: number;
31
+ primaryColor: any;
32
+ small?: boolean;
33
+ rootStyle?: StyleProp<ViewStyle>;
34
+ }) => {
35
+ const [networkTextVisible, setNetworkTextVisible] = useState(false);
36
+
37
+ return (
38
+ <View
39
+ style={[
40
+ style.networkPill,
41
+ {
42
+ opacity: networkTextVisible ? 1 : 0.8,
43
+ },
44
+ rootStyle,
45
+ ]}
46
+ >
47
+ <PlatformSpecificWrapper {...{networkTextVisible, setNetworkTextVisible}}>
48
+ <View style={[style.networkIndicatorBackdrop]}>
49
+ <Image
50
+ source={{
51
+ uri: networkIconsObject[networkStat].icon,
52
+ }}
53
+ style={[
54
+ style.networkIcon,
55
+ {
56
+ tintColor:
57
+ networkIconsObject[networkStat].tint === 'primary'
58
+ ? primaryColor
59
+ : networkIconsObject[networkStat].tint,
60
+ },
61
+ ]}
62
+ resizeMode={'contain'}
63
+ />
64
+ </View>
65
+ {networkTextVisible && (
66
+ <Text
67
+ textBreakStrategy={'simple'}
68
+ style={[
69
+ style.networkPillText,
70
+ {fontSize: small ? 14 : 15, userSelect: 'none'},
71
+ ]}
72
+ >
73
+ {networkIconsObject[networkStat].text}
74
+ </Text>
75
+ )}
76
+ </PlatformSpecificWrapper>
77
+ </View>
78
+ );
79
+ };
80
+
81
+ const PlatformSpecificWrapper = ({
82
+ networkTextVisible,
83
+ setNetworkTextVisible,
84
+ children,
85
+ }: any) => {
86
+ return Platform.OS !== 'web' ? (
87
+ <Pressable
88
+ style={{
89
+ height: '100%',
90
+ display: 'flex',
91
+ flexDirection: 'row',
92
+ alignItems: 'center',
93
+ }}
94
+ onPress={() => {
95
+ setNetworkTextVisible((visible: boolean) => !visible);
96
+ }}
97
+ >
98
+ {children}
99
+ </Pressable>
100
+ ) : (
101
+ <div
102
+ style={{
103
+ height: '100%',
104
+ display: 'flex',
105
+ flexDirection: 'row',
106
+ alignItems: 'center',
107
+ }}
108
+ onClick={(e) => {
109
+ e.preventDefault();
110
+ setNetworkTextVisible((visible: boolean) => !visible);
111
+ }}
112
+ onMouseEnter={() => {
113
+ setNetworkTextVisible(true);
114
+ }}
115
+ onMouseLeave={() => {
116
+ setNetworkTextVisible(false);
117
+ }}
118
+ >
119
+ {children}
120
+ </div>
121
+ );
122
+ };
123
+
124
+ const style = StyleSheet.create({
125
+ networkPill: {
126
+ height: 30,
127
+ backgroundColor: $config.SECONDARY_FONT_COLOR + 'bb',
128
+ position: 'absolute',
129
+ zIndex: 2,
130
+ paddingHorizontal: 0,
131
+ borderRadius: 15,
132
+ },
133
+ networkPillContent: {
134
+ display: 'flex',
135
+ flexDirection: 'row',
136
+ alignItems: 'center',
137
+ },
138
+ networkPillText: {
139
+ color: $config.PRIMARY_FONT_COLOR,
140
+ lineHeight: 30,
141
+ fontSize: 15,
142
+ fontWeight: '600',
143
+ marginLeft: 5,
144
+ marginRight: 15,
145
+ },
146
+ networkIcon: {
147
+ width: '80%',
148
+ height: '80%',
149
+ alignSelf: 'center',
150
+ },
151
+ networkIndicatorBackdrop: {
152
+ width: 20,
153
+ height: 20,
154
+ borderRadius: 10,
155
+ alignSelf: 'center',
156
+ marginLeft: 5,
157
+ marginRight: 5,
158
+ backgroundColor: $config.SECONDARY_FONT_COLOR,
159
+ justifyContent: 'center',
160
+ },
161
+ });
@@ -16,8 +16,9 @@ import ChatContext, {controlMessageEnum} from '../components/ChatContext';
16
16
  import ColorContext from '../components/ColorContext';
17
17
  import {gql, useMutation} from '@apollo/client';
18
18
  import {useParams} from '../components/Router';
19
- import PropsContext from '../../agora-rn-uikit/src/PropsContext';
19
+ import {PropsContext} from '../../agora-rn-uikit';
20
20
  import Toast from '../../react-native-toast-message';
21
+ import {ImageIcon} from '../../agora-rn-uikit';
21
22
 
22
23
  const START_RECORDING = gql`
23
24
  mutation startRecordingSession($passphrase: String!, $secret: String) {
@@ -46,12 +47,12 @@ const Recording = (props: any) => {
46
47
  const [stopRecordingQuery] = useMutation(STOP_RECORDING);
47
48
  const {sendControlMessage} = useContext(ChatContext);
48
49
 
49
- useEffect(()=>{
50
- if(recordingActive)
51
- Toast.show({text1: 'Recording Started', visibilityTime: 1000})
50
+ useEffect(() => {
51
+ if (recordingActive)
52
+ Toast.show({text1: 'Recording Started', visibilityTime: 1000});
52
53
  // else if(!recordingActive)
53
- // Toast.show({text1: 'Recording Finished', visibilityTime: 1000})
54
- },[recordingActive])
54
+ // Toast.show({text1: 'Recording Finished', visibilityTime: 1000})
55
+ }, [recordingActive]);
55
56
 
56
57
  return (
57
58
  <TouchableOpacity
@@ -98,15 +99,11 @@ const Recording = (props: any) => {
98
99
  });
99
100
  }
100
101
  }}>
101
- <View style={[style.localButton, { borderColor: primaryColor }]}>
102
- <Image
103
- source={{
104
- uri: recordingActive
105
- ? icons.recordingActiveIcon
106
- : icons.recordingIcon,
107
- }}
108
- style={[style.buttonIcon, { tintColor: recordingActive ? '#FD0845' : primaryColor }]}
109
- resizeMode={'contain'}
102
+ <View style={[style.localButton, {borderColor: primaryColor}]}>
103
+ <ImageIcon
104
+ name={recordingActive ? 'recordingActiveIcon' : 'recordingIcon'}
105
+ style={[style.buttonIcon]}
106
+ color={recordingActive ? '#FD0845': $config.PRIMARY_COLOR}
110
107
  />
111
108
  </View>
112
109
  <Text
@@ -137,7 +134,6 @@ const style = StyleSheet.create({
137
134
  buttonIcon: {
138
135
  width: '100%',
139
136
  height: '100%',
140
- tintColor: $config.PRIMARY_COLOR,
141
137
  },
142
138
  });
143
139
 
@@ -10,20 +10,20 @@
10
10
  *********************************************
11
11
  */
12
12
  import React, {useContext} from 'react';
13
- import {TouchableOpacity, Image, View, StyleSheet} from 'react-native';
13
+ import {StyleSheet} from 'react-native';
14
14
  import ChatContext, {controlMessageEnum} from '../components/ChatContext';
15
- import icons from '../assets/icons';
16
15
  import ColorContext from '../components/ColorContext';
17
- import { gql, useMutation } from '@apollo/client';
18
- import { useParams } from '../components/Router';
16
+ import {gql, useMutation} from '@apollo/client';
17
+ import {useParams} from '../components/Router';
18
+ import {BtnTemplate} from '../../agora-rn-uikit';
19
19
 
20
20
  const MUTE_PSTN = gql`
21
- mutation mutePSTN ($uid: Int!, $passphrase: String!, $mute: Boolean!) {
22
- mutePSTN (uid: $uid, passphrase: $passphrase, mute: $mute) {
21
+ mutation mutePSTN($uid: Int!, $passphrase: String!, $mute: Boolean!) {
22
+ mutePSTN(uid: $uid, passphrase: $passphrase, mute: $mute) {
23
23
  uid
24
24
  mute
25
+ }
25
26
  }
26
- }
27
27
  `;
28
28
 
29
29
  /**
@@ -36,32 +36,29 @@ const RemoteAudioMute = (props: {
36
36
  audio: boolean;
37
37
  isHost: boolean;
38
38
  }) => {
39
+ const {isHost = false} = props;
39
40
  const {primaryColor} = useContext(ColorContext);
40
41
  const {sendControlMessageToUid} = useContext(ChatContext);
41
42
  const [mutePSTN, {data, loading, error}] = useMutation(MUTE_PSTN);
42
43
  const {phrase} = useParams<{phrase: string}>();
43
44
 
44
- return props.isHost ? (
45
- <TouchableOpacity
45
+ return (
46
+ <BtnTemplate
47
+ disabled={!isHost}
46
48
  onPress={() => {
47
- if(String(props.uid)[0] === '1')
48
- mutePSTN({variables: {
49
- uid: props.uid, passphrase: phrase, mute: props.audio
50
- }})
49
+ if (String(props.uid)[0] === '1')
50
+ mutePSTN({
51
+ variables: {
52
+ uid: props.uid,
53
+ passphrase: phrase,
54
+ mute: props.audio,
55
+ },
56
+ });
51
57
  else sendControlMessageToUid(controlMessageEnum.muteAudio, props.uid);
52
- }}>
53
- <Image
54
- style={[style.buttonIconMic, {tintColor: primaryColor}]}
55
- source={{uri: props.audio ? icons.mic : icons.micOff}}
56
- />
57
- </TouchableOpacity>
58
- ) : (
59
- <View>
60
- <Image
61
- style={[style.buttonIconMic, {tintColor: primaryColor}]}
62
- source={{uri: props.audio ? icons.mic : icons.micOff}}
63
- />
64
- </View>
58
+ }}
59
+ style={style.buttonIconMic}
60
+ name={props.audio ? 'mic' : 'micOff'}
61
+ />
65
62
  );
66
63
  };
67
64
 
@@ -69,7 +66,6 @@ const style = StyleSheet.create({
69
66
  buttonIconMic: {
70
67
  width: 25,
71
68
  height: 24,
72
- tintColor: $config.PRIMARY_COLOR,
73
69
  },
74
70
  });
75
71
 
@@ -10,23 +10,21 @@
10
10
  *********************************************
11
11
  */
12
12
  import React, {useContext} from 'react';
13
- import {TouchableOpacity, Image, StyleSheet} from 'react-native';
13
+ import {StyleSheet} from 'react-native';
14
14
  import ChatContext, {controlMessageEnum} from '../components/ChatContext';
15
- import icons from '../assets/icons';
15
+ import {BtnTemplate} from '../../agora-rn-uikit';
16
16
 
17
17
  const RemoteEndCall = (props: {uid: number; isHost: boolean}) => {
18
18
  const {sendControlMessageToUid} = useContext(ChatContext);
19
19
  return props.isHost && String(props.uid)[0] !== '1' ? (
20
- <TouchableOpacity
20
+ <BtnTemplate
21
21
  style={style.remoteButton}
22
22
  onPress={() => {
23
23
  sendControlMessageToUid(controlMessageEnum.kickUser, props.uid);
24
- }}>
25
- <Image
26
- style={style.buttonIconEnd}
27
- source={{uri: icons.endCall}}
28
- resizeMode={'contain'}/>
29
- </TouchableOpacity>
24
+ }}
25
+ color='#FD0845'
26
+ name={'remoteEndCall'} // earlier was endCall, added remoteEndCall
27
+ />
30
28
  ) : (
31
29
  <></>
32
30
  );
@@ -46,12 +44,6 @@ const style = StyleSheet.create({
46
44
  marginHorizontal: 0,
47
45
  backgroundColor: $config.SECONDARY_FONT_COLOR,
48
46
  },
49
- buttonIconEnd: {
50
- width: 30,
51
- height: 25,
52
- // marginLeft: 3,
53
- tintColor: '#f86051',
54
- },
55
47
  });
56
48
 
57
49
  export default RemoteEndCall;
@@ -10,11 +10,10 @@
10
10
  *********************************************
11
11
  */
12
12
  import React, {useContext} from 'react';
13
- import {TouchableOpacity, Image, View, StyleSheet} from 'react-native';
13
+ import {StyleSheet} from 'react-native';
14
14
  import ChatContext, {controlMessageEnum} from '../components/ChatContext';
15
- import icons from '../assets/icons';
16
15
  import ColorContext from '../components/ColorContext';
17
-
16
+ import {BtnTemplate} from '../../agora-rn-uikit';
18
17
  /**
19
18
  * Component to mute / unmute remote video.
20
19
  * Sends a control message to another user over RTM if the local user is a host.
@@ -26,31 +25,20 @@ const RemoteVideoMute = (props: {
26
25
  isHost: boolean;
27
26
  }) => {
28
27
  const {primaryColor} = useContext(ColorContext);
28
+ const {isHost = false} = props;
29
29
  const {sendControlMessageToUid} = useContext(ChatContext);
30
- return String(props.uid)[0] !== '1'
31
- ? props.isHost
32
- ? (
33
- <TouchableOpacity
34
- onPress={() => {
35
- sendControlMessageToUid(controlMessageEnum.muteVideo, props.uid);
36
- }}>
37
- <Image
38
- style={[style.buttonIconCam, {tintColor: primaryColor}]}
39
- source={{uri: props.video ? icons.videocam : icons.videocamOff}}
40
- resizeMode={'contain'}
41
- />
42
- </TouchableOpacity>
43
- ) : (
44
- <View>
45
- <Image
46
- style={[style.buttonIconCam, {tintColor: primaryColor}]}
47
- source={{uri: props.video ? icons.videocam : icons.videocamOff}}
48
- resizeMode={'contain'}
49
- />
50
- </View>
51
- )
52
- :
53
- (<></>);
30
+ return String(props.uid)[0] !== '1' ? (
31
+ <BtnTemplate
32
+ disabled={!isHost}
33
+ onPress={() => {
34
+ sendControlMessageToUid(controlMessageEnum.muteVideo, props.uid);
35
+ }}
36
+ style={style.buttonIconCam}
37
+ name={props.video ? 'videocam' : 'videocamOff'}
38
+ />
39
+ ) : (
40
+ <></>
41
+ );
54
42
  };
55
43
 
56
44
  const style = StyleSheet.create({
@@ -58,7 +46,6 @@ const style = StyleSheet.create({
58
46
  width: 28,
59
47
  height: 25,
60
48
  marginHorizontal: 2,
61
- tintColor: $config.PRIMARY_COLOR,
62
49
  },
63
50
  });
64
51
 
@@ -0,0 +1,61 @@
1
+ /*
2
+ ********************************************
3
+ Copyright © 2021 Agora Lab, Inc., all rights reserved.
4
+ AppBuilder and all associated components, source code, APIs, services, and documentation
5
+ (the “Materials”) are owned by Agora Lab, Inc. and its licensors. The Materials may not be
6
+ accessed, used, modified, or distributed for any purpose without a license from Agora Lab, Inc.
7
+ Use without a license or in violation of any license terms and conditions (including use for
8
+ any purpose competitive to Agora Lab, Inc.’s business) is strictly prohibited. For more
9
+ information visit https://appbuilder.agora.io.
10
+ *********************************************
11
+ */
12
+
13
+ import React, {useContext} from 'react';
14
+ import { StyleSheet, View, Text } from 'react-native';
15
+ import chatContext from '../components/ChatContext';
16
+ /**
17
+ *
18
+ * @param uid - uid of the user
19
+ * @returns This component display overlay message "Screen sharing is active now" if user started sharing the screen.
20
+ * why its needed : To prevent screensharing tunneling effect
21
+ *
22
+ */
23
+ function ScreenShareNotice({ uid }: any) {
24
+ const {userList, localUid} = useContext(chatContext);
25
+ /**
26
+ * In a meeting a and b are there
27
+ if a user sharing the screen - then that screenshare user uid is 1 for a’user end and its having xxx uid in another end
28
+ if b user sharing the screen - then that screenshare user uid is 1 for b’user end and its having xxx uid in another end
29
+ */
30
+ return uid === 1
31
+ ?
32
+ <View style={styles.screenSharingMessageContainer}>
33
+ <Text style={styles.screensharingMessage}>
34
+ {userList[localUid]?.name + "'s screen share is active."}
35
+ </Text>
36
+ </View>
37
+ : null
38
+ }
39
+
40
+ const styles = StyleSheet.create({
41
+ screenSharingMessageContainer: {
42
+ position: 'absolute',
43
+ top: 0,
44
+ left: 0,
45
+ right: 0,
46
+ bottom: 0,
47
+ width: '100%',
48
+ height: '100%',
49
+ justifyContent: 'center',
50
+ zIndex: 2,
51
+ backgroundColor: 'rgba(0,0,0,0.9)',
52
+ borderRadius: 15
53
+ },
54
+ screensharingMessage: {
55
+ alignSelf: 'center',
56
+ fontSize: 20,
57
+ color: $config.SECONDARY_FONT_COLOR
58
+ }
59
+ })
60
+
61
+ export default ScreenShareNotice;