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.
- package/package.json +3 -2
- package/template/_package-lock.json +22850 -0
- package/template/agora-rn-uikit/.git/HEAD +1 -1
- package/template/agora-rn-uikit/.git/index +0 -0
- package/template/agora-rn-uikit/.git/logs/HEAD +2 -3
- package/template/agora-rn-uikit/.git/logs/refs/heads/ab-dev-auto +1 -1
- package/template/agora-rn-uikit/.git/logs/refs/heads/master +1 -1
- package/template/agora-rn-uikit/.git/logs/refs/remotes/origin/HEAD +1 -1
- package/template/agora-rn-uikit/.git/objects/pack/pack-f379286d0537eb68377220b4929979324b8d5d1c.idx +0 -0
- package/template/agora-rn-uikit/.git/objects/pack/{pack-19a65e0782e617d79275088a06e668496d6e2d73.pack → pack-f379286d0537eb68377220b4929979324b8d5d1c.pack} +0 -0
- package/template/agora-rn-uikit/.git/packed-refs +3 -2
- package/template/agora-rn-uikit/.git/refs/heads/ab-dev-auto +1 -1
- package/template/agora-rn-uikit/package.json +1 -0
- package/template/agora-rn-uikit/src/AgoraUIKit.tsx +8 -8
- package/template/agora-rn-uikit/src/{LocalUserContext.tsx → Contexts/LocalUserContext.tsx} +1 -1
- package/template/agora-rn-uikit/src/{MaxUidContext.tsx → Contexts/MaxUidContext.tsx} +0 -0
- package/template/agora-rn-uikit/src/{MinUidContext.tsx → Contexts/MinUidContext.tsx} +0 -0
- package/template/agora-rn-uikit/src/{PropsContext.tsx → Contexts/PropsContext.tsx} +34 -16
- package/template/agora-rn-uikit/src/{RtcContext.tsx → Contexts/RtcContext.tsx} +12 -21
- package/template/agora-rn-uikit/src/Controls/BtnTemplate.tsx +25 -15
- package/template/agora-rn-uikit/src/Controls/Icons.ts +53 -3
- package/template/agora-rn-uikit/src/Controls/ImageIcon.tsx +53 -0
- package/template/agora-rn-uikit/src/Controls/Local/EndCall.tsx +4 -3
- package/template/agora-rn-uikit/src/Controls/Local/FullScreen.tsx +3 -3
- package/template/agora-rn-uikit/src/Controls/Local/LocalAudioMute.tsx +58 -14
- package/template/agora-rn-uikit/src/Controls/Local/LocalVideoMute.tsx +60 -14
- package/template/agora-rn-uikit/src/Controls/Local/Recording.tsx +2 -2
- package/template/agora-rn-uikit/src/Controls/Local/Screenshare.tsx +2 -2
- package/template/agora-rn-uikit/src/Controls/Local/SwitchCamera.tsx +9 -9
- package/template/agora-rn-uikit/src/Controls/LocalControls.tsx +20 -17
- package/template/agora-rn-uikit/src/Controls/Remote/RemoteAudioMute.tsx +8 -8
- package/template/agora-rn-uikit/src/Controls/Remote/RemoteSwap.tsx +3 -3
- package/template/agora-rn-uikit/src/Controls/Remote/RemoteVideoMute.tsx +13 -8
- package/template/agora-rn-uikit/src/Controls/RemoteControls.tsx +1 -2
- package/template/agora-rn-uikit/src/Reducer/LocalMuteAudio.ts +20 -0
- package/template/agora-rn-uikit/src/Reducer/LocalMuteVideo.ts +20 -0
- package/template/agora-rn-uikit/src/Reducer/RemoteAudioStateChanged.ts +26 -0
- package/template/agora-rn-uikit/src/Reducer/RemoteVideoStateChanged.ts +26 -0
- package/template/agora-rn-uikit/src/Reducer/UpdateDualStreamMode.ts +46 -0
- package/template/agora-rn-uikit/src/Reducer/UserJoined.ts +47 -0
- package/template/agora-rn-uikit/src/Reducer/UserMuteRemoteAudio.ts +20 -0
- package/template/agora-rn-uikit/src/Reducer/UserMuteRemoteVideo.ts +20 -0
- package/template/agora-rn-uikit/src/Reducer/UserOffline.ts +21 -0
- package/template/agora-rn-uikit/src/Reducer/index.ts +9 -0
- package/template/agora-rn-uikit/src/Rtc/Create.tsx +138 -0
- package/template/agora-rn-uikit/src/Rtc/Join.tsx +100 -0
- package/template/agora-rn-uikit/src/RtcConfigure.tsx +197 -0
- package/template/agora-rn-uikit/src/Style.ts +3 -3
- package/template/agora-rn-uikit/src/Utils/actionTypeGuard.tsx +9 -0
- package/template/agora-rn-uikit/src/{events.ts → Utils/events.ts} +0 -0
- package/template/agora-rn-uikit/src/{permission.ts → Utils/permission.ts} +0 -0
- package/template/agora-rn-uikit/src/{quality.tsx → Utils/quality.tsx} +0 -0
- package/template/agora-rn-uikit/src/{MaxVideoView.native.tsx → Views/MaxVideoView.native.tsx} +3 -4
- package/template/agora-rn-uikit/src/{MaxVideoView.tsx → Views/MaxVideoView.tsx} +3 -4
- package/template/agora-rn-uikit/src/Views/MinVideoView.tsx +86 -0
- package/template/agora-rn-uikit/src/index.ts +67 -0
- package/template/bridge/rtc/webNg/RtcEngine.ts +23 -6
- package/template/package-lock.json +22850 -0
- package/template/package.json +6 -5
- package/template/src/assets/icons.ts +35 -6
- package/template/src/atoms/SecondaryButton.tsx +6 -5
- package/template/src/atoms/TextInput.tsx +6 -1
- package/template/src/components/Chat.tsx +50 -21
- package/template/src/components/ChatContext.ts +22 -1
- package/template/src/components/Controls.native.tsx +2 -2
- package/template/src/components/Controls.tsx +2 -2
- package/template/src/components/DeviceConfigure.tsx +1 -1
- package/template/src/components/GridVideo.tsx +69 -31
- package/template/src/components/Navbar.tsx +136 -113
- package/template/src/components/NetworkQualityContext.tsx +134 -0
- package/template/src/components/ParticipantsView.tsx +105 -49
- package/template/src/components/PinnedVideo.tsx +112 -71
- package/template/src/components/Precall.native.tsx +20 -9
- package/template/src/components/Precall.tsx +35 -32
- package/template/src/components/RTMConfigure.tsx +331 -181
- package/template/src/components/RTMEvents.tsx +84 -0
- package/template/src/components/Settings.tsx +19 -16
- package/template/src/components/Share.tsx +131 -62
- package/template/src/hooks/useImageDelay.tsx +28 -0
- package/template/src/pages/Create.tsx +9 -3
- package/template/src/pages/VideoCall.tsx +124 -98
- package/template/src/subComponents/ChatContainer.tsx +40 -28
- package/template/src/subComponents/CopyJoinInfo.tsx +9 -12
- package/template/src/subComponents/LocalAudioMute.tsx +9 -9
- package/template/src/subComponents/LocalVideoMute.tsx +9 -9
- package/template/src/subComponents/NetworkQualityPill.tsx +161 -0
- package/template/src/subComponents/Recording.tsx +12 -16
- package/template/src/subComponents/RemoteAudioMute.tsx +23 -27
- package/template/src/subComponents/RemoteEndCall.tsx +7 -15
- package/template/src/subComponents/RemoteVideoMute.tsx +15 -28
- package/template/src/subComponents/ScreenShareNotice.tsx +61 -0
- package/template/src/subComponents/ScreenshareButton.tsx +74 -75
- package/template/src/subComponents/SwitchCamera.tsx +5 -2
- package/template/src/subComponents/TextWithTooltip.native.tsx +128 -0
- package/template/src/subComponents/TextWithTooltip.tsx +44 -0
- package/template/src/subComponents/toastConfig.tsx +2 -2
- package/template/src/utils/isSafariBrowser.tsx +22 -0
- package/template/agora-rn-uikit/.git/objects/pack/pack-19a65e0782e617d79275088a06e668496d6e2d73.idx +0 -0
- package/template/agora-rn-uikit/Components.js +0 -35
- package/template/agora-rn-uikit/Contexts.js +0 -7
- package/template/agora-rn-uikit/index.js +0 -12
- package/template/agora-rn-uikit/src/MinVideoView.tsx +0 -87
- 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
|
|
16
|
-
import {PropsProvider} from '../../agora-rn-uikit
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
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
|
|
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
|
-
<
|
|
370
|
-
|
|
371
|
-
style
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
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
|
|
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
|
-
|
|
34
|
-
|
|
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
|
-
<
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
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
|
-
</
|
|
53
|
-
<
|
|
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
|
|
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: {
|
|
94
|
-
|
|
97
|
+
row: {
|
|
98
|
+
flexDirection: 'row',
|
|
99
|
+
marginTop: 2,
|
|
100
|
+
alignItems: 'center',
|
|
95
101
|
paddingVertical: 10,
|
|
96
|
-
|
|
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: '
|
|
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
|
-
|
|
119
|
+
textAlign: 'left',
|
|
120
|
+
marginRight: 10
|
|
106
121
|
},
|
|
107
122
|
backIcon: {
|
|
108
123
|
width: 20,
|
|
109
|
-
height:
|
|
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
|
-
<
|
|
76
|
+
<BtnTemplate
|
|
76
77
|
disabled={!data}
|
|
77
78
|
style={style.backButton}
|
|
78
|
-
onPress={() => copyToClipboard()}
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
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
|
|
14
|
-
import {LocalContext} from '../../agora-rn-uikit
|
|
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
|
-
|
|
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
|
|
14
|
-
import {LocalContext} from '../../agora-rn-uikit
|
|
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
|
-
|
|
30
|
+
dispatch({
|
|
31
31
|
type: 'LocalMuteVideo',
|
|
32
32
|
value: [local.video],
|
|
33
33
|
});
|