agora-appbuilder-core 1.0.9 → 2.0.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 (107) hide show
  1. package/package.json +5 -2
  2. package/template/_package-lock.json +22754 -0
  3. package/template/agora-rn-uikit/.git/index +0 -0
  4. package/template/agora-rn-uikit/.git/logs/HEAD +2 -2
  5. package/template/agora-rn-uikit/.git/logs/refs/heads/ab-dev-auto +1 -1
  6. package/template/agora-rn-uikit/.git/logs/refs/heads/master +1 -1
  7. package/template/agora-rn-uikit/.git/logs/refs/remotes/origin/HEAD +1 -1
  8. package/template/agora-rn-uikit/.git/objects/pack/pack-f379286d0537eb68377220b4929979324b8d5d1c.idx +0 -0
  9. package/template/agora-rn-uikit/.git/objects/pack/{pack-eb3b4c374d6e79553b5bbcc78b4399cc766e97cf.pack → pack-f379286d0537eb68377220b4929979324b8d5d1c.pack} +0 -0
  10. package/template/agora-rn-uikit/.git/packed-refs +6 -6
  11. package/template/agora-rn-uikit/.git/refs/heads/ab-dev-auto +1 -1
  12. package/template/agora-rn-uikit/.git/refs/heads/master +1 -1
  13. package/template/agora-rn-uikit/package.json +1 -0
  14. package/template/agora-rn-uikit/src/AgoraUIKit.tsx +8 -8
  15. package/template/agora-rn-uikit/src/{LocalUserContext.tsx → Contexts/LocalUserContext.tsx} +1 -1
  16. package/template/agora-rn-uikit/src/{MaxUidContext.tsx → Contexts/MaxUidContext.tsx} +0 -0
  17. package/template/agora-rn-uikit/src/{MinUidContext.tsx → Contexts/MinUidContext.tsx} +0 -0
  18. package/template/agora-rn-uikit/src/{PropsContext.tsx → Contexts/PropsContext.tsx} +34 -16
  19. package/template/agora-rn-uikit/src/{RtcContext.tsx → Contexts/RtcContext.tsx} +12 -21
  20. package/template/agora-rn-uikit/src/Controls/BtnTemplate.tsx +43 -23
  21. package/template/agora-rn-uikit/src/Controls/Icons.ts +53 -3
  22. package/template/agora-rn-uikit/src/Controls/ImageIcon.tsx +53 -0
  23. package/template/agora-rn-uikit/src/Controls/Local/EndCall.tsx +5 -3
  24. package/template/agora-rn-uikit/src/Controls/Local/FullScreen.tsx +3 -3
  25. package/template/agora-rn-uikit/src/Controls/Local/LocalAudioMute.tsx +58 -13
  26. package/template/agora-rn-uikit/src/Controls/Local/LocalVideoMute.tsx +60 -13
  27. package/template/agora-rn-uikit/src/Controls/Local/Recording.tsx +2 -2
  28. package/template/agora-rn-uikit/src/Controls/Local/Screenshare.tsx +2 -2
  29. package/template/agora-rn-uikit/src/Controls/Local/SwitchCamera.tsx +10 -9
  30. package/template/agora-rn-uikit/src/Controls/LocalControls.tsx +20 -17
  31. package/template/agora-rn-uikit/src/Controls/Remote/RemoteAudioMute.tsx +8 -8
  32. package/template/agora-rn-uikit/src/Controls/Remote/RemoteSwap.tsx +3 -3
  33. package/template/agora-rn-uikit/src/Controls/Remote/RemoteVideoMute.tsx +13 -8
  34. package/template/agora-rn-uikit/src/Controls/RemoteControls.tsx +1 -2
  35. package/template/agora-rn-uikit/src/Reducer/LocalMuteAudio.ts +20 -0
  36. package/template/agora-rn-uikit/src/Reducer/LocalMuteVideo.ts +20 -0
  37. package/template/agora-rn-uikit/src/Reducer/RemoteAudioStateChanged.ts +26 -0
  38. package/template/agora-rn-uikit/src/Reducer/RemoteVideoStateChanged.ts +26 -0
  39. package/template/agora-rn-uikit/src/Reducer/UpdateDualStreamMode.ts +46 -0
  40. package/template/agora-rn-uikit/src/Reducer/UserJoined.ts +47 -0
  41. package/template/agora-rn-uikit/src/Reducer/UserMuteRemoteAudio.ts +20 -0
  42. package/template/agora-rn-uikit/src/Reducer/UserMuteRemoteVideo.ts +20 -0
  43. package/template/agora-rn-uikit/src/Reducer/UserOffline.ts +21 -0
  44. package/template/agora-rn-uikit/src/Reducer/index.ts +9 -0
  45. package/template/agora-rn-uikit/src/Rtc/Create.tsx +138 -0
  46. package/template/agora-rn-uikit/src/Rtc/Join.tsx +100 -0
  47. package/template/agora-rn-uikit/src/RtcConfigure.tsx +197 -0
  48. package/template/agora-rn-uikit/src/Style.ts +3 -3
  49. package/template/agora-rn-uikit/src/Utils/actionTypeGuard.tsx +9 -0
  50. package/template/agora-rn-uikit/src/{events.ts → Utils/events.ts} +0 -0
  51. package/template/agora-rn-uikit/src/{permission.ts → Utils/permission.ts} +0 -0
  52. package/template/agora-rn-uikit/src/{quality.tsx → Utils/quality.tsx} +0 -0
  53. package/template/agora-rn-uikit/src/{MaxVideoView.native.tsx → Views/MaxVideoView.native.tsx} +3 -4
  54. package/template/agora-rn-uikit/src/{MaxVideoView.tsx → Views/MaxVideoView.tsx} +3 -4
  55. package/template/agora-rn-uikit/src/Views/MinVideoView.tsx +86 -0
  56. package/template/agora-rn-uikit/src/index.ts +67 -0
  57. package/template/bridge/rtc/webNg/RtcEngine.ts +23 -6
  58. package/template/package-lock.json +22754 -0
  59. package/template/package.json +5 -4
  60. package/template/src/assets/icons.ts +35 -6
  61. package/template/src/atoms/SecondaryButton.tsx +6 -5
  62. package/template/src/atoms/TextInput.tsx +6 -1
  63. package/template/src/components/Chat.tsx +50 -21
  64. package/template/src/components/ChatContext.ts +22 -1
  65. package/template/src/components/Controls.native.tsx +2 -2
  66. package/template/src/components/Controls.tsx +2 -2
  67. package/template/src/components/DeviceConfigure.tsx +1 -1
  68. package/template/src/components/GridVideo.tsx +69 -31
  69. package/template/src/components/Navbar.tsx +136 -113
  70. package/template/src/components/NetworkQualityContext.tsx +134 -0
  71. package/template/src/components/ParticipantsView.tsx +105 -49
  72. package/template/src/components/PinnedVideo.tsx +112 -71
  73. package/template/src/components/Precall.native.tsx +20 -9
  74. package/template/src/components/Precall.tsx +37 -33
  75. package/template/src/components/RTMConfigure.tsx +331 -181
  76. package/template/src/components/RTMEvents.tsx +84 -0
  77. package/template/src/components/Settings.tsx +19 -16
  78. package/template/src/components/Share.tsx +131 -62
  79. package/template/src/hooks/useImageDelay.tsx +28 -0
  80. package/template/src/pages/Authenticate.tsx +5 -4
  81. package/template/src/pages/Create.tsx +11 -4
  82. package/template/src/pages/Join.tsx +2 -1
  83. package/template/src/pages/VideoCall.tsx +126 -101
  84. package/template/src/subComponents/ChatContainer.tsx +40 -28
  85. package/template/src/subComponents/CopyJoinInfo.tsx +9 -12
  86. package/template/src/subComponents/LocalAudioMute.tsx +9 -9
  87. package/template/src/subComponents/LocalVideoMute.tsx +9 -9
  88. package/template/src/subComponents/NetworkQualityPill.tsx +161 -0
  89. package/template/src/subComponents/Recording.tsx +12 -16
  90. package/template/src/subComponents/RemoteAudioMute.tsx +23 -27
  91. package/template/src/subComponents/RemoteEndCall.tsx +7 -15
  92. package/template/src/subComponents/RemoteVideoMute.tsx +15 -28
  93. package/template/src/subComponents/ScreenShareNotice.tsx +61 -0
  94. package/template/src/subComponents/ScreenshareButton.tsx +76 -75
  95. package/template/src/subComponents/SelectOAuth.tsx +25 -12
  96. package/template/src/subComponents/SwitchCamera.tsx +5 -2
  97. package/template/src/subComponents/TextWithTooltip.native.tsx +128 -0
  98. package/template/src/subComponents/TextWithTooltip.tsx +44 -0
  99. package/template/src/subComponents/toastConfig.tsx +2 -2
  100. package/template/src/utils/hasBrandLogo.tsx +3 -0
  101. package/template/src/utils/isSafariBrowser.tsx +22 -0
  102. package/template/agora-rn-uikit/.git/objects/pack/pack-eb3b4c374d6e79553b5bbcc78b4399cc766e97cf.idx +0 -0
  103. package/template/agora-rn-uikit/Components.js +0 -35
  104. package/template/agora-rn-uikit/Contexts.js +0 -7
  105. package/template/agora-rn-uikit/index.js +0 -12
  106. package/template/agora-rn-uikit/src/MinVideoView.tsx +0 -87
  107. package/template/agora-rn-uikit/src/RTCConfigure.tsx +0 -561
