agora-appbuilder-core 2.0.0 → 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 (103) hide show
  1. package/package.json +3 -2
  2. package/template/_package-lock.json +22850 -0
  3. package/template/agora-rn-uikit/.git/HEAD +1 -1
  4. package/template/agora-rn-uikit/.git/index +0 -0
  5. package/template/agora-rn-uikit/.git/logs/HEAD +2 -3
  6. package/template/agora-rn-uikit/.git/logs/refs/heads/ab-dev-auto +1 -1
  7. package/template/agora-rn-uikit/.git/logs/refs/heads/master +1 -1
  8. package/template/agora-rn-uikit/.git/logs/refs/remotes/origin/HEAD +1 -1
  9. package/template/agora-rn-uikit/.git/objects/pack/pack-f379286d0537eb68377220b4929979324b8d5d1c.idx +0 -0
  10. package/template/agora-rn-uikit/.git/objects/pack/{pack-19a65e0782e617d79275088a06e668496d6e2d73.pack → pack-f379286d0537eb68377220b4929979324b8d5d1c.pack} +0 -0
  11. package/template/agora-rn-uikit/.git/packed-refs +3 -2
  12. package/template/agora-rn-uikit/.git/refs/heads/ab-dev-auto +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 +25 -15
  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 +4 -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 -14
  26. package/template/agora-rn-uikit/src/Controls/Local/LocalVideoMute.tsx +60 -14
  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 +9 -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 +22850 -0
  59. package/template/package.json +6 -5
  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 +35 -32
  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/Create.tsx +9 -3
  81. package/template/src/pages/VideoCall.tsx +124 -98
  82. package/template/src/subComponents/ChatContainer.tsx +40 -28
  83. package/template/src/subComponents/CopyJoinInfo.tsx +9 -12
  84. package/template/src/subComponents/LocalAudioMute.tsx +9 -9
  85. package/template/src/subComponents/LocalVideoMute.tsx +9 -9
  86. package/template/src/subComponents/NetworkQualityPill.tsx +161 -0
  87. package/template/src/subComponents/Recording.tsx +12 -16
  88. package/template/src/subComponents/RemoteAudioMute.tsx +23 -27
  89. package/template/src/subComponents/RemoteEndCall.tsx +7 -15
  90. package/template/src/subComponents/RemoteVideoMute.tsx +15 -28
  91. package/template/src/subComponents/ScreenShareNotice.tsx +61 -0
  92. package/template/src/subComponents/ScreenshareButton.tsx +74 -75
  93. package/template/src/subComponents/SwitchCamera.tsx +5 -2
  94. package/template/src/subComponents/TextWithTooltip.native.tsx +128 -0
  95. package/template/src/subComponents/TextWithTooltip.tsx +44 -0
  96. package/template/src/subComponents/toastConfig.tsx +2 -2
  97. package/template/src/utils/isSafariBrowser.tsx +22 -0
  98. package/template/agora-rn-uikit/.git/objects/pack/pack-19a65e0782e617d79275088a06e668496d6e2d73.idx +0 -0
  99. package/template/agora-rn-uikit/Components.js +0 -35
  100. package/template/agora-rn-uikit/Contexts.js +0 -7
  101. package/template/agora-rn-uikit/index.js +0 -12
  102. package/template/agora-rn-uikit/src/MinVideoView.tsx +0 -87
  103. package/template/agora-rn-uikit/src/RTCConfigure.tsx +0 -520
@@ -12,8 +12,8 @@
12
12
  import React, {useState, useContext, useEffect} from 'react';
13
13
  import {View, StyleSheet, Text, Platform} from 'react-native';
14
14
 
15
- import RtcConfigure from '../../agora-rn-uikit/src/RTCConfigure';
16
- import {PropsProvider} from '../../agora-rn-uikit/src/PropsContext';
15
+ import {RtcConfigure} from '../../agora-rn-uikit';
16
+ import {PropsProvider} from '../../agora-rn-uikit';
17
17
  import Navbar from '../components/Navbar';
18
18
  import Precall from '../components/Precall';
19
19
  import ParticipantsView from '../components/ParticipantsView';
@@ -31,25 +31,30 @@ import {gql, useQuery} from '@apollo/client';
31
31
  import StorageContext from '../components/StorageContext';
32
32
  import Logo from '../subComponents/Logo';
