agora-appbuilder-core 4.0.27 → 4.0.28-beta-2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (83) hide show
  1. package/package.json +2 -2
  2. package/template/_package-lock.json +10 -7
  3. package/template/agora-rn-uikit/src/Reducer/UserOffline.ts +9 -0
  4. package/template/bridge/rtm/web/index.ts +44 -26
  5. package/template/customization-api/app-state.ts +1 -0
  6. package/template/customization-api/atoms.ts +8 -0
  7. package/template/customization-api/index.ts +1 -0
  8. package/template/customization-api/sub-components.ts +4 -1
  9. package/template/customization-api/temp.ts +1 -2
  10. package/template/customization-api/typeDefinition.ts +8 -0
  11. package/template/customization-api/types.ts +3 -0
  12. package/template/customization-api/utils.ts +10 -1
  13. package/template/defaultConfig.js +2 -2
  14. package/template/ios/HelloWorld.xcodeproj/project.pbxproj +102 -50
  15. package/template/ios/HelloWorld.xcodeproj/xcshareddata/xcschemes/ScreenSharing.xcscheme +95 -0
  16. package/template/ios/Podfile +1 -1
  17. package/template/ios/Podfile.lock +200 -44
  18. package/template/ios/ScreenSharing/SampleHandler.h +2 -6
  19. package/template/ios/ScreenSharing/SampleHandler.m +17 -48
  20. package/template/package-lock.json +10 -7
  21. package/template/package.json +1 -1
  22. package/template/src/AppWrapper.tsx +2 -2
  23. package/template/src/assets/selection.json +3491 -1
  24. package/template/src/atoms/ActionMenu.tsx +96 -113
  25. package/template/src/atoms/LinkButton.tsx +4 -3
  26. package/template/src/atoms/ToolbarItem.tsx +36 -22
  27. package/template/src/atoms/ToolbarPreset.tsx +18 -3
  28. package/template/src/components/Controls.tsx +72 -49
  29. package/template/src/components/CustomSidePanel.tsx +82 -0
  30. package/template/src/components/EventsConfigure.tsx +11 -27
  31. package/template/src/components/Navbar.tsx +51 -86
  32. package/template/src/components/NavbarMobile.tsx +27 -3
  33. package/template/src/components/PinnedVideo.tsx +9 -0
  34. package/template/src/components/RTMConfigure.tsx +69 -1
  35. package/template/src/components/Settings.tsx +6 -29
  36. package/template/src/components/chat/chatConfigure.native.tsx +123 -119
  37. package/template/src/components/chat/chatConfigure.tsx +59 -46
  38. package/template/src/components/chat-messages/useChatMessages.tsx +5 -4
  39. package/template/src/components/chat-ui/useChatUIControls.tsx +4 -1
  40. package/template/src/components/livestream/views/LiveStreamControls.tsx +2 -1
  41. package/template/src/components/participants/UserActionMenuOptions.tsx +10 -10
  42. package/template/src/components/virtual-background/VBButton.tsx +5 -7
  43. package/template/src/language/default-labels/videoCallScreenLabels.ts +9 -2
  44. package/template/src/language/i18nTypes.ts +1 -1
  45. package/template/src/pages/video-call/ActionSheet.native.tsx +110 -34
  46. package/template/src/pages/video-call/ActionSheet.tsx +109 -27
  47. package/template/src/pages/video-call/ActionSheetContent.tsx +67 -49
  48. package/template/src/pages/video-call/ActionSheetHandle.tsx +12 -2
  49. package/template/src/pages/video-call/SidePanelHeader.tsx +28 -2
  50. package/template/src/pages/video-call/VideoCallScreen.tsx +70 -16
  51. package/template/src/pages/video-call/VideoRenderer.tsx +1 -0
  52. package/template/src/rtm-events-api/Events.ts +37 -3
  53. package/template/src/rtm-events-api/LocalEvents.ts +1 -0
  54. package/template/src/rtm-events-api/types.ts +5 -0
  55. package/template/src/subComponents/ChatBubble.tsx +15 -1
  56. package/template/src/subComponents/ChatInput.tsx +18 -7
  57. package/template/src/subComponents/CopyJoinInfo.tsx +5 -13
  58. package/template/src/subComponents/LayoutIconButton.tsx +6 -14
  59. package/template/src/subComponents/LocalAudioMute.tsx +7 -11
  60. package/template/src/subComponents/LocalEndCall.tsx +6 -4
  61. package/template/src/subComponents/LocalSwitchCamera.tsx +5 -4
  62. package/template/src/subComponents/LocalVideoMute.tsx +10 -36
  63. package/template/src/subComponents/Recording.tsx +4 -10
  64. package/template/src/subComponents/ScreenShareNotice.tsx +3 -0
  65. package/template/src/subComponents/SidePanelEnum.tsx +6 -6
  66. package/template/src/subComponents/caption/CaptionContainer.tsx +2 -2
  67. package/template/src/subComponents/caption/CaptionIcon.tsx +21 -17
  68. package/template/src/subComponents/caption/TranscriptIcon.tsx +6 -3
  69. package/template/src/subComponents/chat/ChatActionMenu.tsx +3 -3
  70. package/template/src/subComponents/chat/ChatAttachment.tsx +107 -51
  71. package/template/src/subComponents/chat/ChatEmoji.tsx +8 -4
  72. package/template/src/subComponents/chat/ChatSendButton.tsx +52 -30
  73. package/template/src/subComponents/chat/ChatUploadStatus.tsx +22 -3
  74. package/template/src/subComponents/chat/ImagePopup.tsx +4 -4
  75. package/template/src/subComponents/livestream/controls/LocalRaiseHand.tsx +14 -25
  76. package/template/src/subComponents/screenshare/ScreenshareButton.tsx +8 -7
  77. package/template/src/subComponents/screenshare/ScreenshareConfigure.native.tsx +333 -163
  78. package/template/src/utils/common.tsx +22 -9
  79. package/template/src/utils/useEndCall.ts +6 -4
  80. package/template/src/utils/useFullScreen.native.ts +12 -0
  81. package/template/src/utils/useOrientation.tsx +46 -46
  82. package/template/src/utils/useSidePanel.tsx +2 -2
  83. package/template/src/utils/useString.ts +6 -4