@@ -0,0 +1,84 @@
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 {messageChannelType, messageEventInterface} from './ChatContext';
14
+
15
+ const RTM_ERROR_TEMPLATE = 'RTMError:';
16
+
17
+ type eventsMapInterface = {
18
+ [key in messageChannelType]: Record<string, any>;
19
+ };
20
+
21
+ type errorObjectInterface = {
22
+ msg: string;
23
+ cause: any;
24
+ };
25
+
26
+ type eventKeyType = keyof eventsMapInterface;
27
+
28
+ const eventsMap: eventsMapInterface = {
29
+ [messageChannelType.Private]: new Map<string, any>(),
30
+ [messageChannelType.Public]: new Map<string, any>(),
31
+ };
32
+
33
+ export interface rtmEventsInterface {
34
+ on: (
35
+ messageChannel: messageChannelType,
36
+ evtName: string,
37
+ callback: any,
38
+ ) => void;
39
+ emit: (
40
+ messageChannel: messageChannelType,
41
+ data: messageEventInterface | any | null,
42
+ error?: errorObjectInterface | null | undefined,
43
+ ) => void;
44
+ off: (messageChannel: messageChannelType, evtName: string) => void;
45
+ destroyAll: () => void;
46
+ }
47
+
48
+ const events: rtmEventsInterface = {
49
+ on: (messageChannel: messageChannelType, evtName: string, callback: any) => {
50
+ eventsMap[messageChannel].set(evtName, callback);
51
+ },
52
+ emit: (
53
+ messageChannel: messageChannelType,
54
+ data: messageEventInterface | any | null,
55
+ error: errorObjectInterface | null | undefined,
56
+ ) => {
57
+ // Handle error, if error found return error in callback
58
+ if (error) {
59
+ let err = new Error(`${RTM_ERROR_TEMPLATE}: ${error.msg}`);
60
+ err.stack += '\nCaused by: ' + error.cause;
61
+
62
+ for (const [key] of eventsMap[messageChannel].entries()) {
63
+ eventsMap[messageChannel].get(`${key}`)(null, err);
64
+ }
65
+ return;
66
+ }
67
+ // Handle success, return data in callback
68
+ for (const [key] of eventsMap[messageChannel].entries()) {
69
+ eventsMap[messageChannel].get(`${key}`)(data, null);
70
+ }
71
+ },
72
+ off: (messageChannel: messageChannelType, evtName: string) => {
73
+ eventsMap[messageChannel].delete(evtName);
74
+ },
75
+ destroyAll: () => {
76
+ for (const key of Object.keys(eventsMap) as Array<eventKeyType>) {
77
+ eventsMap[key].clear();
78
+ }
79
+ },
80
+ };
81
+
82
+ Object.freeze(events);
83
+
84
+ export default events;
@@ -16,27 +16,24 @@ import SelectDevice from '../subComponents/SelectDevice';
16
16
  import HostControlView from './HostControlView';
