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.
- package/package.json +5 -2
- package/template/_package-lock.json +22850 -0
- package/template/agora-rn-uikit/.git/HEAD +1 -0
- package/template/agora-rn-uikit/.git/config +16 -0
- package/template/agora-rn-uikit/.git/description +1 -0
- package/template/agora-rn-uikit/.git/hooks/applypatch-msg.sample +15 -0
- package/template/agora-rn-uikit/.git/hooks/commit-msg.sample +24 -0
- package/template/agora-rn-uikit/.git/hooks/fsmonitor-watchman.sample +173 -0
- package/template/agora-rn-uikit/.git/hooks/post-update.sample +8 -0
- package/template/agora-rn-uikit/.git/hooks/pre-applypatch.sample +14 -0
- package/template/agora-rn-uikit/.git/hooks/pre-commit.sample +49 -0
- package/template/agora-rn-uikit/.git/hooks/pre-merge-commit.sample +13 -0
- package/template/agora-rn-uikit/.git/hooks/pre-push.sample +53 -0
- package/template/agora-rn-uikit/.git/hooks/pre-rebase.sample +169 -0
- package/template/agora-rn-uikit/.git/hooks/pre-receive.sample +24 -0
- package/template/agora-rn-uikit/.git/hooks/prepare-commit-msg.sample +42 -0
- package/template/agora-rn-uikit/.git/hooks/push-to-checkout.sample +78 -0
- package/template/agora-rn-uikit/.git/hooks/update.sample +128 -0
- package/template/agora-rn-uikit/.git/index +0 -0
- package/template/agora-rn-uikit/.git/info/exclude +6 -0
- package/template/agora-rn-uikit/.git/logs/HEAD +2 -0
- package/template/agora-rn-uikit/.git/logs/refs/heads/ab-dev-auto +1 -0
- package/template/agora-rn-uikit/.git/logs/refs/heads/master +1 -0
- package/template/agora-rn-uikit/.git/logs/refs/remotes/origin/HEAD +1 -0
- package/template/agora-rn-uikit/.git/objects/pack/pack-f379286d0537eb68377220b4929979324b8d5d1c.idx +0 -0
- package/template/agora-rn-uikit/.git/objects/pack/pack-f379286d0537eb68377220b4929979324b8d5d1c.pack +0 -0
- package/template/agora-rn-uikit/.git/packed-refs +12 -0
- package/template/agora-rn-uikit/.git/refs/heads/ab-dev-auto +1 -0
- package/template/agora-rn-uikit/.git/refs/heads/master +1 -0
- package/template/agora-rn-uikit/.git/refs/remotes/origin/HEAD +1 -0
- package/template/agora-rn-uikit/.gitignore +63 -0
- package/template/agora-rn-uikit/package-lock.json +7612 -0
- 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 -4
- package/template/react-native-toast-message/.gitignore +5 -0
- package/template/react-native-toast-message/.npmignore +5 -0
- package/template/react-native-toast-message/package-lock.json +10553 -0
- package/template/src/.DS_Store +0 -0
- 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 +42 -23
- package/template/src/components/Precall.tsx +56 -51
- 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/components/StorageContext.tsx +2 -0
- package/template/src/hooks/useImageDelay.tsx +28 -0
- package/template/src/pages/Authenticate.tsx +5 -4
- package/template/src/pages/Create.tsx +26 -16
- package/template/src/pages/Join.tsx +13 -30
- package/template/src/pages/VideoCall.tsx +181 -137
- package/template/src/subComponents/.DS_Store +0 -0
- 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/LogoutButton.tsx +1 -1
- 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 +76 -75
- package/template/src/subComponents/SelectOAuth.tsx +25 -12
- 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/hasBrandLogo.tsx +3 -0
- package/template/src/utils/isSafariBrowser.tsx +22 -0
- package/template/webpack.commons.js +1 -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 -516
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
*/
|
|
12
12
|
import RtmEngine from 'agora-react-native-rtm';
|
|
13
13
|
import {createContext} from 'react';
|
|
14
|
+
import {rtmEventsInterface} from './RTMEvents';
|
|
14
15
|
|
|
15
16
|
export interface channelMessage {
|
|
16
17
|
isLocal: boolean;
|
|
@@ -25,6 +26,25 @@ export interface messageStoreInterface {
|
|
|
25
26
|
msg: string;
|
|
26
27
|
}
|
|
27
28
|
|
|
29
|
+
export interface messageEventInterface extends messageStoreInterface {
|
|
30
|
+
type: messageActionType;
|
|
31
|
+
source: messageSourceType;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export enum messageSourceType {
|
|
35
|
+
Core = 'core',
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export enum messageChannelType {
|
|
39
|
+
Private = 'private',
|
|
40
|
+
Public = 'public',
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export enum messageActionType {
|
|
44
|
+
Control = '0',
|
|
45
|
+
Normal = '1',
|
|
46
|
+
}
|
|
47
|
+
|
|
28
48
|
interface chatContext {
|
|
29
49
|
messageStore: messageStoreInterface | any;
|
|
30
50
|
privateMessageStore: any;
|
|
@@ -35,6 +55,7 @@ interface chatContext {
|
|
|
35
55
|
engine: RtmEngine;
|
|
36
56
|
localUid: string;
|
|
37
57
|
userList: any;
|
|
58
|
+
events: rtmEventsInterface;
|
|
38
59
|
// peersRTM: Array<string>;
|
|
39
60
|
}
|
|
40
61
|
|
|
@@ -48,6 +69,6 @@ export enum controlMessageEnum {
|
|
|
48
69
|
cloudRecordingUnactive = '7',
|
|
49
70
|
}
|
|
50
71
|
|
|
51
|
-
const ChatContext = createContext(
|
|
72
|
+
const ChatContext = createContext(null as unknown as chatContext);
|
|
52
73
|
|
|
53
74
|
export default ChatContext;
|
|
@@ -18,13 +18,13 @@ import {
|
|
|
18
18
|
StyleSheet,
|
|
19
19
|
Text,
|
|
20
20
|
} from 'react-native';
|
|
21
|
-
import LocalUserContext from '../../agora-rn-uikit
|
|
21
|
+
import {LocalUserContext} from '../../agora-rn-uikit';
|
|
22
22
|
import {
|
|
23
23
|
LocalAudioMute,
|
|
24
24
|
LocalVideoMute,
|
|
25
25
|
SwitchCamera,
|
|
26
26
|
Endcall,
|
|
27
|
-
} from '../../agora-rn-uikit
|
|
27
|
+
} from '../../agora-rn-uikit';
|
|
28
28
|
import Recording from '../subComponents/Recording';
|
|
29
29
|
import icons from '../assets/icons';
|
|
30
30
|
import ColorContext from './ColorContext';
|
|
@@ -17,12 +17,12 @@ import {
|
|
|
17
17
|
StyleSheet,
|
|
18
18
|
Text,
|
|
19
19
|
} from 'react-native';
|
|
20
|
-
import LocalUserContext from '../../agora-rn-uikit
|
|
20
|
+
import {LocalUserContext} from '../../agora-rn-uikit';
|
|
21
21
|
import {
|
|
22
22
|
LocalAudioMute,
|
|
23
23
|
LocalVideoMute,
|
|
24
24
|
Endcall,
|
|
25
|
-
} from '../../agora-rn-uikit
|
|
25
|
+
} from '../../agora-rn-uikit';
|
|
26
26
|
import Recording from '../subComponents/Recording';
|
|
27
27
|
import SwitchCamera from '../subComponents/SwitchCamera';
|
|
28
28
|
// import icons from '../assets/icons';
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
*********************************************
|
|
11
11
|
*/
|
|
12
12
|
import React, {useState, useContext, useEffect} from 'react';
|
|
13
|
-
import RtcContext from '../../agora-rn-uikit
|
|
13
|
+
import {RtcContext} from '../../agora-rn-uikit';
|
|
14
14
|
import DeviceContext from './DeviceContext';
|
|
15
15
|
|
|
16
16
|
const DeviceConfigure: React.FC = (props: any) => {
|
|
@@ -18,17 +18,23 @@ import {
|
|
|
18
18
|
Dimensions,
|
|
19
19
|
Image,
|
|
20
20
|
Pressable,
|
|
21
|
+
useWindowDimensions,
|
|
21
22
|
} from 'react-native';
|
|
22
|
-
import MinUidContext from '../../agora-rn-uikit
|
|
23
|
-
import MaxUidContext from '../../agora-rn-uikit
|
|
24
|
-
import {MaxVideoView} from '../../agora-rn-uikit
|
|
23
|
+
import {MinUidContext} from '../../agora-rn-uikit';
|
|
24
|
+
import {MaxUidContext} from '../../agora-rn-uikit';
|
|
25
|
+
import {MaxVideoView} from '../../agora-rn-uikit';
|
|
26
|
+
import {RtcContext} from '../../agora-rn-uikit';
|
|
25
27
|
import chatContext from './ChatContext';
|
|
26
28
|
import icons from '../assets/icons';
|
|
27
|
-
import styles from './styles';
|
|
28
29
|
import ColorContext from './ColorContext';
|
|
29
30
|
import FallbackLogo from '../subComponents/FallbackLogo';
|
|
30
31
|
import Layout from '../subComponents/LayoutEnum';
|
|
31
|
-
import
|
|
32
|
+
import ScreenShareNotice from '../subComponents/ScreenShareNotice';
|
|
33
|
+
import {RFValue} from 'react-native-responsive-fontsize';
|
|
34
|
+
import networkQualityContext from './NetworkQualityContext';
|
|
35
|
+
import {NetworkQualityPill} from '../subComponents/NetworkQualityPill';
|
|
36
|
+
import {ImageIcon} from '../../agora-rn-uikit';
|
|
37
|
+
import TextWithTooltip from '../subComponents/TextWithTooltip';
|
|
32
38
|
|
|
33
39
|
const layout = (len: number, isDesktop: boolean = true) => {
|
|
34
40
|
const rows = Math.round(Math.sqrt(len));
|
|
@@ -55,10 +61,12 @@ interface GridVideoProps {
|
|
|
55
61
|
}
|
|
56
62
|
|
|
57
63
|
const GridVideo = (props: GridVideoProps) => {
|
|
64
|
+
const {height, width} = useWindowDimensions();
|
|
58
65
|
const {dispatch} = useContext(RtcContext);
|
|
59
66
|
const max = useContext(MaxUidContext);
|
|
60
67
|
const min = useContext(MinUidContext);
|
|
61
68
|
const {primaryColor} = useContext(ColorContext);
|
|
69
|
+
const networkQualityStat = useContext(networkQualityContext);
|
|
62
70
|
const {userList, localUid} = useContext(chatContext);
|
|
63
71
|
const users = [...max, ...min];
|
|
64
72
|
let onLayout = (e: any) => {
|
|
@@ -70,6 +78,7 @@ const GridVideo = (props: GridVideoProps) => {
|
|
|
70
78
|
Dimensions.get('window').width > Dimensions.get('window').height,
|
|
71
79
|
]);
|
|
72
80
|
const isDesktop = dim[0] > dim[1] + 100;
|
|
81
|
+
|
|
73
82
|
let {matrix, dims} = useMemo(
|
|
74
83
|
() => layout(users.length, isDesktop),
|
|
75
84
|
[users.length, isDesktop],
|
|
@@ -97,11 +106,28 @@ const GridVideo = (props: GridVideoProps) => {
|
|
|
97
106
|
}}
|
|
98
107
|
key={cidx}>
|
|
99
108
|
<View style={style.gridVideoContainerInner}>
|
|
109
|
+
<NetworkQualityPill
|
|
110
|
+
networkStat={
|
|
111
|
+
// When no network quality reported and if user has no stream
|
|
112
|
+
// published show "unsupported" else show "loading"
|
|
113
|
+
networkQualityStat[users[ridx * dims.c + cidx].uid]
|
|
114
|
+
? networkQualityStat[users[ridx * dims.c + cidx].uid]
|
|
115
|
+
: users[ridx * dims.c + cidx].audio ||
|
|
116
|
+
users[ridx * dims.c + cidx].video
|
|
117
|
+
? 8
|
|
118
|
+
: 7
|
|
119
|
+
}
|
|
120
|
+
primaryColor={primaryColor}
|
|
121
|
+
rootStyle={{top: 5, left: 5}}
|
|
122
|
+
/>
|
|
123
|
+
<ScreenShareNotice uid={users[ridx * dims.c + cidx].uid} />
|
|
100
124
|
<MaxVideoView
|
|
101
125
|
fallback={() => {
|
|
102
126
|
if (users[ridx * dims.c + cidx].uid === 'local') {
|
|
103
127
|
return FallbackLogo(userList[localUid]?.name);
|
|
104
|
-
} else if (
|
|
128
|
+
} else if (
|
|
129
|
+
String(users[ridx * dims.c + cidx].uid)[0] === '1'
|
|
130
|
+
) {
|
|
105
131
|
return FallbackLogo('PSTN User');
|
|
106
132
|
} else {
|
|
107
133
|
return FallbackLogo(
|
|
@@ -114,6 +140,7 @@ const GridVideo = (props: GridVideoProps) => {
|
|
|
114
140
|
/>
|
|
115
141
|
<View
|
|
116
142
|
style={{
|
|
143
|
+
zIndex: 5,
|
|
117
144
|
marginTop: -30,
|
|
118
145
|
backgroundColor: $config.SECONDARY_FONT_COLOR + 'bb',
|
|
119
146
|
alignSelf: 'flex-end',
|
|
@@ -130,7 +157,16 @@ const GridVideo = (props: GridVideoProps) => {
|
|
|
130
157
|
}}>
|
|
131
158
|
{/* <View style={{alignSelf: 'flex-end', flexDirection: 'row'}}> */}
|
|
132
159
|
<View style={[style.MicBackdrop]}>
|
|
133
|
-
<
|
|
160
|
+
<ImageIcon
|
|
161
|
+
name={
|
|
162
|
+
users[ridx * dims.c + cidx].audio ? 'mic' : 'micOff'
|
|
163
|
+
}
|
|
164
|
+
color={
|
|
165
|
+
users[ridx * dims.c + cidx].audio ? primaryColor : 'red'
|
|
166
|
+
}
|
|
167
|
+
style={style.MicIcon}
|
|
168
|
+
/>
|
|
169
|
+
{/* <Image
|
|
134
170
|
source={{
|
|
135
171
|
uri: users[ridx * dims.c + cidx].audio
|
|
136
172
|
? icons.mic
|
|
@@ -145,33 +181,35 @@ const GridVideo = (props: GridVideoProps) => {
|
|
|
145
181
|
},
|
|
146
182
|
]}
|
|
147
183
|
resizeMode={'contain'}
|
|
148
|
-
/>
|
|
184
|
+
/> */}
|
|
149
185
|
</View>
|
|
150
|
-
<
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
color: $config.PRIMARY_FONT_COLOR,
|
|
154
|
-
lineHeight: 30,
|
|
155
|
-
fontSize: 18,
|
|
156
|
-
fontWeight: '600',
|
|
157
|
-
// width: '100%',
|
|
158
|
-
// alignSelf: 'stretch',
|
|
159
|
-
// textAlign: 'center',
|
|
160
|
-
}}>
|
|
161
|
-
{users[ridx * dims.c + cidx].uid === 'local'
|
|
186
|
+
<View style={{flex:1}}>
|
|
187
|
+
<TextWithTooltip
|
|
188
|
+
value={users[ridx * dims.c + cidx].uid === 'local'
|
|
162
189
|
? userList[localUid]
|
|
163
|
-
? userList[localUid].name
|
|
190
|
+
? userList[localUid].name + ' '
|
|
164
191
|
: 'You '
|
|
165
192
|
: userList[users[ridx * dims.c + cidx].uid]
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
193
|
+
? userList[users[ridx * dims.c + cidx].uid].name + ' '
|
|
194
|
+
: users[ridx * dims.c + cidx].uid === 1
|
|
195
|
+
? (userList[localUid]?.name + "'s screen ")
|
|
196
|
+
: String(users[ridx * dims.c + cidx].uid)[0] === '1'
|
|
197
|
+
? 'PSTN User '
|
|
198
|
+
: 'User '}
|
|
199
|
+
style={
|
|
200
|
+
{
|
|
201
|
+
color: $config.PRIMARY_FONT_COLOR,
|
|
202
|
+
lineHeight: 30,
|
|
203
|
+
fontSize: RFValue(14, height > width ? height : width),
|
|
204
|
+
fontWeight: '700',
|
|
205
|
+
flexShrink: 1,
|
|
206
|
+
// width: '100%',
|
|
207
|
+
// alignSelf: 'stretch',
|
|
208
|
+
// textAlign: 'center',
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
/>
|
|
212
|
+
</View>
|
|
175
213
|
{/* </View> */}
|
|
176
214
|
{/* {console.log(
|
|
177
215
|
'!nax',
|
|
@@ -209,7 +247,7 @@ const style = StyleSheet.create({
|
|
|
209
247
|
flex: 1,
|
|
210
248
|
overflow: 'hidden',
|
|
211
249
|
// margin: 1,
|
|
212
|
-
|
|
250
|
+
marginHorizontal: 10,
|
|
213
251
|
},
|
|
214
252
|
MicBackdrop: {
|
|
215
253
|
width: 20,
|
|
@@ -19,8 +19,8 @@ import {
|
|
|
19
19
|
StyleSheet,
|
|
20
20
|
Dimensions,
|
|
21
21
|
} from 'react-native';
|
|
22
|
-
// import {MinUidConsumer} from '../../agora-rn-uikit
|
|
23
|
-
// import PropsContext from '../../agora-rn-uikit
|
|
22
|
+
// import {MinUidConsumer} from '../../agora-rn-uikit';
|
|
23
|
+
// import {PropsContext} from '../../agora-rn-uikit';
|
|
24
24
|
import icons from '../assets/icons';
|
|
25
25
|
import Settings from './Settings';
|
|
26
26
|
import ColorContext from './ColorContext';
|
|
@@ -30,9 +30,8 @@ import {navHolder} from '../../theme.json';
|
|
|
30
30
|
import Layout from '../subComponents/LayoutEnum';
|
|
31
31
|
import ChatContext from '../components/ChatContext';
|
|
32
32
|
import mobileAndTabletCheck from '../utils/mobileWebTest';
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
icons;
|
|
33
|
+
import {BtnTemplate} from '../../agora-rn-uikit';
|
|
34
|
+
import {ImageIcon} from '../../agora-rn-uikit';
|
|
36
35
|
|
|
37
36
|
const Navbar = (props: any) => {
|
|
38
37
|
const {primaryColor} = useContext(ColorContext);
|
|
@@ -64,34 +63,68 @@ const Navbar = (props: any) => {
|
|
|
64
63
|
return (
|
|
65
64
|
<View
|
|
66
65
|
onLayout={onLayout}
|
|
67
|
-
style={[
|
|
66
|
+
style={[
|
|
67
|
+
Platform.OS === 'web' ? style.navHolder : style.navHolderNative,
|
|
68
|
+
{backgroundColor: $config.SECONDARY_FONT_COLOR + 80},
|
|
69
|
+
Platform.OS === 'web'
|
|
70
|
+
? {
|
|
71
|
+
justifyContent: mobileAndTabletCheck()
|
|
72
|
+
? 'space-between'
|
|
73
|
+
: 'flex-end',
|
|
74
|
+
}
|
|
75
|
+
: {},
|
|
76
|
+
]}>
|
|
68
77
|
{recordingActive && !mobileAndTabletCheck() ? (
|
|
69
|
-
<View
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
78
|
+
<View
|
|
79
|
+
style={[
|
|
80
|
+
style.recordingView,
|
|
81
|
+
{backgroundColor: $config.SECONDARY_FONT_COLOR},
|
|
82
|
+
]}>
|
|
83
|
+
<ImageIcon
|
|
84
|
+
name={'recordingActiveIcon'}
|
|
85
|
+
style={{
|
|
86
|
+
width: 20,
|
|
87
|
+
height: 20,
|
|
88
|
+
margin: 1,
|
|
89
|
+
}}
|
|
90
|
+
color='#FD0845'
|
|
91
|
+
/>
|
|
75
92
|
<Text
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
93
|
+
style={{
|
|
94
|
+
fontSize: Platform.OS === 'web' ? 16 : 12,
|
|
95
|
+
color: '#FD0845',
|
|
96
|
+
fontWeight: '400',
|
|
97
|
+
alignSelf: 'center',
|
|
98
|
+
textAlign: 'center',
|
|
99
|
+
flex: 1,
|
|
100
|
+
}}>
|
|
101
|
+
Recording
|
|
102
|
+
</Text>
|
|
86
103
|
</View>
|
|
87
104
|
) : (
|
|
88
105
|
<></>
|
|
89
106
|
)}
|
|
90
|
-
<View
|
|
107
|
+
<View
|
|
108
|
+
style={[
|
|
109
|
+
style.roomNameContainer,
|
|
110
|
+
Platform.OS === 'web' && !mobileAndTabletCheck()
|
|
111
|
+
? {transform: [{translateX: '50%'}]}
|
|
112
|
+
: {},
|
|
113
|
+
]}>
|
|
91
114
|
{Platform.OS === 'web' ? (
|
|
92
115
|
<View
|
|
93
|
-
style={{
|
|
94
|
-
|
|
116
|
+
style={{
|
|
117
|
+
flexDirection: 'row',
|
|
118
|
+
justifyContent: 'flex-start',
|
|
119
|
+
paddingLeft: 5,
|
|
120
|
+
}}>
|
|
121
|
+
<Text style={style.roomNameText}>
|
|
122
|
+
{mobileAndTabletCheck()
|
|
123
|
+
? title.length > 13
|
|
124
|
+
? title.slice(0, 13) + '..'
|
|
125
|
+
: title
|
|
126
|
+
: title}
|
|
127
|
+
</Text>
|
|
95
128
|
<View
|
|
96
129
|
style={{
|
|
97
130
|
backgroundColor: $config.PRIMARY_FONT_COLOR + '80',
|
|
@@ -100,12 +133,13 @@ const Navbar = (props: any) => {
|
|
|
100
133
|
marginHorizontal: 10,
|
|
101
134
|
}}
|
|
102
135
|
/>
|
|
103
|
-
<
|
|
136
|
+
<View style={{width: 30}}>
|
|
137
|
+
<CopyJoinInfo />
|
|
138
|
+
</View>
|
|
104
139
|
</View>
|
|
105
140
|
) : (
|
|
106
141
|
<Text style={style.roomNameText}>{title}</Text>
|
|
107
|
-
)}
|
|
108
|
-
|
|
142
|
+
)}
|
|
109
143
|
</View>
|
|
110
144
|
<View
|
|
111
145
|
style={{
|
|
@@ -125,37 +159,37 @@ const Navbar = (props: any) => {
|
|
|
125
159
|
Platform.OS === 'web'
|
|
126
160
|
? $config.SECONDARY_FONT_COLOR
|
|
127
161
|
: $config.SECONDARY_FONT_COLOR + '00',
|
|
128
|
-
|
|
162
|
+
paddingVertical: 4,
|
|
163
|
+
paddingHorizontal: mobileAndTabletCheck() ? 0 : 4,
|
|
129
164
|
minHeight: 35,
|
|
130
165
|
// height: 40,
|
|
131
166
|
// backgroundColor: '#f0f',
|
|
132
167
|
// paddingHorizontal: 16,
|
|
133
168
|
borderRadius: 10,
|
|
134
|
-
minWidth:
|
|
169
|
+
minWidth:
|
|
170
|
+
Platform.OS === 'web' && isDesktop
|
|
171
|
+
? 300
|
|
172
|
+
: mobileAndTabletCheck()
|
|
173
|
+
? 160
|
|
174
|
+
: 200,
|
|
135
175
|
// borderTopLeftRadius: 10,
|
|
136
176
|
// borderBottomLeftRadius: 10,
|
|
137
177
|
justifyContent: 'space-evenly',
|
|
138
178
|
}}>
|
|
139
179
|
<View style={{width: '20%', height: '100%'}}>
|
|
140
|
-
<
|
|
180
|
+
<BtnTemplate
|
|
141
181
|
onPress={() => {
|
|
142
182
|
sidePanel === SidePanelType.Participants
|
|
143
183
|
? setSidePanel(SidePanelType.None)
|
|
144
184
|
: setSidePanel(SidePanelType.Participants);
|
|
145
185
|
}}
|
|
146
|
-
style={style.btnHolder}
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
<Text style={[style.participantText, {color: primaryColor}]}>
|
|
154
|
-
{minUsers.length + 1}
|
|
155
|
-
</Text>
|
|
156
|
-
)}
|
|
157
|
-
</MinUidConsumer> */}
|
|
158
|
-
</TouchableOpacity>
|
|
186
|
+
style={style.btnHolder}
|
|
187
|
+
name={
|
|
188
|
+
sidePanel === SidePanelType.Participants
|
|
189
|
+
? 'participantFilledIcon'
|
|
190
|
+
: 'participantIcon'
|
|
191
|
+
}
|
|
192
|
+
/>
|
|
159
193
|
</View>
|
|
160
194
|
{$config.CHAT ? (
|
|
161
195
|
<>
|
|
@@ -173,44 +207,34 @@ const Navbar = (props: any) => {
|
|
|
173
207
|
) : (
|
|
174
208
|
<></>
|
|
175
209
|
)}
|
|
176
|
-
<View style={{width: '
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
? setSidePanel(SidePanelType.None)
|
|
185
|
-
: setSidePanel(SidePanelType.Chat);
|
|
186
|
-
}}>
|
|
187
|
-
{sidePanel !== SidePanelType.Chat &&
|
|
188
|
-
pendingMessageLength !== 0 ? (
|
|
189
|
-
<View style={style.chatNotification}>
|
|
190
|
-
<Text style={{color: $config.SECONDARY_FONT_COLOR}}>
|
|
191
|
-
{pendingMessageLength}
|
|
192
|
-
</Text>
|
|
193
|
-
</View>
|
|
194
|
-
) : (
|
|
195
|
-
<></>
|
|
196
|
-
)}
|
|
197
|
-
<Image
|
|
198
|
-
source={{
|
|
199
|
-
uri: sidePanel !== SidePanelType.Chat &&
|
|
200
|
-
pendingMessageLength !== 0 ? icons.chatIconFilled : icons.chatIcon
|
|
210
|
+
<View style={{width: '20%', height: '100%', position: 'relative'}}>
|
|
211
|
+
<BtnTemplate
|
|
212
|
+
style={style.btnHolder}
|
|
213
|
+
onPress={() => {
|
|
214
|
+
setLastCheckedPublicState(messageStore.length);
|
|
215
|
+
sidePanel === SidePanelType.Chat
|
|
216
|
+
? setSidePanel(SidePanelType.None)
|
|
217
|
+
: setSidePanel(SidePanelType.Chat);
|
|
201
218
|
}}
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
tintColor: $config.PRIMARY_COLOR,
|
|
208
|
-
},
|
|
209
|
-
]}
|
|
219
|
+
name={
|
|
220
|
+
sidePanel === SidePanelType.Chat
|
|
221
|
+
? 'chatIconFilled'
|
|
222
|
+
: 'chatIcon'
|
|
223
|
+
}
|
|
210
224
|
/>
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
225
|
+
<View style={{position: 'absolute', top: Platform.OS === 'web' ? 1 : -15, left: ( Platform.OS === 'web' && isDesktop) ? 10 : 1 }}>
|
|
226
|
+
{sidePanel !== SidePanelType.Chat &&
|
|
227
|
+
pendingMessageLength !== 0 ? (
|
|
228
|
+
<View style={style.chatNotification}>
|
|
229
|
+
<Text style={{color: $config.SECONDARY_FONT_COLOR}}>
|
|
230
|
+
{pendingMessageLength}
|
|
231
|
+
</Text>
|
|
232
|
+
</View>
|
|
233
|
+
) : (
|
|
234
|
+
<></>
|
|
235
|
+
)}
|
|
236
|
+
</View>
|
|
237
|
+
</View>
|
|
214
238
|
</>
|
|
215
239
|
) : (
|
|
216
240
|
<></>
|
|
@@ -229,40 +253,34 @@ const Navbar = (props: any) => {
|
|
|
229
253
|
) : (
|
|
230
254
|
<></>
|
|
231
255
|
)}
|
|
232
|
-
<View style={{width: '
|
|
233
|
-
|
|
234
|
-
<TouchableOpacity
|
|
256
|
+
<View style={{width: '20%', height: '100%'}}>
|
|
257
|
+
<BtnTemplate
|
|
235
258
|
style={style.btnHolder}
|
|
236
259
|
onPress={() => {
|
|
237
260
|
setLayout((l: Layout) =>
|
|
238
261
|
l === Layout.Pinned ? Layout.Grid : Layout.Pinned,
|
|
239
262
|
);
|
|
240
|
-
}}
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
263
|
+
}}
|
|
264
|
+
name={layout ? 'pinnedLayoutIcon' : 'gridLayoutIcon'}
|
|
265
|
+
/>
|
|
266
|
+
</View>
|
|
267
|
+
{/** Show setting icon only in non native apps
|
|
268
|
+
* show in web/electron/mobile web
|
|
269
|
+
* hide in android/ios */}
|
|
270
|
+
{Platform.OS !== 'android' && Platform.OS !== 'ios' ? (
|
|
271
|
+
<>
|
|
272
|
+
{Platform.OS === 'web' && isDesktop && (
|
|
273
|
+
<View
|
|
245
274
|
style={{
|
|
246
|
-
|
|
275
|
+
backgroundColor: $config.PRIMARY_FONT_COLOR + '80',
|
|
276
|
+
width: 1,
|
|
247
277
|
height: '100%',
|
|
248
|
-
|
|
278
|
+
marginHorizontal: 10,
|
|
279
|
+
alignSelf: 'center',
|
|
280
|
+
opacity: 0.8,
|
|
249
281
|
}}
|
|
250
282
|
/>
|
|
251
|
-
|
|
252
|
-
</View>
|
|
253
|
-
</View>
|
|
254
|
-
{Platform.OS === 'web' && isDesktop ? (
|
|
255
|
-
<>
|
|
256
|
-
<View
|
|
257
|
-
style={{
|
|
258
|
-
backgroundColor: $config.PRIMARY_FONT_COLOR + '80',
|
|
259
|
-
width: 1,
|
|
260
|
-
height: '100%',
|
|
261
|
-
marginHorizontal: 10,
|
|
262
|
-
alignSelf: 'center',
|
|
263
|
-
opacity: 0.8,
|
|
264
|
-
}}
|
|
265
|
-
/>
|
|
283
|
+
)}
|
|
266
284
|
<View style={{width: '20%', height: '100%'}}>
|
|
267
285
|
<Settings
|
|
268
286
|
sidePanel={sidePanel}
|
|
@@ -316,7 +334,12 @@ const style = StyleSheet.create({
|
|
|
316
334
|
margin: 1,
|
|
317
335
|
resizeMode: 'contain',
|
|
318
336
|
},
|
|
319
|
-
btnHolder: {
|
|
337
|
+
btnHolder: {
|
|
338
|
+
marginHorizontal: mobileAndTabletCheck() ? 2 : 0,
|
|
339
|
+
width: '100%',
|
|
340
|
+
height: '100%',
|
|
341
|
+
resizeMode: 'contain',
|
|
342
|
+
},
|
|
320
343
|
// participantBtnHolder: {
|
|
321
344
|
// backgroundColor: '#fff',
|
|
322
345
|
// // flex: 0.5,
|
|
@@ -340,13 +363,13 @@ const style = StyleSheet.create({
|
|
|
340
363
|
// alignSelf: 'center',
|
|
341
364
|
// flex: 1,
|
|
342
365
|
// },
|
|
343
|
-
participantBtnIcon: {
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
},
|
|
366
|
+
// participantBtnIcon: {
|
|
367
|
+
// height: '100%',
|
|
368
|
+
// width: '100%',
|
|
369
|
+
// // margin: 1,
|
|
370
|
+
// tintColor: $config.PRIMARY_COLOR,
|
|
371
|
+
// resizeMode: 'contain',
|
|
372
|
+
// },
|
|
350
373
|
// participantText: {
|
|
351
374
|
// fontSize: Platform.OS === 'web' ? 20 : 18,
|
|
352
375
|
// fontWeight: '400',
|