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
@@ -24,10 +24,30 @@ import {isAndroid, isIOS} from '../../utils/common';
24
24
  import ActionSheetHandle from './ActionSheetHandle';
25
25
  import Spacer from '../../atoms/Spacer';
26
26
  import Transcript from '../../subComponents/caption/Transcript';
27
+ import {useCustomization} from 'customization-implementation';
28
+ import CustomSidePanelView from '../../components/CustomSidePanel';
27
29
 
28
30
  //topbar btn template is used to show icons without label text (as in desktop : bottomBar)
29
31
 
30
32
  const ActionSheet = props => {
33
+ const [showCustomSidePanel, setShowCustomSidePanel] = useState(false);
34
+ const [customSidePanelIndex, setCustomSidePanelIndex] = useState<
35
+ undefined | number
36
+ >(undefined);
37
+ const sidePanelArray = useCustomization(data => {
38
+ if (
39
+ data?.components &&
40
+ data?.components?.videoCall &&
41
+ typeof data?.components?.videoCall === 'object'
42
+ ) {
43
+ if (
44
+ data?.components?.videoCall?.customSidePanel &&
45
+ typeof data?.components?.videoCall?.customSidePanel === 'function'
46
+ ) {
47
+ return data?.components?.videoCall?.customSidePanel();
48
+ }
49
+ }
50
+ });
31
51
  const {snapPointsMinMax = [100, 400]} = props;
32
52
  const [isExpanded, setIsExpanded] = React.useState(false);
33
53
  const {sidePanel, setSidePanel} = useSidePanel();
@@ -36,6 +56,7 @@ const ActionSheet = props => {
36
56
  const participantsSheetRef = useRef<BottomSheetModal>(null);
37
57
  const settingsSheetRef = useRef<BottomSheetModal>(null);
38
58
  const transcriptSheetRef = useRef<BottomSheetModal>(null);
59
+ const customActionSheetRef = useRef<BottomSheetModal>(null);
39
60
 
40
61
  // callbacks
41
62
  const handleSheetChanges = useCallback((index: number) => {
@@ -47,49 +68,74 @@ const ActionSheet = props => {
47
68
  bottomSheetRef?.current.present();
48
69
  }, []);
49
70
 
71
+ React.useEffect(() => {
72
+ if (showCustomSidePanel) {
73
+ customActionSheetRef?.current.present();
74
+ } else {
75
+ customActionSheetRef?.current.close();
76
+ }
77
+ }, [showCustomSidePanel]);
78
+
50
79
  // updating on sidepanel changes
51
80
  React.useEffect(() => {
52
81
  let timeout;
53
- switch (sidePanel) {
54
- case SidePanelType.Participants: {
55
- participantsSheetRef?.current.present();
56
- break;
57
- }
58
- case SidePanelType.Chat: {
59
- chatSheetRef?.current.present();
60
- break;
61
- }
62
- case SidePanelType.Settings: {
63
- settingsSheetRef?.current.present();
64
- break;
65
- }
66
- case SidePanelType.Transcript: {
67
- transcriptSheetRef?.current.present();
68
- break;
82
+
83
+ const selectedIndex = sidePanelArray?.findIndex(item => {
84
+ if (item?.name === sidePanel && item?.component) {
85
+ return true;
86
+ } else {
87
+ return false;
69
88
  }
70
- case SidePanelType.None: {
71
- if (isAndroid()) {
72
- timeout = setTimeout(() => {
73
- // Code to be executed after the timeout until https://github.com/gorhom/react-native-bottom-sheet/pull/1164/files is merged
74
- chatSheetRef?.current.close();
89
+ });
90
+ if (selectedIndex < 0) {
91
+ setShowCustomSidePanel(false);
92
+ setCustomSidePanelIndex(undefined);
93
+ switch (sidePanel) {
94
+ case SidePanelType.Participants: {
95
+ participantsSheetRef?.current.present();
96
+ break;
97
+ }
98
+ case SidePanelType.Chat: {
99
+ chatSheetRef?.current.present();
100
+ break;
101
+ }
102
+ case SidePanelType.Settings: {
103
+ settingsSheetRef?.current.present();
104
+ break;
105
+ }
106
+ case SidePanelType.Transcript: {
107
+ transcriptSheetRef?.current.present();
108
+ break;
109
+ }
110
+ case SidePanelType.None: {
111
+ if (isAndroid()) {
112
+ timeout = setTimeout(() => {
113
+ // Code to be executed after the timeout until https://github.com/gorhom/react-native-bottom-sheet/pull/1164/files is merged
114
+ chatSheetRef?.current.close();
115
+ participantsSheetRef?.current.close();
116
+ settingsSheetRef?.current.close();
117
+ transcriptSheetRef?.current.close();
118
+ customActionSheetRef?.current.close();
119
+ bottomSheetRef?.current.present();
120
+ }, 200);
121
+ } else {
122
+ // Code to be executed immediately without a timer
123
+ chatSheetRef?.current.dismiss();
75
124
  participantsSheetRef?.current.close();
76
125
  settingsSheetRef?.current.close();
77
126
  transcriptSheetRef?.current.close();
78
- bottomSheetRef?.current.present();
79
- }, 200);
80
- } else {
81
- // Code to be executed immediately without a timer
82
- chatSheetRef?.current.dismiss();
83
- participantsSheetRef?.current.close();
84
- settingsSheetRef?.current.close();
85
- transcriptSheetRef?.current.close();
86
- }
127
+ customActionSheetRef?.current.close();
128
+ }
87
129
 
88
- handleSheetChanges(0);
89
- break;
130
+ handleSheetChanges(0);
131
+ break;
132
+ }
133
+ default:
134
+ bottomSheetRef?.current.present();
90
135
  }
91
- default:
92
- bottomSheetRef?.current.present();
136
+ } else {
137
+ setShowCustomSidePanel(true);
138
+ setCustomSidePanelIndex(selectedIndex);
93
139
  }
94
140
  return () => {
95
141
  clearTimeout(timeout);
@@ -217,6 +263,36 @@ const ActionSheet = props => {
217
263
  <Transcript showHeader={false} />
218
264
  </BottomSheetView>
219
265
  </BottomSheetModal>
266
+
267
+ {/* Custom Action Sheet */}
268
+ <BottomSheetModal
269
+ snapPoints={['100%']}
270
+ ref={customActionSheetRef}
271
+ name="CustomSheet"
272
+ onDismiss={onDismiss}
273
+ style={styles.container}
274
+ backgroundStyle={styles.backgroundStyle}
275
+ handleIndicatorStyle={styles.handleIndicatorStyle}
276
+ enableContentPanningGesture={false}
277
+ handleComponent={() => (
278
+ <ActionSheetHandle
279
+ isCustomSidePanel={true}
280
+ customSidePanelProps={{
281
+ title: sidePanelArray[customSidePanelIndex]?.title,
282
+ onClose: sidePanelArray[customSidePanelIndex]?.onClose,
283
+ name: sidePanelArray[customSidePanelIndex]?.name,
284
+ }}
285
+ />
286
+ )}
287
+ stackBehavior="push">
288
+ <BottomSheetView>
289
+ <CustomSidePanelView
290
+ showHeader={false}
291
+ content={sidePanelArray[customSidePanelIndex]?.component}
292
+ name={sidePanelArray[customSidePanelIndex]?.name}
293
+ />
294
+ </BottomSheetView>
295
+ </BottomSheetModal>
220
296
  </BottomSheetModalProvider>
221
297
  );
222
298
  };
@@ -1,5 +1,11 @@
1
1
  import {StyleSheet, Text, View, TouchableWithoutFeedback} from 'react-native';
2
- import React, {useRef, useCallback, useLayoutEffect, useEffect} from 'react';
2
+ import React, {
3
+ useRef,
4
+ useCallback,
5
+ useLayoutEffect,
6
+ useEffect,
7
+ useState,
8
+ } from 'react';
3
9
  import {BottomSheet, BottomSheetRef} from 'react-spring-bottom-sheet';
4
10
  import './ActionSheetStyles.css';
5
11
  import ActionSheetContent from './ActionSheetContent';
@@ -19,8 +25,28 @@ import Transcript from '../../subComponents/caption/Transcript';
19
25
  import {ToolbarProvider} from '../../utils/useToolbar';
20
26
  import {ActionSheetProvider} from '../../utils/useActionSheet';
21
27
  import {useOrientation} from '../../utils/useOrientation';
28
+ import {useCustomization} from 'customization-implementation';
29
+ import CustomSidePanelView from '../../components/CustomSidePanel';
22
30
 
23
31
  const ActionSheet = props => {
32
+ const [showCustomSidePanel, setShowCustomSidePanel] = useState(false);
33
+ const [customSidePanelIndex, setCustomSidePanelIndex] = useState<
34
+ undefined | number
35
+ >(undefined);
36
+ const sidePanelArray = useCustomization(data => {
37
+ if (
38
+ data?.components &&
39
+ data?.components?.videoCall &&
40
+ typeof data?.components?.videoCall === 'object'
41
+ ) {
42
+ if (
43
+ data?.components?.videoCall?.customSidePanel &&
44
+ typeof data?.components?.videoCall?.customSidePanel === 'function'
45
+ ) {
46
+ return data?.components?.videoCall?.customSidePanel();
47
+ }
48
+ }
49
+ });
24
50
  const {snapPointsMinMax = [100, 400]} = props;
25
51
  const {setActionSheetVisible} = useToast();
26
52
  const [isExpanded, setIsExpanded] = React.useState(false);
@@ -32,10 +58,15 @@ const ActionSheet = props => {
32
58
  const chatSheetRef = useRef<BottomSheetRef>(null);
33
59
  const participantsSheetRef = useRef<BottomSheetRef>(null);
34
60
  const settingsSheetRef = useRef<BottomSheetRef>(null);
61
+ const customActionSheetRef = useRef<BottomSheetRef>(null);
35
62
  const transcriptSheetRef = useRef<BottomSheetRef>(null);
36
63
  const ToastComponentRender =
37
64
  isMobileUA() &&
38
- (isChatOpen || isSettingsOpen || isParticipantsOpen || isTranscriptOpen) ? (
65
+ (isChatOpen ||
66
+ isSettingsOpen ||
67
+ isParticipantsOpen ||
68
+ isTranscriptOpen ||
69
+ showCustomSidePanel) ? (
39
70
  <ToastComponent />
40
71
  ) : (
41
72
  <></>
@@ -59,41 +90,63 @@ const ActionSheet = props => {
59
90
  isChatOpen ||
60
91
  isSettingsOpen ||
61
92
  isParticipantsOpen ||
62
- isTranscriptOpen
93
+ isTranscriptOpen ||
94
+ showCustomSidePanel
63
95
  ) {
64
96
  setActionSheetVisible(true);
65
97
  } else {
66
98
  setActionSheetVisible(false);
67
99
  }
68
- }, [isChatOpen, isSettingsOpen, isParticipantsOpen, isTranscriptOpen]);
100
+ }, [
101
+ isChatOpen,
102
+ isSettingsOpen,
103
+ isParticipantsOpen,
104
+ isTranscriptOpen,
105
+ showCustomSidePanel,
106
+ setActionSheetVisible,
107
+ ]);
69
108
 
70
109
  // updating on sidepanel changes
71
110
  useEffect(() => {
72
- switch (sidePanel) {
73
- case SidePanelType.Participants: {
74
- setIsParticipantsOpen(true);
75
- break;
76
- }
77
- case SidePanelType.Chat: {
78
- setIsChatOpen(true);
79
- break;
111
+ const selectedIndex = sidePanelArray?.findIndex(item => {
112
+ if (item?.name === sidePanel && item?.component) {
113
+ return true;
114
+ } else {
115
+ return false;
80
116
  }
81
- case SidePanelType.Settings: {
82
- setIsSettingsOpen(true);
83
- break;
84
- }
85
- case SidePanelType.Transcript: {
86
- setIsTranscriptOpen(true);
87
- break;
88
- }
89
- case SidePanelType.None: {
90
- setIsChatOpen(false);
91
- setIsParticipantsOpen(false);
92
- setIsSettingsOpen(false);
93
- setIsTranscriptOpen(false);
94
- handleSheetChanges(0);
117
+ });
118
+ if (selectedIndex < 0) {
119
+ setShowCustomSidePanel(false);
120
+ setCustomSidePanelIndex(undefined);
121
+ switch (sidePanel) {
122
+ case SidePanelType.Participants: {
123
+ setIsParticipantsOpen(true);
124
+ break;
125
+ }
126
+ case SidePanelType.Chat: {
127
+ setIsChatOpen(true);
128
+ break;
129
+ }
130
+ case SidePanelType.Settings: {
131
+ setIsSettingsOpen(true);
132
+ break;
133
+ }
134
+ case SidePanelType.Transcript: {
135
+ setIsTranscriptOpen(true);
136
+ break;
137
+ }
138
+ case SidePanelType.None: {
139
+ setIsChatOpen(false);
140
+ setIsParticipantsOpen(false);
141
+ setIsSettingsOpen(false);
142
+ setIsTranscriptOpen(false);
143
+ handleSheetChanges(0);
144
+ }
145
+ default:
95
146
  }
96
- default:
147
+ } else {
148
+ setShowCustomSidePanel(true);
149
+ setCustomSidePanelIndex(selectedIndex);
97
150
  }
98
151
  }, [sidePanel]);
99
152
 
@@ -238,6 +291,35 @@ const ActionSheet = props => {
238
291
  blocking={false}>
239
292
  <Transcript showHeader={false} />
240
293
  </BottomSheet>
294
+ {showCustomSidePanel && customSidePanelIndex !== undefined ? (
295
+ <BottomSheet
296
+ sibling={ToastComponentRender}
297
+ ref={customActionSheetRef}
298
+ onDismiss={onDismiss}
299
+ open={showCustomSidePanel}
300
+ expandOnContentDrag={false}
301
+ snapPoints={({maxHeight}) => [1 * maxHeight]}
302
+ defaultSnap={({lastSnap, snapPoints}) => snapPoints[0]}
303
+ header={
304
+ <ActionSheetHandle
305
+ isCustomSidePanel={true}
306
+ customSidePanelProps={{
307
+ title: sidePanelArray[customSidePanelIndex]?.title,
308
+ onClose: sidePanelArray[customSidePanelIndex]?.onClose,
309
+ name: sidePanelArray[customSidePanelIndex]?.name,
310
+ }}
311
+ />
312
+ }
313
+ blocking={false}>
314
+ <CustomSidePanelView
315
+ showHeader={false}
316
+ content={sidePanelArray[customSidePanelIndex]?.component}
317
+ name={sidePanelArray[customSidePanelIndex]?.name}
318
+ />
319
+ </BottomSheet>
320
+ ) : (
321
+ <></>
322
+ )}
241
323
  </View>
242
324
  </>
243
325
  );
@@ -28,25 +28,21 @@ import {
28
28
  ParticipantsIconButton,
29
29
  } from '../../../src/components/Navbar';
30
30
  import {useChatNotification} from '../../components/chat-notification/useChatNotification';
31
- import {SidePanelType} from '../../subComponents/SidePanelEnum';
32
- import {useSidePanel} from '../../utils/useSidePanel';
33
31
  import {
34
32
  useContent,
35
33
  useLocalUserInfo,
36
34
  ToolbarItem,
37
35
  ToolbarItemHide,
36
+ ToolbarItemLabel,
38
37
  } from 'customization-api';
39
38
  import LayoutIconButton from '../../subComponents/LayoutIconButton';
40
39
  import CaptionIcon from '../../../src/subComponents/caption/CaptionIcon';
41
40
  import TranscriptIcon from '../../../src/subComponents/caption/TranscriptIcon';
42
- import useSTTAPI from '../../../src/subComponents/caption/useSTTAPI';
43
41
  import Carousel from '../../atoms/Carousel';
44
42
  import {useCaption} from '../../subComponents/caption/useCaption';
45
43
  import Settings from '../../components/Settings';
46
44
  import ScreenshareButton from '../../subComponents/screenshare/ScreenshareButton';
47
45
  import {useScreenshare} from '../../subComponents/screenshare/useScreenshare';
48
- import {EventNames} from '../../rtm-events';
49
- import events from '../../rtm-events-api';
50
46
  import {getLanguageLabel} from '../../subComponents/caption/utils';
51
47
  import Toast from '../../../react-native-toast-message';
52
48
  import {CustomToolbarMerge, CustomToolbarSorting} from '../../utils/common';
@@ -61,6 +57,7 @@ import {
61
57
  sttSpokenLanguageToastSubHeading,
62
58
  } from '../../language/default-labels/videoCallScreenLabels';
63
59
  import {filterObject} from '../../utils/index';
60
+ import {useLanguage} from '../../language/useLanguage';
64
61
  //Icon for expanding Action Sheet
65
62
  interface ShowMoreIconProps {
66
63
  isExpanded: boolean;
@@ -85,24 +82,26 @@ const ShowMoreIcon = (props: ShowMoreIconProps) => {
85
82
  };
86
83
 
87
84
  //Icon for Live Streaming Controls
88
- const LiveStreamIcon = () => {
85
+ const LiveStreamIcon = props => {
89
86
  //toolbaritem wrapped in the LiveStreamControls
90
- return <LiveStreamControls showControls={true} />;
87
+ return <LiveStreamControls showControls={true} customProps={props} />;
91
88
  };
92
89
 
93
90
  //Icon for Chat
94
- const ChatIcon = () => {
91
+ const ChatIcon = props => {
95
92
  return (
96
- <ToolbarItem>
93
+ <ToolbarItem toolbarProps={props}>
97
94
  <ChatIconButton />
98
95
  </ToolbarItem>
99
96
  );
100
97
  };
101
98
 
102
99
  //Icon for Participants
103
- const ParticipantsIcon = () => {
100
+ const ParticipantsIcon = props => {
101
+ console.log('debugging props', props);
102
+
104
103
  return (
105
- <ToolbarItem>
104
+ <ToolbarItem toolbarProps={props}>
106
105
  <ParticipantsIconButton />
107
106
  </ToolbarItem>
108
107
  );
@@ -110,18 +109,18 @@ const ParticipantsIcon = () => {
110
109
 
111
110
  //Icon for Recording
112
111
 
113
- const RecordingIcon = () => {
112
+ const RecordingIcon = props => {
114
113
  return (
115
- <ToolbarItem>
114
+ <ToolbarItem toolbarProps={props}>
116
115
  <Recording />
117
116
  </ToolbarItem>
118
117
  );
119
118
  };
120
119
 
121
- const VBIcon = () => {
120
+ const VBIcon = props => {
122
121
  const {isVBActive, setIsVBActive} = useVB();
123
122
  return (
124
- <ToolbarItem>
123
+ <ToolbarItem toolbarProps={props}>
125
124
  <VBButton
126
125
  isVBOpen={isVBActive}
127
126
  setIsVBOpen={setIsVBActive}
@@ -131,67 +130,64 @@ const VBIcon = () => {
131
130
  );
132
131
  };
133
132
 
134
- const SwitchCameraIcon = () => {
133
+ const SwitchCameraIcon = props => {
135
134
  return (
136
- <ToolbarItem>
135
+ <ToolbarItem toolbarProps={props}>
137
136
  <LocalSwitchCamera />
138
137
  </ToolbarItem>
139
138
  );
140
139
  };
141
140
 
142
- const SettingsIcon = () => {
141
+ const SettingsIcon = props => {
143
142
  return (
144
- <ToolbarItem>
143
+ <ToolbarItem toolbarProps={props}>
145
144
  <Settings />
146
145
  </ToolbarItem>
147
146
  );
148
147
  };
149
148
 
150
- const ShareIcon = () => {
149
+ const ShareIcon = props => {
151
150
  return (
152
- <ToolbarItem>
151
+ <ToolbarItem toolbarProps={props}>
153
152
  <CopyJoinInfo />
154
153
  </ToolbarItem>
155
154
  );
156
155
  };
157
156
  const ScreenshareIcon = () => {
158
157
  return (
159
- <View style={styles.iconWithText}>
160
- <View style={styles.iconContainer}>
161
- <ScreenshareButton showLabel={false} isOnActionSheet={true} />
162
- </View>
163
- {$config.ICON_TEXT && <Text style={styles.iconText}>Screen Share</Text>}
164
- </View>
158
+ <ToolbarItem>
159
+ <ScreenshareButton />
160
+ </ToolbarItem>
165
161
  );
166
162
  };
167
163
 
168
- const AudioIcon = () => {
164
+ const AudioIcon = props => {
169
165
  return (
170
- <ToolbarItem>
166
+ <ToolbarItem toolbarProps={props}>
171
167
  <LocalAudioMute />
172
168
  </ToolbarItem>
173
169
  );
174
170
  };
175
171
 
176
- const CamIcon = () => {
172
+ const CamIcon = props => {
177
173
  return (
178
- <ToolbarItem>
174
+ <ToolbarItem toolbarProps={props}>
179
175
  <LocalVideoMute />
180
176
  </ToolbarItem>
181
177
  );
182
178
  };
183
179
 
184
- const EndCallIcon = () => {
180
+ const EndCallIcon = props => {
185
181
  return (
186
- <ToolbarItem>
182
+ <ToolbarItem toolbarProps={props}>
187
183
  <LocalEndcall />
188
184
  </ToolbarItem>
189
185
  );
190
186
  };
191
187
 
192
- const LayoutIcon = () => {
188
+ const LayoutIcon = props => {
193
189
  return (
194
- <ToolbarItem>
190
+ <ToolbarItem toolbarProps={props}>
195
191
  <LayoutIconButton />
196
192
  </ToolbarItem>
197
193
  );
@@ -205,7 +201,7 @@ interface CaptionIconBtnProps {
205
201
  const CaptionIconBtn = (props: CaptionIconBtnProps) => {
206
202
  const {onPress = () => {}} = props;
207
203
  return (
208
- <ToolbarItem>
204
+ <ToolbarItem toolbarProps={props}>
209
205
  <CaptionIcon
210
206
  isOnActionSheet={true}
211
207
  showLabel={$config.ICON_TEXT}
@@ -215,12 +211,12 @@ const CaptionIconBtn = (props: CaptionIconBtnProps) => {
215
211
  );
216
212
  };
217
213
 
218
- const TranscriptIconBtn = () => {
214
+ const TranscriptIconBtn = props => {
219
215
  if (!$config.ENABLE_MEETING_TRANSCRIPT) {
220
216
  return null;
221
217
  }
222
218
  return (
223
- <ToolbarItem>
219
+ <ToolbarItem toolbarProps={props}>
224
220
  <TranscriptIcon isOnActionSheet={true} showLabel={$config.ICON_TEXT} />
225
221
  </ToolbarItem>
226
222
  );
@@ -246,7 +242,6 @@ const ActionSheetContent = props => {
246
242
  } = props;
247
243
 
248
244
  const {localUid} = useContext(ChatContext);
249
- const {isScreenshareActive} = useScreenshare();
250
245
  const {rtcProps} = useContext(PropsContext);
251
246
  const {setRoomInfo} = useSetRoomInfo();
252
247
  const {
@@ -356,14 +351,6 @@ const ActionSheetContent = props => {
356
351
  const isAudioVideoControlsDisabled =
357
352
  isAudience && $config.EVENT_MODE && !$config.RAISE_HAND;
358
353
 
359
- const isConferencing = !$config.EVENT_MODE && !$config.AUDIO_ROOM;
360
-
361
- const localUser = useLocalUserInfo();
362
-
363
- const isVideoDisabled = native
364
- ? localUser.video === ToggleState.disabled || isScreenshareActive
365
- : localUser.video === ToggleState.disabled;
366
-
367
354
  const isPendingWaitingRoomApproval = isHost && waitingRoomUids.length > 0;
368
355
 
369
356
  const defaultItems = {
@@ -429,6 +416,10 @@ const ActionSheetContent = props => {
429
416
  order: 10,
430
417
  component: SettingsIcon,
431
418
  },
419
+ screenshare: {
420
+ order: 10,
421
+ component: ScreenshareIcon,
422
+ },
432
423
  invite: {
433
424
  order: 11,
434
425
  component: ShareIcon,
@@ -468,6 +459,17 @@ const ActionSheetContent = props => {
468
459
  combinedData,
469
460
  );
470
461
 
462
+ const {languageCode} = useLanguage();
463
+ const customLabel = (labelParam: ToolbarItemLabel) => {
464
+ if (labelParam && typeof labelParam === 'string') {
465
+ return labelParam;
466
+ } else if (labelParam && typeof labelParam === 'function') {
467
+ return labelParam(languageCode);
468
+ } else {
469
+ return null;
470
+ }
471
+ };
472
+
471
473
  const displayItems = filterObject(
472
474
  mergedItems,
473
475
  ([_, v]) => !isHidden(v?.hide) && v?.component,
@@ -494,8 +496,12 @@ const ActionSheetContent = props => {
494
496
  ?.map(i => {
495
497
  try {
496
498
  const Component = displayItems[i]?.component;
499
+ const label = displayItems[i]?.label;
500
+ const onPress = displayItems[i]?.onPress;
497
501
  if (Component) {
498
- return <Component />;
502
+ return (
503
+ <Component label={customLabel(label)} onPress={onPress} />
504
+ );
499
505
  } else {
500
506
  return null;
501
507
  }
@@ -531,6 +537,16 @@ const ActionSheetContent = props => {
531
537
  );
532
538
  };
533
539
  const CarouselWrapper = ({data, dataObject}) => {
540
+ const {languageCode} = useLanguage();
541
+ const customLabel = (labelParam: ToolbarItemLabel) => {
542
+ if (labelParam && typeof labelParam === 'string') {
543
+ return labelParam;
544
+ } else if (labelParam && typeof labelParam === 'function') {
545
+ return labelParam(languageCode);
546
+ } else {
547
+ return null;
548
+ }
549
+ };
534
550
  const createSlides = () => {
535
551
  const slides = [];
536
552
  const items = data || [];
@@ -539,8 +555,10 @@ const CarouselWrapper = ({data, dataObject}) => {
539
555
  const slideItems = items.slice(i, i + 8).map(item => {
540
556
  try {
541
557
  const Component = dataObject[item]?.component;
558
+ const label = dataObject[item]?.label;
559
+ const onPress = dataObject[item]?.onPress;
542
560
  if (Component) {
543
- return <Component />;
561
+ return <Component label={customLabel(label)} onPress={onPress} />;
544
562
  } else {
545
563
  return null;
546
564
  }
@@ -5,15 +5,24 @@ import {SidePanelType} from '../../subComponents/SidePanelEnum';
5
5
 
6
6
  import {
7
7
  ChatHeader,
8
+ CustomSidePanelHeader,
8
9
  PeopleHeader,
9
10
  SettingsHeader,
10
11
  TranscriptHeader,
11
12
  } from './SidePanelHeader';
12
13
 
13
- const ActionSheetHandle = (props: {sidePanel: SidePanelType}) => {
14
+ const ActionSheetHandle = (props: {
15
+ sidePanel?: SidePanelType | string;
16
+ isCustomSidePanel?: boolean;
17
+ customSidePanelProps?: {
18
+ title: string;
19
+ onClose?: () => void;
20
+ name: string;
21
+ };
22
+ }) => {
14
23
  const Header = null;
15
24
 
16
- const {sidePanel} = props;
25
+ const {sidePanel, isCustomSidePanel = false, customSidePanelProps} = props;
17
26
 
18
27
  return (
19
28
  <View style={styles.container}>
@@ -23,6 +32,7 @@ const ActionSheetHandle = (props: {sidePanel: SidePanelType}) => {
23
32
  {sidePanel === SidePanelType.Chat && <ChatHeader />}
24
33
  {sidePanel === SidePanelType.Settings && <SettingsHeader />}
25
34
  {sidePanel === SidePanelType.Transcript && <TranscriptHeader />}
35
+ {isCustomSidePanel && <CustomSidePanelHeader {...customSidePanelProps} />}
26
36
  </View>
27
37
  );
28
38
  };