17
17
  import ColorContext from './ColorContext';
18
18
  import {SidePanelType} from '../subComponents/SidePanelEnum';
19
+ import {BtnTemplate} from '../../agora-rn-uikit';
19
20
 
20
21
  const Settings = (props: any) => {
21
22
  const {primaryColor} = useContext(ColorContext);
22
23
  const {isHost, sidePanel, setSidePanel} = props;
23
24
 
24
25
  return (
25
- <>
26
- <TouchableOpacity
27
- style={[style.localButton, {borderColor: primaryColor}]}
28
- onPress={() => {
29
- sidePanel === SidePanelType.Settings
30
- ? setSidePanel(SidePanelType.None)
31
- : setSidePanel(SidePanelType.Settings);
32
- }}>
33
- <Image
34
- source={{uri: icons.settings}}
35
- style={[style.buttonIcon, {tintColor: primaryColor}]}
36
- resizeMode={'contain'}
37
- />
38
- </TouchableOpacity>
39
- </>
26
+ <BtnTemplate
27
+ style={[style.localButtonWithMatchingStyle, {borderColor: primaryColor}]}
28
+ onPress={() => {
29
+ sidePanel === SidePanelType.Settings
30
+ ? setSidePanel(SidePanelType.None)
31
+ : setSidePanel(SidePanelType.Settings);
32
+ }}
33
+ name={
34
+ sidePanel === SidePanelType.Settings ? 'settingsFilled' : 'settings'
35
+ }
36
+ />
40
37
  );
41
38
  };