@@ -112,89 +112,73 @@ const ChatConfigure = ({children}) => {
112
112
  }
113
113
  },
114
114
  onMessagesReceived: (messages: ChatMessage[]) => {
115
- // all types of msg recivied : text, image, video etc..
116
- console.warn('on msg rcvd : Native101', messages);
117
- const isGroupChat =
118
- messages[0].chatType === ChatMessageChatType.GroupChat;
119
- const isPeerChat =
120
- messages[0].chatType === ChatMessageChatType.PeerChat;
121
- const {msgId, from, body, localTime} = messages[0];
122
- const chatType = body.type;
123
- const fromUser = from;
124
- const {file_ext, file_name, file_url, from_platform, channel} =
125
- messages[0].attributes as ChatMessageAttributes;
115
+ // all types of msg received: text, image, video, etc.
116
+ console.warn('on msg rcvd: Native', messages);
126
117
 
127
- // prevent cross channel msgs
128
- if (channel !== data.channel) {
129
- return;
130
- }
118
+ messages.forEach(message => {
119
+ const isGroupChat =
120
+ message.chatType === ChatMessageChatType.GroupChat;
121
+ const isPeerChat =
122
+ message.chatType === ChatMessageChatType.PeerChat;
123
+ const {msgId, from, body, localTime} = message;
124
+ const chatType = body.type;
125
+ const fromUser = from;
126
+ const {file_ext, file_name, file_url, from_platform, channel} =
127
+ message.attributes as ChatMessageAttributes;
128
+
129
+ // prevent cross-channel messages
130
+ if (channel !== data.channel) {
131
+ return;
132
+ }
131
133
 
132
- switch (chatType) {
133
- case ChatMessageType.TXT:
134
- //@ts-ignore
135
- const chatContent = body.content;
136
- if (isGroupChat) {
137
- showMessageNotification(chatContent, fromUser, false);
138
- addMessageToStore(Number(fromUser), {
139
- msg: chatContent.replace(/^(\n)+|(\n)+$/g, ''),
140
- createdTimestamp: localTime,
141
- msgId: msgId,
142
- isDeleted: false,
143
- type: ChatMessageType.TXT,
144
- });
145
- }
146
- if (isPeerChat) {
147
- showMessageNotification(chatContent, fromUser, true);
148
- addMessageToPrivateStore(
149
- Number(fromUser),
150
- {
134
+ switch (chatType) {
135
+ case ChatMessageType.TXT:
136
+ //@ts-ignore
137
+ const chatContent = body.content;
138
+ if (isGroupChat) {
139
+ showMessageNotification(chatContent, fromUser, false);
140
+ addMessageToStore(Number(fromUser), {
151
141
  msg: chatContent.replace(/^(\n)+|(\n)+$/g, ''),
152
142
  createdTimestamp: localTime,
153
143
  msgId: msgId,
154
144
  isDeleted: false,
155
145
  type: ChatMessageType.TXT,
156
- },
157
- false,
158
- );
159
- }
160
- break;
161
- case ChatMessageType.IMAGE:
162
- const thumb =
163
- from_platform === 'web'
164
- ? file_url + '&thumbnail=true'
165
- : (body as {thumbnailRemotePath?: string})
166
- .thumbnailRemotePath;
167
- //@ts-ignore
168
- const url = from_platform === 'web' ? file_url : body.remotePath;
169
- console.warn('url ==>', url);
170
- if (isGroupChat) {
171
- showMessageNotification(
172
- file_name,
173
- fromUser,
174
- false,
175
- ChatMessageType.IMAGE,
176
- );
177
- addMessageToStore(Number(fromUser), {
178
- msg: '',
179
- createdTimestamp: localTime,
180
- msgId: msgId,
181
- isDeleted: false,
182
- type: ChatMessageType.IMAGE,
183
- thumb: thumb,
184
- url: url,
185
- fileName: file_name,
186
- });
187
- }
188
- if (isPeerChat) {
189
- showMessageNotification(
190
- 'You got private image msg',
191
- fromUser,
192
- true,
193
- ChatMessageType.IMAGE,
194
- );
195
- addMessageToPrivateStore(
196
- Number(fromUser),
197
- {
146
+ });
147
+ }
148
+ if (isPeerChat) {
149
+ showMessageNotification(chatContent, fromUser, true);
150
+ addMessageToPrivateStore(
151
+ Number(fromUser),
152
+ {
153
+ msg: chatContent.replace(/^(\n)+|(\n)+$/g, ''),
154
+ createdTimestamp: localTime,
155
+ msgId: msgId,
156
+ isDeleted: false,
157
+ type: ChatMessageType.TXT,
158
+ },
159
+ false,
160
+ );
161
+ }
162
+ break;
163
+
164
+ case ChatMessageType.IMAGE:
165
+ const thumb =
166
+ from_platform === 'web'
167
+ ? file_url + '&thumbnail=true'
168
+ : (body as {thumbnailRemotePath?: string})
169
+ .thumbnailRemotePath;
170
+ //@ts-ignore
171
+ const url =
172
+ from_platform === 'web' ? file_url : body.remotePath;
173
+ console.warn('url ==>', url);
174
+ if (isGroupChat) {
175
+ showMessageNotification(
176
+ file_name,
177
+ fromUser,
178
+ false,
179
+ ChatMessageType.IMAGE,
180
+ );
181
+ addMessageToStore(Number(fromUser), {
198
182
  msg: '',
199
183
  createdTimestamp: localTime,
200
184
  msgId: msgId,
@@ -203,43 +187,43 @@ const ChatConfigure = ({children}) => {
203
187
  thumb: thumb,
204
188
  url: url,
205
189
  fileName: file_name,
206
- },
207
- false,
208
- );
209
- }
210
- break;
211
- case ChatMessageType.FILE:
212
- //@ts-ignore
190
+ });
191
+ }
192
+ if (isPeerChat) {
193
+ showMessageNotification(
194
+ 'You got a private image message',
195
+ fromUser,
196
+ true,
197
+ ChatMessageType.IMAGE,
198
+ );
199
+ addMessageToPrivateStore(
200
+ Number(fromUser),
201
+ {
202
+ msg: '',
203
+ createdTimestamp: localTime,
204
+ msgId: msgId,
205
+ isDeleted: false,
206
+ type: ChatMessageType.IMAGE,
207
+ thumb: thumb,
208
+ url: url,
209
+ fileName: file_name,
210
+ },
211
+ false,
212
+ );
213
+ }
214
+ break;
213
215
 
214
- console.warn('message', JSON.stringify(messages, null, 2));
215
- if (isGroupChat) {
216
- showMessageNotification(
217
- file_name,
218
- fromUser,
219
- false,
220
- ChatMessageType.FILE,
221
- );
222
- addMessageToStore(Number(fromUser), {
223
- msg: '',
224
- createdTimestamp: localTime,
225
- msgId: msgId,
226
- isDeleted: false,
227
- type: ChatMessageType.FILE,
228
- url: file_url,
229
- ext: file_ext,
230
- fileName: file_name,
231
- });
232
- }
233
- if (isPeerChat) {
234
- showMessageNotification(
235
- file_name,
236
- fromUser,
237
- true,
238
- ChatMessageType.FILE,
239
- );
240
- addMessageToPrivateStore(
241
- Number(fromUser),
242
- {
216
+ case ChatMessageType.FILE:
217
+ //@ts-ignore
218
+ console.warn('message', JSON.stringify(message, null, 2));
219
+ if (isGroupChat) {
220
+ showMessageNotification(
221
+ file_name,
222
+ fromUser,
223
+ false,
224
+ ChatMessageType.FILE,
225
+ );
226
+ addMessageToStore(Number(fromUser), {
243
227
  msg: '',
244
228
  createdTimestamp: localTime,
245
229
  msgId: msgId,
@@ -248,13 +232,33 @@ const ChatConfigure = ({children}) => {
248
232
  url: file_url,
249
233
  ext: file_ext,
250
234
  fileName: file_name,
251
- },
252
- false,
253
- );
254
- }
255
-
256
- break;
257
- }
235
+ });
236
+ }
237
+ if (isPeerChat) {
238
+ showMessageNotification(
239
+ file_name,
240
+ fromUser,
241
+ true,
242
+ ChatMessageType.FILE,
243
+ );
244
+ addMessageToPrivateStore(
245
+ Number(fromUser),
246
+ {
247
+ msg: '',
248
+ createdTimestamp: localTime,
249
+ msgId: msgId,
250
+ isDeleted: false,
251
+ type: ChatMessageType.FILE,
252
+ url: file_url,
253
+ ext: file_ext,
254
+ fileName: file_name,
255
+ },
256
+ false,
257
+ );
258
+ }
259
+ break;
260
+ }
261
+ });
258
262
  },
259
263
  };
260
264
  console.warn('setup listener');
@@ -166,6 +166,7 @@ const ChatConfigure = ({children}) => {
166
166
  );
167
167
  }
