agora-appbuilder-core 1.0.8 → 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (134) hide show
  1. package/package.json +5 -2
  2. package/template/_package-lock.json +22850 -0
  3. package/template/agora-rn-uikit/.git/HEAD +1 -0
  4. package/template/agora-rn-uikit/.git/config +16 -0
  5. package/template/agora-rn-uikit/.git/description +1 -0
  6. package/template/agora-rn-uikit/.git/hooks/applypatch-msg.sample +15 -0
  7. package/template/agora-rn-uikit/.git/hooks/commit-msg.sample +24 -0
  8. package/template/agora-rn-uikit/.git/hooks/fsmonitor-watchman.sample +173 -0
  9. package/template/agora-rn-uikit/.git/hooks/post-update.sample +8 -0
  10. package/template/agora-rn-uikit/.git/hooks/pre-applypatch.sample +14 -0
  11. package/template/agora-rn-uikit/.git/hooks/pre-commit.sample +49 -0
  12. package/template/agora-rn-uikit/.git/hooks/pre-merge-commit.sample +13 -0
  13. package/template/agora-rn-uikit/.git/hooks/pre-push.sample +53 -0
  14. package/template/agora-rn-uikit/.git/hooks/pre-rebase.sample +169 -0
  15. package/template/agora-rn-uikit/.git/hooks/pre-receive.sample +24 -0
  16. package/template/agora-rn-uikit/.git/hooks/prepare-commit-msg.sample +42 -0
  17. package/template/agora-rn-uikit/.git/hooks/push-to-checkout.sample +78 -0
  18. package/template/agora-rn-uikit/.git/hooks/update.sample +128 -0
  19. package/template/agora-rn-uikit/.git/index +0 -0
  20. package/template/agora-rn-uikit/.git/info/exclude +6 -0
  21. package/template/agora-rn-uikit/.git/logs/HEAD +2 -0
  22. package/template/agora-rn-uikit/.git/logs/refs/heads/ab-dev-auto +1 -0
  23. package/template/agora-rn-uikit/.git/logs/refs/heads/master +1 -0
  24. package/template/agora-rn-uikit/.git/logs/refs/remotes/origin/HEAD +1 -0
  25. package/template/agora-rn-uikit/.git/objects/pack/pack-f379286d0537eb68377220b4929979324b8d5d1c.idx +0 -0
  26. package/template/agora-rn-uikit/.git/objects/pack/pack-f379286d0537eb68377220b4929979324b8d5d1c.pack +0 -0
  27. package/template/agora-rn-uikit/.git/packed-refs +12 -0
  28. package/template/agora-rn-uikit/.git/refs/heads/ab-dev-auto +1 -0
  29. package/template/agora-rn-uikit/.git/refs/heads/master +1 -0
  30. package/template/agora-rn-uikit/.git/refs/remotes/origin/HEAD +1 -0
  31. package/template/agora-rn-uikit/.gitignore +63 -0
  32. package/template/agora-rn-uikit/package-lock.json +7612 -0
  33. package/template/agora-rn-uikit/package.json +1 -0
  34. package/template/agora-rn-uikit/src/AgoraUIKit.tsx +8 -8
  35. package/template/agora-rn-uikit/src/{LocalUserContext.tsx → Contexts/LocalUserContext.tsx} +1 -1
  36. package/template/agora-rn-uikit/src/{MaxUidContext.tsx → Contexts/MaxUidContext.tsx} +0 -0
  37. package/template/agora-rn-uikit/src/{MinUidContext.tsx → Contexts/MinUidContext.tsx} +0 -0
  38. package/template/agora-rn-uikit/src/{PropsContext.tsx → Contexts/PropsContext.tsx} +34 -16
  39. package/template/agora-rn-uikit/src/{RtcContext.tsx → Contexts/RtcContext.tsx} +12 -21
  40. package/template/agora-rn-uikit/src/Controls/BtnTemplate.tsx +25 -15
  41. package/template/agora-rn-uikit/src/Controls/Icons.ts +53 -3
  42. package/template/agora-rn-uikit/src/Controls/ImageIcon.tsx +53 -0
  43. package/template/agora-rn-uikit/src/Controls/Local/EndCall.tsx +4 -3
  44. package/template/agora-rn-uikit/src/Controls/Local/FullScreen.tsx +3 -3
  45. package/template/agora-rn-uikit/src/Controls/Local/LocalAudioMute.tsx +58 -14
  46. package/template/agora-rn-uikit/src/Controls/Local/LocalVideoMute.tsx +60 -14
  47. package/template/agora-rn-uikit/src/Controls/Local/Recording.tsx +2 -2
  48. package/template/agora-rn-uikit/src/Controls/Local/Screenshare.tsx +2 -2
  49. package/template/agora-rn-uikit/src/Controls/Local/SwitchCamera.tsx +9 -9
  50. package/template/agora-rn-uikit/src/Controls/LocalControls.tsx +20 -17
  51. package/template/agora-rn-uikit/src/Controls/Remote/RemoteAudioMute.tsx +8 -8
  52. package/template/agora-rn-uikit/src/Controls/Remote/RemoteSwap.tsx +3 -3
  53. package/template/agora-rn-uikit/src/Controls/Remote/RemoteVideoMute.tsx +13 -8
  54. package/template/agora-rn-uikit/src/Controls/RemoteControls.tsx +1 -2
  55. package/template/agora-rn-uikit/src/Reducer/LocalMuteAudio.ts +20 -0
  56. package/template/agora-rn-uikit/src/Reducer/LocalMuteVideo.ts +20 -0
  57. package/template/agora-rn-uikit/src/Reducer/RemoteAudioStateChanged.ts +26 -0
  58. package/template/agora-rn-uikit/src/Reducer/RemoteVideoStateChanged.ts +26 -0
  59. package/template/agora-rn-uikit/src/Reducer/UpdateDualStreamMode.ts +46 -0
  60. package/template/agora-rn-uikit/src/Reducer/UserJoined.ts +47 -0
  61. package/template/agora-rn-uikit/src/Reducer/UserMuteRemoteAudio.ts +20 -0
  62. package/template/agora-rn-uikit/src/Reducer/UserMuteRemoteVideo.ts +20 -0
  63. package/template/agora-rn-uikit/src/Reducer/UserOffline.ts +21 -0
  64. package/template/agora-rn-uikit/src/Reducer/index.ts +9 -0
  65. package/template/agora-rn-uikit/src/Rtc/Create.tsx +138 -0
  66. package/template/agora-rn-uikit/src/Rtc/Join.tsx +100 -0
  67. package/template/agora-rn-uikit/src/RtcConfigure.tsx +197 -0
  68. package/template/agora-rn-uikit/src/Style.ts +3 -3
  69. package/template/agora-rn-uikit/src/Utils/actionTypeGuard.tsx +9 -0
  70. package/template/agora-rn-uikit/src/{events.ts → Utils/events.ts} +0 -0
  71. package/template/agora-rn-uikit/src/{permission.ts → Utils/permission.ts} +0 -0
  72. package/template/agora-rn-uikit/src/{quality.tsx → Utils/quality.tsx} +0 -0
  73. package/template/agora-rn-uikit/src/{MaxVideoView.native.tsx → Views/MaxVideoView.native.tsx} +3 -4
  74. package/template/agora-rn-uikit/src/{MaxVideoView.tsx → Views/MaxVideoView.tsx} +3 -4
  75. package/template/agora-rn-uikit/src/Views/MinVideoView.tsx +86 -0
  76. package/template/agora-rn-uikit/src/index.ts +67 -0
  77. package/template/bridge/rtc/webNg/RtcEngine.ts +23 -6
  78. package/template/package-lock.json +22850 -0
  79. package/template/package.json +6 -4
  80. package/template/react-native-toast-message/.gitignore +5 -0
  81. package/template/react-native-toast-message/.npmignore +5 -0
  82. package/template/react-native-toast-message/package-lock.json +10553 -0
  83. package/template/src/.DS_Store +0 -0
  84. package/template/src/assets/icons.ts +35 -6
  85. package/template/src/atoms/SecondaryButton.tsx +6 -5
  86. package/template/src/atoms/TextInput.tsx +6 -1
  87. package/template/src/components/Chat.tsx +50 -21
  88. package/template/src/components/ChatContext.ts +22 -1
  89. package/template/src/components/Controls.native.tsx +2 -2
  90. package/template/src/components/Controls.tsx +2 -2
  91. package/template/src/components/DeviceConfigure.tsx +1 -1
  92. package/template/src/components/GridVideo.tsx +69 -31
  93. package/template/src/components/Navbar.tsx +136 -113
  94. package/template/src/components/NetworkQualityContext.tsx +134 -0
  95. package/template/src/components/ParticipantsView.tsx +105 -49
  96. package/template/src/components/PinnedVideo.tsx +112 -71
  97. package/template/src/components/Precall.native.tsx +42 -23
  98. package/template/src/components/Precall.tsx +56 -51
  99. package/template/src/components/RTMConfigure.tsx +331 -181
  100. package/template/src/components/RTMEvents.tsx +84 -0
  101. package/template/src/components/Settings.tsx +19 -16
  102. package/template/src/components/Share.tsx +131 -62
  103. package/template/src/components/StorageContext.tsx +2 -0
  104. package/template/src/hooks/useImageDelay.tsx +28 -0
  105. package/template/src/pages/Authenticate.tsx +5 -4
  106. package/template/src/pages/Create.tsx +26 -16
  107. package/template/src/pages/Join.tsx +13 -30
  108. package/template/src/pages/VideoCall.tsx +181 -137
  109. package/template/src/subComponents/.DS_Store +0 -0
  110. package/template/src/subComponents/ChatContainer.tsx +40 -28
  111. package/template/src/subComponents/CopyJoinInfo.tsx +9 -12
  112. package/template/src/subComponents/LocalAudioMute.tsx +9 -9
  113. package/template/src/subComponents/LocalVideoMute.tsx +9 -9
  114. package/template/src/subComponents/LogoutButton.tsx +1 -1
  115. package/template/src/subComponents/NetworkQualityPill.tsx +161 -0
  116. package/template/src/subComponents/Recording.tsx +12 -16
  117. package/template/src/subComponents/RemoteAudioMute.tsx +23 -27
  118. package/template/src/subComponents/RemoteEndCall.tsx +7 -15
  119. package/template/src/subComponents/RemoteVideoMute.tsx +15 -28
  120. package/template/src/subComponents/ScreenShareNotice.tsx +61 -0
  121. package/template/src/subComponents/ScreenshareButton.tsx +76 -75
  122. package/template/src/subComponents/SelectOAuth.tsx +25 -12
  123. package/template/src/subComponents/SwitchCamera.tsx +5 -2
  124. package/template/src/subComponents/TextWithTooltip.native.tsx +128 -0
  125. package/template/src/subComponents/TextWithTooltip.tsx +44 -0
  126. package/template/src/subComponents/toastConfig.tsx +2 -2
  127. package/template/src/utils/hasBrandLogo.tsx +3 -0
  128. package/template/src/utils/isSafariBrowser.tsx +22 -0
  129. package/template/webpack.commons.js +1 -0
  130. package/template/agora-rn-uikit/Components.js +0 -35
  131. package/template/agora-rn-uikit/Contexts.js +0 -7
  132. package/template/agora-rn-uikit/index.js +0 -12
  133. package/template/agora-rn-uikit/src/MinVideoView.tsx +0 -87
  134. package/template/agora-rn-uikit/src/RTCConfigure.tsx +0 -516