42
39
 
@@ -72,7 +69,7 @@ const style = StyleSheet.create({
72
69
  // width: 30,
73
70
  // height: 30,
74
71
  width: '100%',
75
- height: '90%',
72
+ height: '100%',
76
73
  tintColor: $config.PRIMARY_COLOR,
77
74
  },
78
75
  heading: {
@@ -108,7 +105,13 @@ const style = StyleSheet.create({
108
105
  alignSelf: 'center',
109
106
  alignItems: 'center',
110
107
  justifyContent: 'center',
108
+ resizeMode: 'contain',
111
109
  },
110
+ localButtonWithMatchingStyle:{
111
+ width: '100%',
112
+ height: '100%',
113
+ resizeMode: 'contain',
114
+ }
112
115
  });
113
116
 
114
117
  export default Settings;
@@ -28,17 +28,13 @@ import PrimaryButton from '../atoms/PrimaryButton';
28
28
  import SecondaryButton from '../atoms/SecondaryButton';
29
29
  import icons from '../assets/icons';
30
30
  import Toast from '../../react-native-toast-message';
31
+ import {BtnTemplate} from '../../agora-rn-uikit';
32
+ import styles from './styles';
31
33
 
32
34
  const Share = (props: any) => {
33
35
  const history = useHistory();
34
- const {
35
- urlView,
36
- urlHost,
37
- pstn,
38
- joinPhrase,
39
- roomTitle,
40
- hostControlCheckbox,
41
- } = props;
36
+ const {urlView, urlHost, pstn, joinPhrase, roomTitle, hostControlCheckbox} =
37
+ props;
42
38
  // const {primaryColor} = useContext(ColorContext);
43
39
  // const pstn = {number: '+1 206 656 1157', dtmf: '2342'}
44
40
  const enterMeeting = () => {
@@ -48,7 +44,7 @@ const Share = (props: any) => {
48
44
  };
49
45
 
50
46
  const copyToClipboard = () => {
51
- Toast.show({ text1: 'Copied to Clipboard', visibilityTime: 1000 });
47
+ Toast.show({text1: 'Copied to Clipboard', visibilityTime: 1000});
52
48
  let stringToCopy = '';
53
49
 
54
50
  $config.FRONTEND_ENDPOINT
@@ -80,32 +76,32 @@ PSTN Pin: ${pstn.dtmf}`)
80
76
  };
81
77
 
82
78
  const copyHostUrl = () => {
83
- Toast.show({ text1: 'Copied to Clipboard', visibilityTime: 1000});
79
+ Toast.show({text1: 'Copied to Clipboard', visibilityTime: 1000});
84
80
  let stringToCopy = '';
85
81
  $config.FRONTEND_ENDPOINT
86
82
  ? (stringToCopy += `${$config.FRONTEND_ENDPOINT}/${urlHost}`)
87
83
  : platform === 'web'
88
84
  ? (stringToCopy += `${window.location.origin}/${urlHost}`)
89
- : (stringToCopy += `Meeting ID: ${urlHost}`)
85
+ : (stringToCopy += `Meeting ID: ${urlHost}`);
90
86
  Clipboard.setString(stringToCopy);
91
87
  };
92
88
 
93
89
  const copyAttendeeURL = () => {
94
- Toast.show({ text1: 'Copied to Clipboard', visibilityTime: 1000});
90
+ Toast.show({text1: 'Copied to Clipboard', visibilityTime: 1000});
95
91
  let stringToCopy = '';
96
92
  $config.FRONTEND_ENDPOINT
97
93
  ? (stringToCopy += `${$config.FRONTEND_ENDPOINT}/${urlView}`)
98
94
  : platform === 'web'
99
95
  ? (stringToCopy += `${window.location.origin}/${urlView}`)
100
- : (stringToCopy += `Meeting ID: ${urlView}`)
96
+ : (stringToCopy += `Meeting ID: ${urlView}`);
101
97
  Clipboard.setString(stringToCopy);
102
98
  };
103
99
 
104
100
  const copyPstn = () => {
105
- Toast.show({ text1: 'Copied to Clipboard', visibilityTime: 1000});
101
+ Toast.show({text1: 'Copied to Clipboard', visibilityTime: 1000});
106
102
  let stringToCopy = `PSTN Number: ${pstn?.number} PSTN Pin: ${pstn?.dtmf}`;
107
103
  Clipboard.setString(stringToCopy);
108
- }
104
+ };
109
105
 
110
106
  const [dim, setDim] = useState([
111
107
  Dimensions.get('window').width,
@@ -120,90 +116,151 @@ PSTN Pin: ${pstn.dtmf}`)
120
116
  <View style={style.content} onLayout={onLayout}>
121
117
  <View style={style.leftContent}>
122
118
  <View>
123
- <Text style={style.heading}>{$config.APP_NAME}</Text>
124
- <Text style={style.headline}>{$config.LANDING_SUB_HEADING}</Text>
119
+ <Text style={style.heading}>{$config.APP_NAME}</Text>
120
+ <Text style={style.headline}>{$config.LANDING_SUB_HEADING}</Text>
125
121
  </View>
126
122
  {hostControlCheckbox ? (
127
- <View style={style.urlContainer}>
128
- <View style={{width: '80%'}}>
123
+ <View style={style.urlContainer}>
124
+ <View style={{width: '80%'}}>
129
125
  <Text style={style.urlTitle}>
130
126
  {$config.FRONTEND_ENDPOINT || platform === 'web'
131
- ? "Attendee URL" : "Attendee ID"}
127
+ ? 'Attendee URL'
128
+ : 'Attendee ID'}
132
129
  </Text>
133
130
  <View style={style.urlHolder}>
134
- <Text style={[style.url, Platform.OS === 'web' ? urlWeb : {opacity: 1}]}>
131
+ <Text
132
+ style={[
133
+ style.url,
134
+ Platform.OS === 'web' ? urlWeb : {opacity: 1},
135
+ ]}>
135
136
  {$config.FRONTEND_ENDPOINT
136
137
  ? `${$config.FRONTEND_ENDPOINT}/${urlView}`
137
138
  : platform === 'web'
138
- ? `${window.location.origin}/${urlView}`
139
- : urlView}
139
+ ? `${window.location.origin}/${urlView}`
140
+ : urlView}
140
141
  </Text>
141
-
142
- </View>
143
142
  </View>
144
- <View style={{ marginLeft: 'auto', flexDirection: 'row', alignSelf: 'center' }}>
145
- <View style={{ backgroundColor: $config.PRIMARY_COLOR + '80', width: 1, height: 'auto', marginRight: 15 }} />
146
- <TouchableOpacity style={{ width: 40, height: 40, marginVertical: 'auto' }} onPress={()=>copyAttendeeURL()}>
147
- <Image resizeMode={'contain'}
148
- style={{ width: '100%', height: '100%', tintColor: $config.PRIMARY_COLOR, opacity: 0.5}}
149
- source={{ uri: icons.clipboard }}></Image>
150
- </TouchableOpacity>
151
143
  </View>
144
+ <View
145
+ style={{
146
+ marginLeft: 'auto',
147
+ flexDirection: 'row',
148
+ alignSelf: 'center',
149
+ }}>
150
+ <View
151
+ style={{
152
+ backgroundColor: $config.PRIMARY_COLOR + '80',
153
+ width: 1,
154
+ height: 'auto',
155
+ marginRight: 15,
156
+ }}
157
+ />
158
+ <View style={style.clipboardIconHolder}>
159
+ <BtnTemplate
160
+ style={style.clipboardIcon}
161
+ color={$config.PRIMARY_COLOR}
162
+ name={'clipboard'}
163
+ onPress={() => copyAttendeeURL()}
164
+ />
165
+ </View>
152
166
  </View>
167
+ </View>
153
168
  ) : (
154
169
  <></>
155
170
  )}
156
171
  <View style={style.urlContainer}>
157
- <View style={{ width: '80%' }}>
172
+ <View style={{width: '80%'}}>
158
173
  <Text style={style.urlTitle}>
159
- {$config.FRONTEND_ENDPOINT || platform === 'web' ? hostControlCheckbox
160
- ? 'Host URL' : 'Meeting URL'
161
- : hostControlCheckbox ? 'Host ID' : 'Meeting ID'}
174
+ {$config.FRONTEND_ENDPOINT || platform === 'web'
175
+ ? hostControlCheckbox
176
+ ? 'Host URL'
177
+ : 'Meeting URL'
178
+ : hostControlCheckbox
179
+ ? 'Host ID'
180
+ : 'Meeting ID'}
162
181
  </Text>
163
182
  <View style={style.urlHolder}>
164
- <Text style={[style.url, Platform.OS === 'web' ? urlWeb : {opacity: 1}]}>
183
+ <Text
184
+ style={[
185
+ style.url,
186
+ Platform.OS === 'web' ? urlWeb : {opacity: 1},
187
+ ]}>
165
188
  {$config.FRONTEND_ENDPOINT
166
189
  ? `${$config.FRONTEND_ENDPOINT}/${urlHost}`
167
190
  : platform === 'web'
168
- ? `${window.location.origin}/${urlHost}`
169
- : urlHost}
191
+ ? `${window.location.origin}/${urlHost}`
192
+ : urlHost}
170
193
  </Text>