168
168
  },
169
+
169
170
  onImageMessage: message => {
170
171
  if (message?.ext?.channel !== data?.channel) {
171
172
  return;
@@ -325,7 +326,6 @@ const ChatConfigure = ({children}) => {
325
326
  ) => {
326
327
  if (connRef.current) {
327
328
  //TODO thumb and url of actual image uploaded available in file upload complete
328
- const localFileUrl = option?.ext?.file_url || '';
329
329
  //add channel name so to prevent cross channel message mixup when same user joins two diff channels
330
330
  // this is filtered on msgRecived event
331
331
  option.ext = {...option?.ext, channel: data?.channel};
@@ -341,7 +341,6 @@ const ChatConfigure = ({children}) => {
341
341
  option,
342
342
  );
343
343
 
344
- // update local messagre store
345
344
  const messageData = {
346
345
  msg: option.msg.replace(/^(\n)+|(\n)+$/g, ''),
347
346
  createdTimestamp: timeNow(),
@@ -353,8 +352,8 @@ const ChatConfigure = ({children}) => {
353
352
  ext: option?.ext?.file_ext,
354
353
  fileName: option?.ext?.file_name,
355
354
  };
356
- //todo chattype as per natue type
357
- // this is local user messages
355
+
356
+ // update local user message store
358
357
  if (option.chatType === SDKChatType.SINGLE_CHAT) {
359
358
  addMessageToPrivateStore(Number(option?.to), messageData, true);
360
359
  } else {
@@ -418,51 +417,65 @@ const ChatConfigure = ({children}) => {
418
417
  anchor.remove();
419
418
  };
420
419
 
421
- const uploadAttachment = uploadFiles => {
422
- const {file_type, file_length, file_name, file_url, file_obj, file_ext} =
423
- uploadFiles;
420
+ const uploadAttachment = async uploadFiles => {
421
+ const {file_obj} = uploadFiles;
424
422
  const CHAT_APP_KEY = `${$config.CHAT_ORG_NAME}#${$config.CHAT_APP_NAME}`;
425
- const uploadObj = {
426
- onFileUploadProgress: (data: ProgressEvent) => {
427
- setUploadStatus(UploadStatus.IN_PROGRESS);
428
- },
429
- onFileUploadComplete: (data: any) => {
430
- const url = `${data.uri}/${data.entities[0].uuid}?em-redirect=true&share-secret=${data.entities[0]['share-secret']}`;
431
- //TODO: handle for multiple uploads
432
- setUploadedFiles(prev => {
433
- return [{...prev[0], file_url: url}];
434
- });
435
- setUploadStatus(UploadStatus.SUCCESS);
436
- },
437
- onFileUploadError: (error: any) => {
438
- logger.error(
439
- LogSource.Internals,
440
- 'CHAT',
441
- 'Attachment upload failed',
442
- error,
443
- );
444
- setUploadStatus(UploadStatus.FAILURE);
445
- },
446
- onFileUploadCanceled: () => {
447
- //setUploadStatus(UploadStatus.NOT_STARTED);
448
- },
449
- accessToken: data?.chat?.user_token,
450
- appKey: CHAT_APP_KEY,
451
- file: file_obj,
452
- apiUrl: $config.CHAT_URL,
453
- };
454
423
 
455
- try {
424
+ return new Promise((resolve, reject) => {
425
+ const uploadObj = {
426
+ onFileUploadProgress: (data: ProgressEvent) => {
427
+ setUploadedFiles(prev => {
428
+ const updatedFiles = [...prev];
429
+ updatedFiles[updatedFiles.length - 1] = {
430
+ ...updatedFiles[updatedFiles.length - 1],
431
+ upload_status: UploadStatus.IN_PROGRESS,
432
+ };
433
+ return updatedFiles;
434
+ });
435
+ },
436
+ onFileUploadComplete: (data: any) => {
437
+ const url = `${data.uri}/${data.entities[0].uuid}?em-redirect=true&share-secret=${data.entities[0]['share-secret']}`;
438
+
439
+ setUploadedFiles(prev => {
440
+ const updatedFiles = [...prev];
441
+ updatedFiles[updatedFiles.length - 1] = {
442
+ ...updatedFiles[updatedFiles.length - 1],
443
+ file_url: url,
444
+ upload_status: UploadStatus.SUCCESS,
445
+ };
446
+ return updatedFiles;
447
+ });
448
+ resolve(url);
449
+ },
450
+ onFileUploadError: (error: any) => {
451
+ logger.error(
452
+ LogSource.Internals,
453
+ 'CHAT',
454
+ 'Attachment upload failed',
455
+ error,
456
+ );
457
+ //setUploadStatus(UploadStatus.FAILURE);
458
+ setUploadedFiles(prev => {
459
+ const updatedFiles = [...prev];
460
+ updatedFiles[updatedFiles.length - 1] = {
461
+ ...updatedFiles[updatedFiles.length - 1],
462
+ upload_status: UploadStatus.FAILURE,
463
+ };
464
+ return updatedFiles;
465
+ });
466
+ reject(error);
467
+ },
468
+ onFileUploadCanceled: () => {
469
+ //setUploadStatus(UploadStatus.NOT_STARTED);
470
+ },
471
+ accessToken: data?.chat?.user_token,
472
+ appKey: CHAT_APP_KEY,
473
+ file: file_obj,
474
+ apiUrl: $config.CHAT_URL,
475
+ };
476
+
456
477
  AgoraChat.utils.uploadFile(uploadObj);
457
- } catch (error) {
458
- logger.debug(
459
- LogSource.Internals,
460
- 'CHAT',
461
- 'Attachment upload failed',
462
- error,
463
- );
464
- console.error(error);
465
- }
478
+ });
466
479
  };
467
480
 
468
481
  const deleteAttachment = (
@@ -111,11 +111,12 @@ export interface ChatOption {
111
111
  msg?: string;
112
112
  file?: object;
113
113
  ext?: {
114
- file_length: number;
115
- file_ext: string;
116
- file_name: string;
117
- file_url: string;
114
+ file_length?: number;
115
+ file_ext?: string;
116
+ file_name?: string;
117
+ file_url?: string;
118
118
  from_platform?: string;
119
+ channel?: string;
119
120
  };
120
121
  url?: string;
121
122
  }
@@ -28,12 +28,14 @@ export enum UploadStatus {
28
28
  }
29
29
 
30
30
  export interface File {
31
+ file_id: string;
31
32
  file_length: number;
32
33
  file_ext: string;
33
34
  file_url: string;
34
35
  file_name: string;
35
36
  file_type: string;
36
37
  file_obj: object;
38
+ upload_status: UploadStatus;
37
39
  }
38
40
 
39
41
  export interface ChatUIControlsInterface {
@@ -49,7 +51,7 @@ export interface ChatUIControlsInterface {
49
51
  setInputHeight: React.Dispatch<SetStateAction<number>>;
50
52
  showEmojiPicker: boolean;
51
53
  setShowEmojiPicker: React.Dispatch<SetStateAction<boolean>>;
52
- uploadStatus: UploadStatus;
54
+ uploadStatus: UploadStatus; // for mobile, where only one attchment per message sent
53
55
  setUploadStatus: React.Dispatch<SetStateAction<UploadStatus>>;
54
56
  uploadedFiles: File[];
55
57
  setUploadedFiles: React.Dispatch<SetStateAction<File[]>>;
@@ -83,6 +85,7 @@ export const MAX_HEIGHT = 92;
83
85
  export const LINE_HEIGHT = 17;
84
86
  export const MAX_UPLOAD_SIZE = 10; //MB
85
87
  export const MAX_TEXT_MESSAGE_SIZE = 5; //KB
88
+ export const MAX_FILES_UPLOAD = 5;
86
89
 
87
90
  const ChatUIControlsProvider = (props: ChatUIControlsProviderProps) => {
88
91
  const [chatType, setChatType] = useState<ChatType>(ChatType.Group);
@@ -16,6 +16,7 @@ import ToolbarItem from '../../../atoms/ToolbarItem';
16
16
  export interface LiveStreamControlsProps {
17
17
  showControls: boolean;
18
18
  showLabel?: boolean;
19
+ customProps?: any;
19
20
  }
20
21
 
21
22
  const LiveStreamControls = (props: LiveStreamControlsProps) => {
@@ -24,7 +25,7 @@ const LiveStreamControls = (props: LiveStreamControlsProps) => {
24
25
  if (!showControls) return <></>;
25
26
  return (
26
27
  <>
27
- <ToolbarItem>
28
+ <ToolbarItem toolbarProps={props?.customProps}>
28
29
  <LocalRaiseHand />
29
30
  </ToolbarItem>
30
31
  </>
@@ -172,7 +172,7 @@ export default function UserActionMenuOptionsOptions(
172
172
  : user.uid === getWhiteboardUid()
173
173
  ? viewWhiteboardLabel
174
174
  : viewInLargeLabel,
175
- callback: () => {
175
+ onPress: () => {
176
176
  setActionMenuVisible(false);
177
177
  dispatch({
178
178
  type: 'UserPin',
@@ -196,7 +196,7 @@ export default function UserActionMenuOptionsOptions(
196
196
  ? removeFromTopLabel
197
197
  : pinToTopLabel
198
198
  : pinToTopLabel,
199
- callback: () => {
199
+ onPress: () => {
200
200
  setActionMenuVisible(false);
201
201
  dispatch({
202
202
  type: 'UserSecondaryPin',
@@ -226,7 +226,7 @@ export default function UserActionMenuOptionsOptions(
226
226
  iconColor: $config.SECONDARY_ACTION_COLOR,
227
227
  textColor: $config.SECONDARY_ACTION_COLOR,
228
228
  title: messagePrivatelyLabel,
229
- callback: () => {
229
+ onPress: () => {
230
230
  setActionMenuVisible(false);
231
231
  openPrivateChat(user.uid);
232
232
  },
@@ -257,7 +257,7 @@ export default function UserActionMenuOptionsOptions(
257
257
  iconColor: $config.SECONDARY_ACTION_COLOR,
258
258
  textColor: $config.SECONDARY_ACTION_COLOR,
259
259
  title: audioLabel(user.audio),
260
- callback: () => {
260
+ onPress: () => {
261
261
  setActionMenuVisible(false);
262
262
  user.audio
263
263
  ? setShowAudioMuteModal(true)
@@ -271,7 +271,7 @@ export default function UserActionMenuOptionsOptions(
271
271
  iconColor: $config.SECONDARY_ACTION_COLOR,
272
272
  textColor: $config.SECONDARY_ACTION_COLOR,
273
273
  title: videoLabel(user.video),
274
- callback: () => {
274
+ onPress: () => {
275
275
  setActionMenuVisible(false);
276
276
  user.video
277
277
  ? setShowVideoMuteModal(true)
@@ -295,7 +295,7 @@ export default function UserActionMenuOptionsOptions(
295
295
  iconColor: $config.SECONDARY_ACTION_COLOR,
296
296
  textColor: $config.SECONDARY_ACTION_COLOR,
297
297
  title: addAsPresenterLabel,
298
- callback: () => {
298
+ onPress: () => {
299
299
  setActionMenuVisible(false);
300
300
  promoteAudienceAsCoHost(user.uid);
301
301
  },
@@ -314,7 +314,7 @@ export default function UserActionMenuOptionsOptions(
314
314
  iconColor: $config.SECONDARY_ACTION_COLOR,
315
315
  textColor: $config.SECONDARY_ACTION_COLOR,
316
316
  title: removeAsPresenterLabel,
317
- callback: () => {
317
+ onPress: () => {
318
318
  setActionMenuVisible(false);
319
319
  events.send(
320
320
  LiveStreamControlMessageEnum.raiseHandRequestRejected,
@@ -332,7 +332,7 @@ export default function UserActionMenuOptionsOptions(
332
332
  iconColor: $config.SEMANTIC_ERROR,
333
333
  textColor: $config.SEMANTIC_ERROR,
334
334
  title: removeFromRoomLabel,
335
- callback: () => {
335
+ onPress: () => {
336
336
  setActionMenuVisible(false);
337
337
  setRemoveMeetingPopupVisible(true);
338
338
  },
@@ -350,7 +350,7 @@ export default function UserActionMenuOptionsOptions(
350
350
  iconColor: $config.SECONDARY_ACTION_COLOR,
351
351
  textColor: $config.SECONDARY_ACTION_COLOR,
352
352
  title: changeNameLabel,
353
- callback: () => {
353
+ onPress: () => {
354
354
  setFocus(prevState => {
355
355
  return {
356
356
  ...prevState,
@@ -376,7 +376,7 @@ export default function UserActionMenuOptionsOptions(
376
376
  localuid === user?.parentUid
377
377
  ? stopScreenShareLabel
378
378
  : removeScreenShareLabel,
379
- callback: () => {
379
+ onPress: () => {
380
380
  setActionMenuVisible(false);
381
381
  //for local user directly stop the screenshare
382
382
  if (localuid === user.parentUid) {
@@ -1,12 +1,11 @@
1
- import {StyleSheet, Text, View} from 'react-native';
2
1
  import React from 'react';
3
- import {ToolbarItem} from 'customization-api';
4
2
  import ToolbarMenuItem from '../../atoms/ToolbarMenuItem';
5
3
  import {useToolbarMenu} from '../../utils/useMenu';
6
4
  import IconButton, {IconButtonProps} from '../../atoms/IconButton';
7
5
  import {useActionSheet} from '../../utils/useActionSheet';
8
6
  import {useString} from '../../utils/useString';
9
7
  import {toolbarItemVirtualBackgroundText} from '../../language/default-labels/videoCallScreenLabels';
8
+ import {useToolbarProps} from '../../atoms/ToolbarItem';
10
9
 
11
10
  interface VBButtonProps {
12
11
  isVBOpen: boolean;
@@ -16,7 +15,8 @@ interface VBButtonProps {
16
15
  }
17
16
 
18
17
  const VBButton = (props: VBButtonProps) => {
19
- const {isVBOpen, setIsVBOpen, showLabel = false} = props;
18
+ const {label = null, onPress: onPressCustom = null} = useToolbarProps();
19
+ const {setIsVBOpen, showLabel = false} = props;
20
20
  const {isToolbarMenuItem} = useToolbarMenu();
21
21
  const {isOnActionSheet} = useActionSheet();
22
22
  const vbLabel = useString(toolbarItemVirtualBackgroundText)();
@@ -26,14 +26,14 @@ const VBButton = (props: VBButtonProps) => {
26
26
  };
27
27
 
28
28
  let iconButtonProps: IconButtonProps = {
29
- onPress: onPress,
29
+ onPress: onPressCustom || onPress,
30
30
  iconProps: {
31
31
  tintColor: $config.SECONDARY_ACTION_COLOR,
32
32
  name: 'vb',
33
33
  },
34
34
 
35
35
  btnTextProps: {
36
- text: showLabel ? vbLabel?.replace(' ', '\n') : '',
36
+ text: showLabel ? label || vbLabel?.replace(' ', '\n') : '',
37
37
  numberOfLines: 2,
38
38
  textStyle: {
39
39
  marginTop: 8,
@@ -60,5 +60,3 @@ const VBButton = (props: VBButtonProps) => {
60
60
  };
61
61
 
62
62
  export default VBButton;
63
-
64
- const styles = StyleSheet.create({});
@@ -65,6 +65,10 @@ export interface I18nRequestConfirmation {
65
65
  name: string;
66
66
  type: I18nMuteType;
67
67
  }
68
+ export interface I18nFileSize {
69
+ name: string;
70
+ size: number;
71
+ }
68
72
  export interface I18nMuteConfirmation {
69
73
  name: string;
70
74
  type: I18nMuteType;
@@ -239,6 +243,7 @@ export const chatPrivateMessageDeletePopupText =
239
243
  'chatPrivateMessageDeletePopupText';
240
244
  export const chatUploadStatusInProgress = 'chatUploadStatusInProgress';
241
245
  export const chatUploadStatusFailure = 'chatUploadStatusFailure';
246
+ export const chatUploadMaxLimit = 'chatUploadMaxLimit';
242
247
 
243
248
  export const peoplePanelTurnoffAllCameraBtnText =
244
249
  'peoplePanelTurnoffAllCameraBtnText';
@@ -651,6 +656,7 @@ export interface I18nVideoCallScreenLabelsInterface {
651
656
  [chatUploadErrorFileTypeToastSubHeading]?: I18nBaseType;
652
657
  [chatUploadStatusInProgress]?: I18nBaseType;
653
658
  [chatUploadStatusFailure]?: I18nBaseType;
659
+ [chatUploadMaxLimit]?: I18nBaseType;
654
660
 
655
661
  [peoplePanelTurnoffAllCameraBtnText]?: I18nBaseType;
656
662
  [peoplePanelMuteAllMicBtnText]?: I18nBaseType;
@@ -1037,13 +1043,14 @@ export const VideoCallScreenLabels: I18nVideoCallScreenLabelsInterface = {
1037
1043
  [chatUploadErrorToastHeading]: 'Attachment Upload Error',
1038
1044
  [chatUploadErrorFileSizeToastHeading]: 'File size is too large',
1039
1045
  [chatSendErrorTextSizeToastHeading]: 'Text size is too large',
1040
- [chatUploadErrorFileSizeToastSubHeading]: size =>
1041
- `You can send attachments upto ${size}MB in size`,
1046
+ [chatUploadErrorFileSizeToastSubHeading]: (size, fileName) =>
1047
+ ` ${fileName} exceeds ${size}MB size limit`,
1042
1048
  [chatSendErrorTextSizeToastSubHeading]: size =>
1043
1049
  `You can send text message upto ${size}KB in size`,
1044
1050
  [chatUploadErrorFileTypeToastSubHeading]: type => `${type} is not supported`,
1045
1051
  [chatUploadStatusInProgress]: `Uploading... Please wait`,
1046
1052
  [chatUploadStatusFailure]: `Something went wrong while sharing.Let'as try again`,
1053
+ [chatUploadMaxLimit]: `Up to 5 files can be uploaded at a time`,
1047
1054
  [chatMessageDeleteConfirmBtnText]: `Delete`,
1048
1055
  [chatPublicMessageDeletePopupText]: `Are you sure you want to delete this message for everyone in the public chat? `,
1049
1056
  [chatPrivateMessageDeletePopupText]: (name: string) =>
@@ -1,6 +1,6 @@
1
1
  import {TextDataInterface} from './default-labels/index';
2
2
 
3
- export type I18nBaseType<T = any> = string | ((template: T) => string);
3
+ export type I18nBaseType<T = any> = string | ((...args: T[]) => string);
4
4
  export type I18nDynamicType = I18nBaseType<string>;
5
5
  export type I18nConditionalType = I18nBaseType<boolean>;
6
6
  export interface I18nInterface {