agora-appbuilder-core 4.0.28-beta-4 → 4.0.28-beta-5

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agora-appbuilder-core",
3
- "version": "4.0.28-beta-4",
3
+ "version": "4.0.28-beta-5",
4
4
  "description": "React Native template for RTE app builder",
5
5
  "main": "index.js",
6
6
  "files": [
@@ -76,8 +76,8 @@ const DefaultConfig = {
76
76
  CHAT_ORG_NAME: '',
77
77
  CHAT_APP_NAME: '',
78
78
  CHAT_URL: '',
79
- CLI_VERSION: '3.0.28-beta-4',
80
- CORE_VERSION: '4.0.28-beta-4',
79
+ CLI_VERSION: '3.0.28-beta-5',
80
+ CORE_VERSION: '4.0.28-beta-5',
81
81
  DISABLE_LANDSCAPE_MODE: false,
82
82
  };
83
83
 
@@ -70,9 +70,9 @@ const ActionSheet = props => {
70
70
 
71
71
  React.useEffect(() => {
72
72
  if (showCustomSidePanel) {
73
- customActionSheetRef?.current.present();
73
+ customActionSheetRef?.current?.present();
74
74
  } else {
75
- customActionSheetRef?.current.close();
75
+ customActionSheetRef?.current?.close();
76
76
  }
77
77
  }, [showCustomSidePanel]);
78
78
 
@@ -115,7 +115,7 @@ const ActionSheet = props => {
115
115
  participantsSheetRef?.current.close();
116
116
  settingsSheetRef?.current.close();
117
117
  transcriptSheetRef?.current.close();
118
- customActionSheetRef?.current.close();
118
+ customActionSheetRef?.current?.close();
119
119
  bottomSheetRef?.current.present();
120
120
  }, 200);
121
121
  } else {
@@ -124,7 +124,7 @@ const ActionSheet = props => {
124
124
  participantsSheetRef?.current.close();
125
125
  settingsSheetRef?.current.close();
126
126
  transcriptSheetRef?.current.close();
127
- customActionSheetRef?.current.close();
127
+ customActionSheetRef?.current?.close();
128
128
  }
129
129
 
130
130
  handleSheetChanges(0);
@@ -265,34 +265,38 @@ const ActionSheet = props => {
265
265
  </BottomSheetModal>
266
266
 
267
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>
268
+ {sidePanelArray && sidePanelArray?.length ? (
269
+ <BottomSheetModal
270
+ snapPoints={['100%']}
271
+ ref={customActionSheetRef}
272
+ name="CustomSheet"
273
+ onDismiss={onDismiss}
274
+ style={styles.container}
275
+ backgroundStyle={styles.backgroundStyle}
276
+ handleIndicatorStyle={styles.handleIndicatorStyle}
277
+ enableContentPanningGesture={false}
278
+ handleComponent={() => (
279
+ <ActionSheetHandle
280
+ isCustomSidePanel={true}
281
+ customSidePanelProps={{
282
+ title: sidePanelArray[customSidePanelIndex]?.title,
283
+ onClose: sidePanelArray[customSidePanelIndex]?.onClose,
284
+ name: sidePanelArray[customSidePanelIndex]?.name,
285
+ }}
286
+ />
287
+ )}
288
+ stackBehavior="push">
289
+ <BottomSheetView>
290
+ <CustomSidePanelView
291
+ showHeader={false}
292
+ content={sidePanelArray[customSidePanelIndex]?.component}
293
+ name={sidePanelArray[customSidePanelIndex]?.name}
294
+ />
295
+ </BottomSheetView>
296
+ </BottomSheetModal>
297
+ ) : (
298
+ <></>
299
+ )}
296
300
  </BottomSheetModalProvider>
297
301
  );
298
302
  };
@@ -45,7 +45,12 @@ import ScreenshareButton from '../../subComponents/screenshare/ScreenshareButton
45
45
  import {useScreenshare} from '../../subComponents/screenshare/useScreenshare';
46
46
  import {getLanguageLabel} from '../../subComponents/caption/utils';
47
47
  import Toast from '../../../react-native-toast-message';
48
- import {CustomToolbarMerge, CustomToolbarSorting} from '../../utils/common';
48
+ import {
49
+ CustomToolbarMerge,
50
+ CustomToolbarSorting,
51
+ isIOS,
52
+ isAndroid,
53
+ } from '../../utils/common';
49
54
  import {ActionSheetProvider} from '../../utils/useActionSheet';
50
55
  import {useWaitingRoomContext} from '../../components/contexts/WaitingRoomContext';
51
56
  import {useSetRoomInfo} from '../../components/room-info/useSetRoomInfo';