@@ -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((null as unknown) as chatContext);
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/src/LocalUserContext';
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/Components';
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/src/LocalUserContext';
20
+ import {LocalUserContext} from '../../agora-rn-uikit';
21
21
  import {
22
22
  LocalAudioMute,
23
23
  LocalVideoMute,
24
24
  Endcall,
25
- } from '../../agora-rn-uikit/Components';
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/src/RtcContext';
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/src/MinUidContext';
23
- import MaxUidContext from '../../agora-rn-uikit/src/MaxUidContext';
24
- import {MaxVideoView} from '../../agora-rn-uikit/Components';
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 RtcContext, {DispatchType} from '../../agora-rn-uikit/src/RtcContext';
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 (String(users[ridx * dims.c + cidx].uid)[0] === '1') {
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
- <Image
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
- <Text
151
- textBreakStrategy={'simple'}
152
- style={{
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.slice(0, 20) + ' '
190
+ ? userList[localUid].name + ' '
164
191
  : 'You '
165
192
  : userList[users[ridx * dims.c + cidx].uid]
166
- ? userList[users[ridx * dims.c + cidx].uid].name.slice(
167
- 0,
168
- 20,
169
- ) + ' '
170
- : users[ridx * dims.c + cidx].uid === 1
171
- ? (userList[localUid]?.name + "'s screen ").slice(0, 20)
172
- : String(users[ridx * dims.c + cidx].uid)[0] === '1' ?
173
- 'PSTN User ' : 'User '}
174
- </Text>
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
- paddingHorizontal: 10,
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/src/MinUidContext';
23
- // import PropsContext from '../../agora-rn-uikit/src/PropsContext';
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
- const {participantIcon, gridLayoutIcon, pinnedLayoutIcon, recordingIcon} =
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={[Platform.OS === 'web' ? style.navHolder : style.navHolderNative, {backgroundColor: $config.SECONDARY_FONT_COLOR + 80}, Platform.OS === 'web' ? {justifyContent: mobileAndTabletCheck() ? 'space-between' : 'flex-end'} : {}]}>
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 style={[style.recordingView, {backgroundColor: $config.SECONDARY_FONT_COLOR}]}>
70
- <Image source={{uri: icons.recordingActiveIcon}} style={{
71
- width: 20,
72
- height: 20,
73
- margin: 1,
74
- resizeMode: 'contain', tintColor: '#FD0845'}} />
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
- style={{
77
- fontSize: Platform.OS === 'web' ? 16 : 12,
78
- color: '#FD0845',
79
- fontWeight: '400',
80
- alignSelf: 'center',
81
- textAlign: 'center',
82
- flex: 1,
83
- }}>
84
- Recording
85
- </Text>
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 style={[style.roomNameContainer, Platform.OS === 'web' && !mobileAndTabletCheck() ? {transform: [{translateX: '50%'}]} : {}]}>
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={{flexDirection: 'row', justifyContent: 'flex-start', paddingLeft: 5}}>
94
- <Text style={style.roomNameText}>{mobileAndTabletCheck() ? title.length > 13 ? title.slice(0,13) + '..' : title : title}</Text>
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
- <CopyJoinInfo />
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
- padding: 4,
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: Platform.OS === 'web' && isDesktop ? 300 : mobileAndTabletCheck() ? 150 : 200,
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
- <TouchableOpacity
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
- <Image
148
- source={{uri: participantIcon}}
149
- style={[style.participantBtnIcon, {tintColor: primaryColor}]}
150
- />
151
- {/* <MinUidConsumer>
152
- {(minUsers) => (
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: '25%', height: '120%'}}>
177
- <View
178
- style={{alignSelf: 'center', width: '100%', height: '110%'}}>
179
- <TouchableOpacity
180
- style={style.btnHolder}
181
- onPress={() => {
182
- setLastCheckedPublicState(messageStore.length);
183
- sidePanel === SidePanelType.Chat
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
- resizeMode={'contain'}
203
- style={[
204
- {
205
- width: '100%',
206
- height: '100%',
207
- tintColor: $config.PRIMARY_COLOR,
208
- },
209
- ]}
219
+ name={
220
+ sidePanel === SidePanelType.Chat
221
+ ? 'chatIconFilled'
222
+ : 'chatIcon'
223
+ }
210
224
  />
211
- </TouchableOpacity>
212
- </View>
213
- </View>
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: '18%', height: '105%'}}>
233
- <View style={{alignSelf: 'center', width: '100%', height: '105%'}}>
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
- <Image
242
- // source={{uri: layout ? gridLayoutIcon : pinnedLayoutIcon}}
243
- source={{uri: gridLayoutIcon}}
244
- resizeMode={'contain'}
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
- width: '100%',
275
+ backgroundColor: $config.PRIMARY_FONT_COLOR + '80',
276
+ width: 1,
247
277
  height: '100%',
248
- tintColor: $config.PRIMARY_COLOR,
278
+ marginHorizontal: 10,
279
+ alignSelf: 'center',
280
+ opacity: 0.8,
249
281
  }}
250
282
  />
251
- </TouchableOpacity>
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: {padding: mobileAndTabletCheck() ? 2 : 5, width: '100%', height: '100%'},
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
- height: '100%',
345
- width: '100%',
346
- // margin: 1,
347
- tintColor: $config.PRIMARY_COLOR,
348
- resizeMode: 'contain',
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',