33
33
  import hasBrandLogo from '../utils/hasBrandLogo';
34
- import ChatContext from '../components/ChatContext';
34
+ import ChatContext, {
35
+ messageActionType,
36
+ messageChannelType,
37
+ } from '../components/ChatContext';
35
38
  import {SidePanelType} from '../subComponents/SidePanelEnum';
36
39
  import {videoView} from '../../theme.json';
37
40
  import Layout from '../subComponents/LayoutEnum';
38
41
  import Toast from '../../react-native-toast-message';
42
+ import {NetworkQualityProvider} from '../components/NetworkQualityContext';
39
43
 
40
44
  const useChatNotification = (
41
45
  messageStore: string | any[],
42
46
  privateMessageStore: string | any[],
43
47
  chatDisplayed: boolean,
48
+ isPrivateChatDisplayed: boolean
44
49
  ) => {
45
50
  // store the last checked state from the messagestore, to identify unread messages
46
51
  const [lastCheckedPublicState, setLastCheckedPublicState] = useState(0);
47
52
  const [lastCheckedPrivateState, setLastCheckedPrivateState] = useState({});
48
53
  useEffect(() => {
49
- if (chatDisplayed) {
54
+ if (chatDisplayed && !isPrivateChatDisplayed) {
50
55
  setLastCheckedPublicState(messageStore.length);
51
56
  }
52
- }, [messageStore]);
57
+ }, [messageStore,isPrivateChatDisplayed]);
53
58
 