171
-
172
194
  </View>
173
195
  </View>
174
- <View style={{ marginLeft: 'auto', flexDirection: 'row', alignSelf: 'center' }}>
175
- <View style={{ backgroundColor: $config.PRIMARY_COLOR + '80', width: 1, height: 'auto', marginRight: 15 }} />
176
- <TouchableOpacity style={{ width: 40, height: 40, marginVertical: 'auto' }} onPress={()=>copyHostUrl()}>
177
- <Image resizeMode={'contain'}
178
- style={{ width: '100%', height: '100%', tintColor: $config.PRIMARY_COLOR, opacity: 0.5}}
179
- source={{ uri: icons.clipboard }}></Image>
180
- </TouchableOpacity>
196
+ <View
197
+ style={{
198
+ marginLeft: 'auto',
199
+ flexDirection: 'row',
200
+ alignSelf: 'center',
201
+ }}>
202
+ <View
203
+ style={{
204
+ backgroundColor: $config.PRIMARY_COLOR + '80',
205
+ width: 1,
206
+ height: 'auto',
207
+ marginRight: 15,
208
+ }}
209
+ />
210
+ <View style={style.clipboardIconHolder}>
211
+ <BtnTemplate
212
+ style={style.clipboardIcon}
213
+ color={$config.PRIMARY_COLOR}
214
+ name={'clipboard'}
215
+ onPress={() => copyHostUrl()}
216
+ />
217
+ </View>
181
218
  </View>