@@ -193,17 +198,17 @@ const LayoutIcon = props => {
193
198
 
194
199
  interface CaptionIconBtnProps {
195
200
  showLabel?: boolean;
196
- onPress?: () => void;
201
+ onPressCallback?: () => void;
197
202
  }
198
203
 
199
204
  const CaptionIconBtn = (props: CaptionIconBtnProps) => {
200
- const {onPress = () => {}} = props;
205
+ const {onPressCallback = () => {}} = props;
201
206
  return (
202
207
  <ToolbarItem toolbarProps={props}>
203
208
  <CaptionIcon
204
209
  isOnActionSheet={true}
205
210
  showLabel={$config.ICON_TEXT}
206
- closeActionSheet={onPress}
211
+ closeActionSheet={onPressCallback}
207
212
  />
208
213
  </ToolbarItem>
209
214
  );
@@ -416,7 +421,7 @@ const ActionSheetContent = props => {
416
421
  },
417
422
  screenshare: {
418
423
  order: 10,
419
- component: ScreenshareIcon,
424
+ component: isAndroid() || isIOS() ? ScreenshareIcon : null,
420
425
  },
421
426
  invite: {
422
427
  order: 11,
@@ -426,7 +431,9 @@ const ActionSheetContent = props => {
426
431
  order: 12,
427
432
  component: CaptionIconBtn,
428
433
  props: {
429
- onPress: () => handleSheetChanges(isExpanded ? 0 : 1),
434
+ onPressCallback: () => {
435
+ handleSheetChanges(isExpanded ? 0 : 1);
436
+ },
430
437
  },
431
438
  },
432
439
  transcript: {
@@ -496,9 +503,14 @@ const ActionSheetContent = props => {
496
503
  const Component = displayItems[i]?.component;
497
504
  const label = displayItems[i]?.label;
498
505
  const onPress = displayItems[i]?.onPress;
506
+ const extraProps = displayItems[i]?.props;
499
507
  if (Component) {
500
508
  return (
501
- <Component label={customLabel(label)} onPress={onPress} />
509
+ <Component
510
+ label={customLabel(label)}
511
+ onPress={onPress}
512
+ {...extraProps}
513
+ />
502
514
  );
503
515
  } else {
504
516
  return null;
@@ -555,8 +567,15 @@ const CarouselWrapper = ({data, dataObject}) => {
555
567
  const Component = dataObject[item]?.component;
556
568
  const label = dataObject[item]?.label;
557
569
  const onPress = dataObject[item]?.onPress;
570
+ const extraProps = dataObject[item]?.props;
558
571
  if (Component) {
559
- return <Component label={customLabel(label)} onPress={onPress} />;
572
+ return (
573
+ <Component
574
+ label={customLabel(label)}
575
+ onPress={onPress}
576
+ {...extraProps}
577
+ />
578
+ );
560
579
  } else {
561
580
  return null;
562
581
  }
@@ -5,7 +5,7 @@ import {isArray, useIsDesktop, isValidReactComponent} from '../../utils/common';
5
5
  import {PropsContext, ClientRoleType} from '../../../agora-rn-uikit';
6
6
  import {useLayout} from '../../utils/useLayout';
7
7
  import {useContent, useRoomInfo} from 'customization-api';
8
- import {getGridLayoutName} from './DefaultLayouts';
8
+ import {DefaultLayouts, getGridLayoutName} from './DefaultLayouts';
9
9
  import {DispatchContext} from '../../../agora-rn-uikit';
10
10
  import MeetingInfoGridTile from '../../components/meeting-info-invite/MeetingInfoGridTile';
11
11
  import Spacer from '../../atoms/Spacer';
@@ -84,9 +84,11 @@ const VideoComponent = () => {
84
84
  justifyContent: 'space-between',
85
85
  }}>
86
86
  <CurrentLayout renderData={activeUids} />
87
- {(!$config.EVENT_MODE && activeUids.length === 1) ||
88
- ($config.EVENT_MODE &&
89
- hostUids.concat(audienceUids)?.length === 1) ? (
87
+ {((!$config.EVENT_MODE && activeUids.length === 1) ||
88
+ ($config.EVENT_MODE &&
89
+ hostUids.concat(audienceUids)?.length === 1)) &&
90
+ (layoutsData[layout].name === DefaultLayouts[0].name ||
91
+ layoutsData[layout].name === DefaultLayouts[1].name) ? (
90
92
  <>
91
93
  <Spacer size={8} horizontal={isDesktop() ? true : false} />
92
94
  <MeetingInfoGridTile />
@@ -0,0 +1,3 @@
1
+ export function useOrientation() {
2
+ return 'PORTRAIT';
3
+ }