54
59
  const setPrivateMessageLastSeen = ({userId, lastSeenCount}) => {
55
60
  setLastCheckedPrivateState((prevState) => {
@@ -65,8 +70,8 @@ const useChatNotification = (
65
70
  ];
66
71
  };
67
72
 
68
- const NotificationControl = ({children, chatDisplayed, setSidePanel}) => {
69
- const {messageStore, privateMessageStore, userList, localUid} =
73
+ const NotificationControl = ({children, chatDisplayed, setSidePanel, isPrivateChatDisplayed}) => {
74
+ const {messageStore, privateMessageStore, userList, localUid, events} =
70
75
  useContext(ChatContext);
71
76
  const [
72
77
  lastCheckedPublicState,
@@ -74,14 +79,21 @@ const NotificationControl = ({children, chatDisplayed, setSidePanel}) => {
74
79
  lastCheckedPrivateState,
75
80
  setLastCheckedPrivateState,
76
81
  setPrivateMessageLastSeen,
77
- ] = useChatNotification(messageStore, privateMessageStore, chatDisplayed);
82
+ ] = useChatNotification(messageStore, privateMessageStore, chatDisplayed, isPrivateChatDisplayed);
83
+
78
84
  const pendingPublicNotification =
79
85
  messageStore.length - lastCheckedPublicState;
80
86
  const privateMessageCountMap = Object.keys(privateMessageStore).reduce(
81
87
  (acc, curItem) => {
82
88
  let individualPrivateMessageCount = privateMessageStore[curItem].reduce(
83
89
  (total, item) => {
84
- return item.uid === curItem ? total + 1 : total;
90
+ if (Platform.OS === 'android') {
91
+ //In template/src/components/RTMConfigure.tsx
92
+ //on messageReceived event - For android platform we are passing uid as number type. so checking == for android
93
+ return item.uid == curItem ? total + 1 : total;
94
+ } else {
95
+ return item.uid === curItem ? total + 1 : total;
96
+ }
85
97
  },
86
98
  0,
87
99
  );
@@ -99,41 +111,45 @@ const NotificationControl = ({children, chatDisplayed, setSidePanel}) => {
99
111
  );
100
112
  const pendingPrivateNotification = totalPrivateMessage - totalPrivateLastSeen;
101
113
 
102
- // const oldMessageStore = useRef<messageStoreInterface[]>([]);
103
- // useEffect(() => {
104
- // if (messageStore.length > oldMessageStore.current.length && messageStore[messageStore.length - 1].uid !== localUid) {
105
- // Toast.show({
106
- // text1: messageStore[messageStore.length - 1]?.msg.length > 50 ? messageStore[messageStore.length - 1]?.msg.slice(1, 50) + '...' : messageStore[messageStore.length - 1]?.msg.slice(1),
107
- // text2: userList[messageStore[messageStore.length - 1]?.uid] ? userList[messageStore[messageStore.length - 1]?.uid].name : 'User',
108
- // visibilityTime: 1000,
109
- // onPress: () => setSidePanel(SidePanelType.Chat),
110
- // });
111
- // oldMessageStore.current = messageStore;
112
- // }
113
- // }, [messageStore, userList]);
114
-
115
- useEffect(() => {
116
- if (
117
- messageStore.length !== 0 &&
118
- messageStore[messageStore.length - 1]?.uid !== localUid
119
- ) {
120
- Toast.show({
121
- text1:
122
- messageStore[messageStore.length - 1]?.msg.length > 50
123
- ? messageStore[messageStore.length - 1]?.msg.slice(1, 50) + '...'
124
- : messageStore[messageStore.length - 1]?.msg.slice(1),
125
- text2: userList[messageStore[messageStore.length - 1]?.uid]
126
- ? 'From: ' + userList[messageStore[messageStore.length - 1]?.uid].name
127
- : '',
128
- visibilityTime: 1000,
129
- onPress: () => {
130
- setSidePanel(SidePanelType.Chat);
131
- setLastCheckedPublicState(messageStore.length);
132
- },
133
- });
134
- }
135
- // eslint-disable-next-line react-hooks/exhaustive-deps
136
- }, [messageStore]);
114
+ React.useEffect(() => {
115
+ const showMessageNotification = (data: any) => {
116
+ if (data.type === messageActionType.Normal) {
117
+ const {uid, msg} = data;
118
+ Toast.show({
119
+ type: 'success',
120
+ text1: msg.length > 30 ? msg.slice(0, 30) + '...' : msg,
121
+ text2: userList[uid]?.name ? 'From: ' + userList[uid]?.name : '',
122
+ visibilityTime: 1000,
123
+ onPress: () => {
124
+ setSidePanel(SidePanelType.Chat);
125
+ setLastCheckedPublicState(messageStore.length);
126
+ },
127
+ });
128
+ }
129
+ };
130
+ events.on(
131
+ messageChannelType.Public,
132
+ 'onPublicMessageReceived',
133
+ (data: any, error: any) => {
134
+ if (!data) return;
135
+ showMessageNotification(data);
136
+ },
137
+ );
138
+ events.on(
139
+ messageChannelType.Private,
140
+ 'onPrivateMessageReceived',
141
+ (data: any, error: any) => {
142
+ if (!data) return;
143
+ if (data.uid === localUid) return;
144
+ showMessageNotification(data);
145
+ },
146
+ );
147
+ return () => {
148
+ // Cleanup the listeners
149
+ events.off(messageChannelType.Public, 'onPublicMessageReceived');
150
+ events.off(messageChannelType.Private, 'onPrivateMessageReceived');
151
+ };
152
+ }, [userList, messageStore]);
137
153
 
138
154
  return children({
139
155
  pendingPublicNotification,
@@ -230,6 +246,7 @@ const VideoCall: React.FC = () => {
230
246
  const [chatDisplayed, setChatDisplayed] = useState(false);
231
247
  const [queryComplete, setQueryComplete] = useState(false);
232
248
  const [sidePanel, setSidePanel] = useState<SidePanelType>(SidePanelType.None);
249
+ const [isPrivateChatDisplayed, setPrivateChatDisplayed] = useState(false)
233
250
  const {phrase} = useParams();
234
251
  const [errorMessage, setErrorMessage] = useState(null);
235
252
  const [isHost, setIsHost] = React.useState(false);
@@ -323,11 +340,14 @@ const VideoCall: React.FC = () => {
323
340
  <>
324
341
  <PropsProvider
325
342
  value={{
326
- rtcProps,
343
+ rtcProps: {
344
+ ...rtcProps,
345
+ callActive,
346
+ },
327
347
  callbacks,
328
348
  styleProps,
329
349
  }}>
330
- <RtcConfigure callActive={callActive}>
350
+ <RtcConfigure>
331
351
  <DeviceConfigure>
332
352
  <RtmConfigure
333
353
  setRecordingActive={setRecordingActive}
@@ -337,7 +357,9 @@ const VideoCall: React.FC = () => {
337
357
  <View style={style.full}>
338
358
  <NotificationControl
339
359
  setSidePanel={setSidePanel}
340
- chatDisplayed={sidePanel === SidePanelType.Chat}>
360
+ chatDisplayed={sidePanel === SidePanelType.Chat}
361
+ isPrivateChatDisplayed={isPrivateChatDisplayed}
362
+ >
341
363
  {({
342
364
  pendingPublicNotification,
343
365
  pendingPrivateNotification,
@@ -366,60 +388,63 @@ const VideoCall: React.FC = () => {
366
388
  setLastCheckedPublicState
367
389
  }
368
390
  />
369
- <View
370
- style={[
371
- style.videoView,
372
- {backgroundColor: '#ffffff00'},
373
- ]}>
374
- {layout === Layout.Pinned ? (
375
- <PinnedVideo />
376
- ) : (
377
- <GridVideo setLayout={setLayout} />
378
- )}
379
- {sidePanel === SidePanelType.Participants ? (
380
- <ParticipantsView
381
- isHost={isHost}
382
- // setParticipantsView={setParticipantsView}
383
- setSidePanel={setSidePanel}
384
- />
385
- ) : (
386
- <></>
387
- )}
388
- {sidePanel === SidePanelType.Chat ? (
389
- $config.CHAT ? (
390
- <Chat
391
- privateMessageCountMap={
392
- privateMessageCountMap
393
- }
394
- pendingPublicNotification={
395
- pendingPublicNotification
396
- }
397
- pendingPrivateNotification={
398
- pendingPrivateNotification
399
- }
400
- setPrivateMessageLastSeen={
401
- setPrivateMessageLastSeen
402
- }
403
- lastCheckedPrivateState={
404
- lastCheckedPrivateState
405
- }
391
+ <NetworkQualityProvider>
392
+ <View
393
+ style={[
394
+ style.videoView,
395
+ {backgroundColor: '#ffffff00'},
396
+ ]}>
397
+ {layout === Layout.Pinned ? (
398
+ <PinnedVideo />
399
+ ) : (
400
+ <GridVideo setLayout={setLayout} />
401
+ )}
402
+ {sidePanel === SidePanelType.Participants ? (
403
+ <ParticipantsView
404
+ isHost={isHost}
405
+ // setParticipantsView={setParticipantsView}
406
+ setSidePanel={setSidePanel}
407
+ />
408
+ ) : (
409
+ <></>
410
+ )}
411
+ {sidePanel === SidePanelType.Chat ? (
412
+ $config.CHAT ? (
413
+ <Chat
414
+ setPrivateChatDisplayed={setPrivateChatDisplayed}
415
+ privateMessageCountMap={
416
+ privateMessageCountMap
417
+ }
418
+ pendingPublicNotification={
419
+ pendingPublicNotification
420
+ }
421
+ pendingPrivateNotification={
422
+ pendingPrivateNotification
423
+ }
424
+ setPrivateMessageLastSeen={
425
+ setPrivateMessageLastSeen
426
+ }
427
+ lastCheckedPrivateState={
428
+ lastCheckedPrivateState
429
+ }
430
+ />
431
+ ) : (
432
+ <></>
433
+ )
434
+ ) : (
435
+ <></>
436
+ )}
437
+ {sidePanel === SidePanelType.Settings ? (
438
+ <SettingsView
439
+ isHost={isHost}
440
+ // setParticipantsView={setParticipantsView}
441
+ setSidePanel={setSidePanel}
406
442
  />
407
443
  ) : (
408
444
  <></>
409
- )
410
- ) : (
411
- <></>
412
- )}
413
- {sidePanel === SidePanelType.Settings ? (
414
- <SettingsView
415
- isHost={isHost}
416
- // setParticipantsView={setParticipantsView}
417
- setSidePanel={setSidePanel}
418
- />
419
- ) : (
420
- <></>
421
- )}
422
- </View>
445
+ )}
446
+ </View>
447
+ </NetworkQualityProvider>
423
448
  {Platform.OS !== 'web' &&
424
449
  sidePanel === SidePanelType.Chat ? (
425
450
  <></>
@@ -455,6 +480,7 @@ const VideoCall: React.FC = () => {
455
480
  setUsername={setUsername}
456
481
  setCallActive={setCallActive}
457
482
  queryComplete={queryComplete}
483
+ title={title}
458
484
  />
459
485
  ) : (
460
486
  <></>
@@ -18,10 +18,13 @@ import {
18
18
  StyleSheet,
19
19
  Image,
20
20
  Platform,
21
+ useWindowDimensions
21
22
  } from 'react-native';
23
+ import {RFValue} from 'react-native-responsive-fontsize';
22
24
  import ChatBubble from './ChatBubble';
23
25
  import ChatContext from '../components/ChatContext';
24
- import icons from '../assets/icons';
26
+ import {BtnTemplate} from '../../agora-rn-uikit';
27
+ import TextWithTooltip from './TextWithTooltip';
25
28
 
26
29
  /**
27
30
  * Chat container is the component which renders all the chat messages
@@ -29,33 +32,34 @@ import icons from '../assets/icons';
29
32
  * and maps it to a ChatBubble
30
33
  */
31
34
  const ChatContainer = (props: any) => {
32
- const {
33
- selectedUser,
34
- privateActive,
35
- setPrivateActive,
36
- selectedUsername,
37
- } = props;
35
+ const {height, width} = useWindowDimensions();
36
+ const {selectedUser, privateActive, setPrivateActive, selectedUsername} =
37
+ props;
38
38
  const {messageStore, localUid, privateMessageStore} = useContext(ChatContext);
39
39
  const scrollViewRef = useRef<ScrollView>(null);
40
40
  return (
41
41
  <View style={style.containerView}>
42
42
  {privateActive ? (
43
43
  <View style={style.row}>
44
- <TouchableOpacity
45
- style={style.backButton}
46
- onPress={() => setPrivateActive(false)}>
47
- <Image
48
- resizeMode={'contain'}
49
- style={style.backIcon}
50
- source={{uri: icons.backBtn}}
44
+ <View style={style.backButton}>
45
+ <BtnTemplate
46
+ style={[style.backIcon]}
47
+ onPress={() => setPrivateActive(false)}
48
+ name={'backBtn'}
51
49
  />
52
- </TouchableOpacity>
53
- <Text style={style.name}>{selectedUsername}</Text>
50
+ </View>
51
+ <View style={{flex:1}}>
52
+ <TextWithTooltip style={[style.name, {flexShrink: 1,fontSize: RFValue(16, height > width ? height : width)}]} value={selectedUsername} />
53
+ </View>
54
54
  </View>
55
55
  ) : (
56
56
  <></>
57
57
  )}
58
- <ScrollView ref={scrollViewRef} onContentSizeChange={()=>{scrollViewRef.current?.scrollToEnd({ animated: true })}}>
58
+ <ScrollView
59
+ ref={scrollViewRef}
60
+ onContentSizeChange={() => {
61
+ scrollViewRef.current?.scrollToEnd({animated: true});
62
+ }}>
59
63
  {!privateActive ? (
60
64
  messageStore.map((message: any) => {
61
65
  return (
@@ -90,26 +94,34 @@ const ChatContainer = (props: any) => {
90
94
 
91
95
  const style = StyleSheet.create({
92
96
  containerView: {flex: 8},
93
- row: {flexDirection: 'row', marginTop: 2},
94
- backButton: {
97
+ row: {
98
+ flexDirection: 'row',
99
+ marginTop: 2,
100
+ alignItems: 'center',
95
101
  paddingVertical: 10,
96
- marginLeft: 10,
102
+ ...Platform.select({
103
+ android:{
104
+ height: 40
105
+ },
106
+ ios:{
107
+ height: 40
108
+ }
109
+ })
110
+ },
111
+ backButton: {
112
+ marginHorizontal: 10,
97
113
  justifyContent: 'center',
98
- alignSelf: 'center',
114
+ alignSelf: 'flex-end',
99
115
  },
100
116
  name: {
101
- fontSize: 18,
102
117
  fontWeight: Platform.OS === 'web' ? '500' : '700',
103
- marginLeft: 10,
104
118
  color: $config.PRIMARY_FONT_COLOR,
105
- alignSelf: 'center',
119
+ textAlign: 'left',
120
+ marginRight: 10
106
121
  },
107
122
  backIcon: {
108
123
  width: 20,
109
- height: 12,
110
- alignSelf: 'center',
111
- justifyContent: 'center',
112
- tintColor: $config.PRIMARY_FONT_COLOR,
124
+ height: 20,
113
125
  },
114
126
  });
115
127
  export default ChatContainer;
@@ -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
  });