182
219
  </View>
183
220
  {pstn ? (
184
221
  <View style={style.urlContainer}>
185
- <View style={{ width: '80%' }}>
186
- <Text style={style.urlTitle}>
187
- PSTN
188
- </Text>
222
+ <View style={{width: '80%'}}>
223
+ <Text style={style.urlTitle}>PSTN</Text>
189
224
  <View>
190
225
  <View style={style.pstnHolder}>
191
226
  <Text style={style.urlTitle}>Number: </Text>
192
- <Text style={[style.url, Platform.OS === 'web' ? urlWeb : {opacity: 1}]}>{pstn?.number}</Text>
227
+ <Text
228
+ style={[
229
+ style.url,
230
+ Platform.OS === 'web' ? urlWeb : {opacity: 1},
231
+ ]}>
232
+ {pstn?.number}
233
+ </Text>
193
234
  </View>
194
235
  <View style={style.pstnHolder}>
195
236
  <Text style={style.urlTitle}>Pin: </Text>
196
- <Text style={[style.url, Platform.OS === 'web' ? urlWeb : {opacity: 1}]}>{pstn?.dtmf}</Text>
237
+ <Text
238
+ style={[
239
+ style.url,
240
+ Platform.OS === 'web' ? urlWeb : {opacity: 1},
241
+ ]}>
242
+ {pstn?.dtmf}
243
+ </Text>
197
244
  </View>
198
245
  </View>
199
246
  </View>
200
- <View style={{ marginLeft: 'auto', flexDirection: 'row' }}>
201
- <View style={{ backgroundColor: $config.PRIMARY_COLOR + '80', width: 1, height: 'auto', marginRight: 15 }} />
202
- <TouchableOpacity style={{ width: 40, height: 40, marginVertical: 'auto' }} onPress={() => copyPstn()}>
203
- <Image resizeMode={'contain'}
204
- style={{ width: '100%', height: '100%', tintColor: $config.PRIMARY_COLOR, opacity: 0.5 }}
205
- source={{ uri: icons.clipboard }}></Image>
206
- </TouchableOpacity>
247
+ <View style={{marginLeft: 'auto', flexDirection: 'row'}}>
248
+ <View
249
+ style={{
250
+ backgroundColor: $config.PRIMARY_COLOR + '80',
251
+ width: 1,
252
+ height: 'auto',
253
+ marginRight: 15,
254
+ }}
255
+ />
256
+ <View style={style.clipboardIconHolder}>
257
+ <BtnTemplate
258
+ style={style.clipboardIcon}
259
+ color={$config.PRIMARY_COLOR}
260
+ name={'clipboard'}
261
+ onPress={() => copyPstn()}
262
+ />
263
+ </View>
207
264
  </View>
208
265
  </View>
209
266
  ) : (
@@ -289,9 +346,9 @@ const style = StyleSheet.create({
289
346
  },
290
347
  urlContainer: {
291
348
  backgroundColor: $config.PRIMARY_COLOR + '22',
292
- padding: 10,
349
+ padding: 10,
293
350
  marginBottom: 10,
294
- borderRadius: 10,
351
+ borderRadius: 10,
295
352
  width: '100%',
296
353
  // minWidth: ''
297
354
  maxWidth: 700,
@@ -333,6 +390,18 @@ const style = StyleSheet.create({
333
390
  pstnMargin: {
334
391
  marginRight: '10%',
335
392
  },
393
+ clipboardIconHolder: {
394
+ width: 40,
395
+ height: 40,
396
+ marginVertical: 'auto',
397
+ },
398
+ clipboardIcon: {
399
+ width: 40,
400
+ height: 40,
401
+ marginVertical: 'auto',
402
+ opacity: 0.5,
403
+ backgroundColor: 'transparent',
404
+ },
336
405
  });
337
406
 
338
407
  export default Share;
@@ -0,0 +1,28 @@
1
+ import React from 'react';
2
+
3
+ function useImageDelay(
4
+ elementRef: any,
5
+ delay: number | null,
6
+ imageName: string,
7
+ ) {
8
+ // Remember the latest callback if it changes.
9
+ React.useEffect(() => {
10
+ // The following block allows to repaint the icon
11
+ let imageElement: any;
12
+ if (elementRef && elementRef.current) {
13
+ const imageContainer = elementRef.current as any;
14
+ if (imageContainer && imageContainer.children.length > 0) {
15
+ imageElement = imageContainer.children[0];
16
+ imageElement.style.display = 'none';
17
+ }
18
+ }
19
+ const timer = setTimeout(() => {
20
+ if (imageElement) {
21
+ imageElement.style.display = 'initial';
22
+ }
23
+ }, delay);
24
+ return () => clearTimeout(timer);
25
+ }, [imageName]);
26
+ }
27
+
28
+ export default useImageDelay;
@@ -20,6 +20,7 @@ import {
20
20
  import Logo from '../subComponents/Logo';
21
21
  import OAuth from '../components/OAuth';
22
22
  import Illustration from '../subComponents/Illustration';
23
+ import hasBrandLogo from '../utils/hasBrandLogo';
23
24
 
24
25
  const Authenticate = () => {
25
26
  const [dim, setDim] = useState([
@@ -37,13 +38,13 @@ const Authenticate = () => {
37
38
  style={style.full}
38
39
  resizeMode={'cover'}>
39
40
  <View style={style.main}>
40
- <View style={style.nav}>
41
- <Logo />
42
- </View>
41
+ <View style={style.nav}>{hasBrandLogo && <Logo />}</View>
43
42
  <View style={style.content}>
44
43
  <View style={style.leftContent}>
45
44
  <Text style={style.heading}>Login using OAuth</Text>
46
- <Text style={style.headline}>Please select an OAuth provider to login.</Text>
45
+ <Text style={style.headline}>
46
+ Please select an OAuth provider to login.
47
+ </Text>
47
48
  <OAuth />
48
49
  </View>
49
50
  {dim[0] > dim[1] + 150 ? (
@@ -9,8 +9,8 @@
9
9
  information visit https://appbuilder.agora.io.
10
10
  *********************************************
11
11
  */
12
- import React, {useState} from 'react';
13
- import {View, Text, StyleSheet, Dimensions, ScrollView} from 'react-native';
12
+ import React, {useEffect, useState} from 'react';
13
+ import {View, Text, StyleSheet, Dimensions, ScrollView, Platform} from 'react-native';
14
14
  import {useHistory} from '../components/Router';
15
15
  import Checkbox from '../subComponents/Checkbox';
16
16
  import {gql, useMutation} from '@apollo/client';
@@ -26,6 +26,7 @@ import HorizontalRule from '../atoms/HorizontalRule';
26
26
  import TextInput from '../atoms/TextInput';
27
27
  import Error from '../subComponents/Error';
28
28
  import Toast from '../../react-native-toast-message';
29
+ import hasBrandLogo from '../utils/hasBrandLogo';
29
30
 
30
31
  type PasswordInput = {
31
32
  host: string;
@@ -72,6 +73,12 @@ const Create = () => {
72
73
 
73
74
  console.log('mutation data', data);
74
75
 
76
+ useEffect(() => {
77
+ if(Platform.OS === 'web'){
78
+ document.title = $config.APP_NAME;
79
+ }
80
+ },[])
81
+
75
82
  const createRoom = () => {
76
83
  if (roomTitle !== '') {
77
84
  console.log('Create room invoked');
@@ -114,9 +121,9 @@ const Create = () => {
114
121
  // style={style.full}
115
122
  // resizeMode={'cover'}>
116
123
  // <KeyboardAvoidingView behavior={'height'} style={style.main}>
117
- <ScrollView contentContainerStyle={style.main}>
124
+ <ScrollView contentContainerStyle={style.main}>
118
125
  <View style={style.nav}>
119
- <Logo />
126
+ {hasBrandLogo && <Logo />}
120
127
  {error ? <Error error={error} /> : <></>}
121
128
  {/* <OpenInNativeButton /> */}
122
129
  </View>
@@ -15,6 +15,7 @@ import {useHistory} from '../components/Router';
15
15
  import SessionContext from '../components/SessionContext';
16
16
  // import OpenInNativeButton from '../subComponents/OpenInNativeButton';
17
17
  import Logo from '../subComponents/Logo';
18
+ import hasBrandLogo from '../utils/hasBrandLogo';
18
19
  import LogoutButton from '../subComponents/LogoutButton';
19
20
  import ColorContext from '../components/ColorContext';
20
21
  // import Illustration from '../subComponents/Illustration';
@@ -58,7 +59,7 @@ const Join = (props: joinProps) => {
58
59
  return (
59
60
  <ScrollView contentContainerStyle={style.main}>
60
61
  <View style={style.nav}>
61
- <Logo />
62
+ {hasBrandLogo && <Logo />}
62
63
  {error ? <Error error={error} /> : <></>}
63
64
  </View>
64
65
  <View style={style.content}>