agora-appbuilder-core 4.0.25 → 4.0.26-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.
- package/package.json +1 -1
- package/template/android/app/src/main/assets/fonts/icomoon.ttf +0 -0
- package/template/customization-api/typeDefinition.ts +3 -8
- package/template/customization-api/utils.ts +1 -0
- package/template/defaultConfig.js +51 -51
- package/template/src/AppWrapper.tsx +1 -1
- package/template/src/assets/font-styles.css +4 -0
- package/template/src/assets/fonts/icomoon.ttf +0 -0
- package/template/src/assets/selection.json +1 -3452
- package/template/src/atoms/ActionMenu.tsx +88 -23
- package/template/src/atoms/Carousel.tsx +30 -24
- package/template/src/atoms/CustomIcon.tsx +1 -0
- package/template/src/atoms/ParticipantsCount.tsx +3 -10
- package/template/src/atoms/RecordingInfo.tsx +25 -30
- package/template/src/atoms/Toolbar.tsx +0 -8
- package/template/src/atoms/ToolbarPreset.tsx +77 -45
- package/template/src/components/Controls.tsx +289 -218
- package/template/src/components/Leftbar.tsx +62 -43
- package/template/src/components/Navbar.tsx +80 -77
- package/template/src/components/NavbarMobile.tsx +51 -46
- package/template/src/components/Rightbar.tsx +60 -43
- package/template/src/components/room-info/useRoomInfo.tsx +1 -1
- package/template/src/language/default-labels/videoCallScreenLabels.ts +1 -2
- package/template/src/pages/video-call/ActionSheet.tsx +4 -4
- package/template/src/pages/video-call/ActionSheetContent.tsx +134 -211
- package/template/src/pages/video-call/VideoCallMobileView.tsx +21 -27
- package/template/src/pages/video-call/VideoCallScreen.tsx +30 -20
- package/template/src/pages/video-call/index.ts +2 -0
- package/template/src/utils/common.tsx +48 -0
|
@@ -137,10 +137,10 @@ const ActionSheet = props => {
|
|
|
137
137
|
default:
|
|
138
138
|
}
|
|
139
139
|
};
|
|
140
|
-
const orientation = useOrientation();
|
|
141
|
-
if (orientation === 'LANDSCAPE') {
|
|
142
|
-
|
|
143
|
-
}
|
|
140
|
+
// const orientation = useOrientation();
|
|
141
|
+
// if (orientation === 'LANDSCAPE') {
|
|
142
|
+
// return <></>;
|
|
143
|
+
// }
|
|
144
144
|
return (
|
|
145
145
|
<>
|
|
146
146
|
{showOverlay && (
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
/* eslint-disable react-native/no-inline-styles */
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
StyleSheet,
|
|
4
|
+
Text,
|
|
5
|
+
TouchableOpacity,
|
|
6
|
+
useWindowDimensions,
|
|
7
|
+
View,
|
|
8
|
+
} from 'react-native';
|
|
3
9
|
import React, {useContext} from 'react';
|
|
4
10
|
import ImageIcon from '../../atoms/ImageIcon';
|
|
5
11
|
import LocalAudioMute from '../../subComponents/LocalAudioMute';
|
|
@@ -28,7 +34,7 @@ import {
|
|
|
28
34
|
useContent,
|
|
29
35
|
useLocalUserInfo,
|
|
30
36
|
ToolbarItem,
|
|
31
|
-
|
|
37
|
+
ToolbarItemHide,
|
|
32
38
|
} from 'customization-api';
|
|
33
39
|
import LayoutIconButton from '../../subComponents/LayoutIconButton';
|
|
34
40
|
import CaptionIcon from '../../../src/subComponents/caption/CaptionIcon';
|
|
@@ -43,10 +49,7 @@ import {EventNames} from '../../rtm-events';
|
|
|
43
49
|
import events from '../../rtm-events-api';
|
|
44
50
|
import {getLanguageLabel} from '../../subComponents/caption/utils';
|
|
45
51
|
import Toast from '../../../react-native-toast-message';
|
|
46
|
-
import {
|
|
47
|
-
CustomToolbarSort,
|
|
48
|
-
updateToolbarDefaultConfig,
|
|
49
|
-
} from '../../utils/common';
|
|
52
|
+
import {CustomToolbarMerge, CustomToolbarSorting} from '../../utils/common';
|
|
50
53
|
import {ActionSheetProvider} from '../../utils/useActionSheet';
|
|
51
54
|
import {useWaitingRoomContext} from '../../components/contexts/WaitingRoomContext';
|
|
52
55
|
import {useSetRoomInfo} from '../../components/room-info/useSetRoomInfo';
|
|
@@ -57,6 +60,7 @@ import {
|
|
|
57
60
|
sttSpokenLanguageToastHeading,
|
|
58
61
|
sttSpokenLanguageToastSubHeading,
|
|
59
62
|
} from '../../language/default-labels/videoCallScreenLabels';
|
|
63
|
+
import {filterObject} from '../../utils/index';
|
|
60
64
|
//Icon for expanding Action Sheet
|
|
61
65
|
interface ShowMoreIconProps {
|
|
62
66
|
isExpanded: boolean;
|
|
@@ -121,7 +125,7 @@ const VBIcon = () => {
|
|
|
121
125
|
<VBButton
|
|
122
126
|
isVBOpen={isVBActive}
|
|
123
127
|
setIsVBOpen={setIsVBActive}
|
|
124
|
-
showLabel={
|
|
128
|
+
showLabel={$config.ICON_TEXT}
|
|
125
129
|
/>
|
|
126
130
|
</ToolbarItem>
|
|
127
131
|
);
|
|
@@ -199,58 +203,29 @@ interface CaptionIconBtnProps {
|
|
|
199
203
|
}
|
|
200
204
|
|
|
201
205
|
const CaptionIconBtn = (props: CaptionIconBtnProps) => {
|
|
202
|
-
const {
|
|
203
|
-
const {isCaptionON, isSTTActive} = useCaption();
|
|
204
|
-
const {
|
|
205
|
-
data: {isHost},
|
|
206
|
-
} = useRoomInfo();
|
|
207
|
-
const isDisabled = !(
|
|
208
|
-
$config.ENABLE_STT &&
|
|
209
|
-
(isHost || (!isHost && isSTTActive))
|
|
210
|
-
);
|
|
206
|
+
const {onPress = () => {}} = props;
|
|
211
207
|
return (
|
|
212
208
|
<ToolbarItem>
|
|
213
209
|
<CaptionIcon
|
|
214
210
|
isOnActionSheet={true}
|
|
215
|
-
showLabel={
|
|
211
|
+
showLabel={$config.ICON_TEXT}
|
|
216
212
|
closeActionSheet={onPress}
|
|
217
213
|
/>
|
|
218
214
|
</ToolbarItem>
|
|
219
215
|
);
|
|
220
216
|
};
|
|
221
217
|
|
|
222
|
-
|
|
223
|
-
showLabel?: boolean;
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
const TranscriptIconBtn = (props: TranscriptIconProps) => {
|
|
227
|
-
const {showLabel = $config.ICON_TEXT} = props;
|
|
228
|
-
const {sidePanel} = useSidePanel();
|
|
229
|
-
const isTranscriptON = sidePanel === SidePanelType.Transcript;
|
|
230
|
-
const {isSTTActive} = useCaption();
|
|
231
|
-
const {
|
|
232
|
-
data: {isHost},
|
|
233
|
-
} = useRoomInfo();
|
|
234
|
-
const isDisabled = !(
|
|
235
|
-
$config.ENABLE_STT &&
|
|
236
|
-
(isHost || (!isHost && isSTTActive))
|
|
237
|
-
);
|
|
218
|
+
const TranscriptIconBtn = () => {
|
|
238
219
|
if (!$config.ENABLE_MEETING_TRANSCRIPT) {
|
|
239
220
|
return null;
|
|
240
221
|
}
|
|
241
222
|
return (
|
|
242
223
|
<ToolbarItem>
|
|
243
|
-
<TranscriptIcon isOnActionSheet={true} showLabel={
|
|
224
|
+
<TranscriptIcon isOnActionSheet={true} showLabel={$config.ICON_TEXT} />
|
|
244
225
|
</ToolbarItem>
|
|
245
226
|
);
|
|
246
227
|
};
|
|
247
228
|
|
|
248
|
-
const ToastIcon = ({color}) => (
|
|
249
|
-
<View style={{marginRight: 12, alignSelf: 'center', width: 24, height: 24}}>
|
|
250
|
-
<ImageIcon iconType="plain" tintColor={color} name={'lang-select'} />
|
|
251
|
-
</View>
|
|
252
|
-
);
|
|
253
|
-
|
|
254
229
|
const ActionSheetContent = props => {
|
|
255
230
|
const heading = useString<'Set' | 'Changed'>(sttSpokenLanguageToastHeading);
|
|
256
231
|
const subheading = useString<{
|
|
@@ -263,18 +238,16 @@ const ActionSheetContent = props => {
|
|
|
263
238
|
const {
|
|
264
239
|
handleSheetChanges,
|
|
265
240
|
isExpanded,
|
|
266
|
-
customItems = [],
|
|
267
241
|
includeDefaultItems = true,
|
|
268
242
|
displayCustomBottomSheetContent = false,
|
|
269
243
|
customBottomSheetContent,
|
|
270
244
|
native = false,
|
|
271
|
-
|
|
245
|
+
items = {},
|
|
272
246
|
} = props;
|
|
273
247
|
|
|
274
248
|
const {localUid} = useContext(ChatContext);
|
|
275
249
|
const {isScreenshareActive} = useScreenshare();
|
|
276
250
|
const {rtcProps} = useContext(PropsContext);
|
|
277
|
-
const {setSidePanel} = useSidePanel();
|
|
278
251
|
const {setRoomInfo} = useSetRoomInfo();
|
|
279
252
|
const {
|
|
280
253
|
data: {isHost},
|
|
@@ -393,183 +366,118 @@ const ActionSheetContent = props => {
|
|
|
393
366
|
|
|
394
367
|
const isPendingWaitingRoomApproval = isHost && waitingRoomUids.length > 0;
|
|
395
368
|
|
|
396
|
-
const defaultItems =
|
|
397
|
-
{
|
|
398
|
-
default: true,
|
|
369
|
+
const defaultItems = {
|
|
370
|
+
'local-audio': {
|
|
399
371
|
order: 0,
|
|
400
|
-
|
|
401
|
-
align: 'start',
|
|
402
|
-
componentName: 'local-audio',
|
|
403
|
-
component: isAudioVideoControlsDisabled ? null : <AudioIcon />,
|
|
372
|
+
component: isAudioVideoControlsDisabled ? null : AudioIcon,
|
|
404
373
|
},
|
|
405
|
-
{
|
|
406
|
-
|
|
407
|
-
order: 0,
|
|
408
|
-
hide: 'no',
|
|
409
|
-
align: 'start',
|
|
410
|
-
/*For AudioCast Host:Chat ,Attendee:Raise Hand
|
|
411
|
-
For VoiceChat Host:Chat, Attendee:Chat
|
|
412
|
-
*/
|
|
413
|
-
componentName: 'chat',
|
|
414
|
-
component: (isAudioCastHost ||
|
|
415
|
-
isVoiceChatHost ||
|
|
416
|
-
isVoiceChatAudience) && <ChatIcon />,
|
|
417
|
-
},
|
|
418
|
-
|
|
419
|
-
{
|
|
420
|
-
default: true,
|
|
421
|
-
order: 0,
|
|
422
|
-
hide: 'no',
|
|
423
|
-
align: 'start',
|
|
424
|
-
componentName: 'raise-hand',
|
|
374
|
+
'raise-hand': {
|
|
375
|
+
order: $config.RAISE_HAND && isAudioRoom ? 0 : 4,
|
|
425
376
|
component:
|
|
426
|
-
(isAudioCastAudience && isLiveStream && isAudience) ||
|
|
427
|
-
(isBroadCasting && !isHost)
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
377
|
+
((isAudioCastAudience && isLiveStream && isAudience) ||
|
|
378
|
+
(isBroadCasting && !isHost)
|
|
379
|
+
? LiveStreamIcon
|
|
380
|
+
: null) ||
|
|
381
|
+
((isLiveStream && isAudience) || (isBroadCasting && !isHost)
|
|
382
|
+
? LiveStreamIcon
|
|
383
|
+
: null),
|
|
432
384
|
},
|
|
433
|
-
{
|
|
434
|
-
default: true,
|
|
385
|
+
'local-video': {
|
|
435
386
|
order: 1,
|
|
436
|
-
hide: 'no',
|
|
437
|
-
align: 'start',
|
|
438
|
-
componentName: 'local-video',
|
|
439
387
|
component:
|
|
440
|
-
!isAudioRoom && (isAudioVideoControlsDisabled ? null :
|
|
388
|
+
!isAudioRoom && (isAudioVideoControlsDisabled ? null : CamIcon),
|
|
441
389
|
},
|
|
442
|
-
{
|
|
443
|
-
default: true,
|
|
390
|
+
'end-call': {
|
|
444
391
|
order: 2,
|
|
445
|
-
|
|
446
|
-
align: 'start',
|
|
447
|
-
componentName: 'end-call',
|
|
448
|
-
component: <EndCallIcon />,
|
|
392
|
+
component: EndCallIcon,
|
|
449
393
|
},
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
component:
|
|
458
|
-
(isLiveStream && isAudience) || (isBroadCasting && !isHost) ? (
|
|
459
|
-
$config.RAISE_HAND && !isAudioRoom ? (
|
|
460
|
-
<LiveStreamIcon />
|
|
461
|
-
) : null
|
|
462
|
-
) : null,
|
|
463
|
-
},
|
|
464
|
-
|
|
465
|
-
{
|
|
466
|
-
default: true,
|
|
467
|
-
order: 5,
|
|
468
|
-
hide: 'no',
|
|
469
|
-
align: 'start',
|
|
470
|
-
componentName: 'chat',
|
|
471
|
-
component: !(
|
|
472
|
-
isAudioCastHost ||
|
|
473
|
-
isVoiceChatHost ||
|
|
474
|
-
isVoiceChatAudience
|
|
475
|
-
) && <ChatIcon />,
|
|
394
|
+
chat: {
|
|
395
|
+
order: !(isAudioCastHost || isVoiceChatHost || isVoiceChatAudience)
|
|
396
|
+
? 5
|
|
397
|
+
: 0,
|
|
398
|
+
/*For AudioCast Host:Chat ,Attendee:Raise Hand
|
|
399
|
+
For VoiceChat Host:Chat, Attendee:Chat
|
|
400
|
+
*/
|
|
401
|
+
component: ChatIcon,
|
|
476
402
|
},
|
|
477
|
-
{
|
|
478
|
-
default: true,
|
|
403
|
+
participant: {
|
|
479
404
|
order: 6,
|
|
480
|
-
|
|
481
|
-
align: 'start',
|
|
482
|
-
componentName: 'participant',
|
|
483
|
-
component: <ParticipantsIcon />,
|
|
405
|
+
component: ParticipantsIcon,
|
|
484
406
|
},
|
|
485
|
-
{
|
|
486
|
-
default: true,
|
|
407
|
+
recording: {
|
|
487
408
|
order: 7,
|
|
488
|
-
|
|
489
|
-
align: 'start',
|
|
490
|
-
componentName: 'recording',
|
|
491
|
-
component: isHost && $config.CLOUD_RECORDING ? <RecordingIcon /> : null,
|
|
409
|
+
component: isHost && $config.CLOUD_RECORDING ? RecordingIcon : null,
|
|
492
410
|
},
|
|
493
|
-
{
|
|
494
|
-
default: true,
|
|
411
|
+
'virtual-background': {
|
|
495
412
|
order: 7,
|
|
496
|
-
hide: 'no',
|
|
497
|
-
align: 'start',
|
|
498
|
-
componentName: 'virtual-background',
|
|
499
413
|
component:
|
|
500
|
-
$config.ENABLE_VIRTUAL_BACKGROUND && !$config.AUDIO_ROOM
|
|
501
|
-
|
|
502
|
-
|
|
414
|
+
$config.ENABLE_VIRTUAL_BACKGROUND && !$config.AUDIO_ROOM
|
|
415
|
+
? VBIcon
|
|
416
|
+
: null,
|
|
503
417
|
},
|
|
504
|
-
{
|
|
505
|
-
default: true,
|
|
418
|
+
'switch-camera': {
|
|
506
419
|
order: 8,
|
|
507
|
-
hide: 'no',
|
|
508
|
-
align: 'start',
|
|
509
|
-
componentName: 'switch-camera',
|
|
510
420
|
component:
|
|
511
421
|
!isAudioRoom &&
|
|
512
|
-
(isAudioVideoControlsDisabled ? null :
|
|
422
|
+
(isAudioVideoControlsDisabled ? null : SwitchCameraIcon),
|
|
513
423
|
},
|
|
514
|
-
{
|
|
515
|
-
default: true,
|
|
424
|
+
layout: {
|
|
516
425
|
order: 9,
|
|
517
|
-
|
|
518
|
-
align: 'start',
|
|
519
|
-
componentName: 'layout',
|
|
520
|
-
component: <LayoutIcon />,
|
|
426
|
+
component: LayoutIcon,
|
|
521
427
|
},
|
|
522
|
-
{
|
|
523
|
-
default: true,
|
|
428
|
+
settings: {
|
|
524
429
|
order: 10,
|
|
525
|
-
|
|
526
|
-
align: 'start',
|
|
527
|
-
componentName: 'settings',
|
|
528
|
-
component: <SettingsIcon />,
|
|
430
|
+
component: SettingsIcon,
|
|
529
431
|
},
|
|
530
|
-
{
|
|
531
|
-
default: true,
|
|
432
|
+
invite: {
|
|
532
433
|
order: 11,
|
|
533
|
-
|
|
534
|
-
align: 'start',
|
|
535
|
-
componentName: 'invite',
|
|
536
|
-
component: <ShareIcon />,
|
|
434
|
+
component: ShareIcon,
|
|
537
435
|
},
|
|
538
|
-
{
|
|
539
|
-
default: true,
|
|
436
|
+
caption: {
|
|
540
437
|
order: 12,
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
<CaptionIconBtn
|
|
546
|
-
onPress={() => handleSheetChanges(isExpanded ? 0 : 1)}
|
|
547
|
-
/>
|
|
548
|
-
),
|
|
438
|
+
component: CaptionIconBtn,
|
|
439
|
+
props: {
|
|
440
|
+
onPress: () => handleSheetChanges(isExpanded ? 0 : 1),
|
|
441
|
+
},
|
|
549
442
|
},
|
|
550
|
-
{
|
|
551
|
-
default: true,
|
|
443
|
+
transcript: {
|
|
552
444
|
order: 13,
|
|
553
|
-
|
|
554
|
-
align: 'start',
|
|
555
|
-
componentName: 'transcript',
|
|
556
|
-
component: <TranscriptIconBtn />,
|
|
445
|
+
component: TranscriptIconBtn,
|
|
557
446
|
},
|
|
558
|
-
|
|
447
|
+
};
|
|
559
448
|
|
|
560
|
-
const
|
|
561
|
-
|
|
449
|
+
const {width, height} = useWindowDimensions();
|
|
450
|
+
|
|
451
|
+
const isHidden = (hide: ToolbarItemHide = false) => {
|
|
452
|
+
try {
|
|
453
|
+
return typeof hide === 'boolean'
|
|
454
|
+
? hide
|
|
455
|
+
: typeof hide === 'function'
|
|
456
|
+
? hide(width, height)
|
|
457
|
+
: false;
|
|
458
|
+
} catch (error) {
|
|
459
|
+
console.log('debugging isHidden error', error);
|
|
460
|
+
return false;
|
|
461
|
+
}
|
|
562
462
|
};
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
463
|
+
|
|
464
|
+
const combinedData = {...items, ...items?.more?.fields};
|
|
465
|
+
|
|
466
|
+
const mergedItems = CustomToolbarMerge(
|
|
467
|
+
includeDefaultItems ? defaultItems : {},
|
|
468
|
+
combinedData,
|
|
469
|
+
);
|
|
470
|
+
|
|
471
|
+
const displayItems = filterObject(
|
|
472
|
+
mergedItems,
|
|
473
|
+
([_, v]) => !isHidden(v?.hide) && v?.component,
|
|
474
|
+
);
|
|
475
|
+
|
|
476
|
+
console.log('debugging displayItems', displayItems);
|
|
477
|
+
|
|
478
|
+
const displayItemsOrdered = CustomToolbarSorting(displayItems);
|
|
479
|
+
|
|
480
|
+
console.log('debugging displayItemsOrdered', displayItemsOrdered);
|
|
573
481
|
|
|
574
482
|
if (displayCustomBottomSheetContent) {
|
|
575
483
|
return <View>{customBottomSheetContent}</View>;
|
|
@@ -585,17 +493,25 @@ const ActionSheetContent = props => {
|
|
|
585
493
|
]}>
|
|
586
494
|
{/**If no items more than 4 then render firstrender first 3 items and render show more icon */}
|
|
587
495
|
{/**If no items more less or equal to 4 then render n items and don't show more icon */}
|
|
588
|
-
{
|
|
589
|
-
?.slice(0,
|
|
496
|
+
{displayItemsOrdered
|
|
497
|
+
?.slice(0, displayItemsOrdered?.length > 4 ? 3 : 4)
|
|
590
498
|
?.map(i => {
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
499
|
+
try {
|
|
500
|
+
const Component = displayItems[i]?.component;
|
|
501
|
+
if (Component) {
|
|
502
|
+
return <Component />;
|
|
503
|
+
} else {
|
|
504
|
+
return null;
|
|
505
|
+
}
|
|
506
|
+
} catch (error) {
|
|
507
|
+
console.error(
|
|
508
|
+
'Error on rendering toolbar item in ActionSheet',
|
|
509
|
+
error,
|
|
510
|
+
);
|
|
595
511
|
return null;
|
|
596
512
|
}
|
|
597
513
|
})}
|
|
598
|
-
{
|
|
514
|
+
{displayItemsOrdered && displayItemsOrdered?.length > 4 ? (
|
|
599
515
|
<ShowMoreIcon
|
|
600
516
|
isExpanded={isExpanded}
|
|
601
517
|
showNotification={
|
|
@@ -611,25 +527,34 @@ const ActionSheetContent = props => {
|
|
|
611
527
|
</View>
|
|
612
528
|
</ActionSheetProvider>
|
|
613
529
|
|
|
614
|
-
<CarouselWrapper
|
|
530
|
+
<CarouselWrapper
|
|
531
|
+
data={displayItemsOrdered?.slice(3, displayItemsOrdered?.length)}
|
|
532
|
+
dataObject={displayItems}
|
|
533
|
+
/>
|
|
615
534
|
</View>
|
|
616
535
|
);
|
|
617
536
|
};
|
|
618
|
-
const CarouselWrapper = ({data}) => {
|
|
537
|
+
const CarouselWrapper = ({data, dataObject}) => {
|
|
619
538
|
const createSlides = () => {
|
|
620
539
|
const slides = [];
|
|
621
540
|
const items = data || [];
|
|
622
541
|
// one slide can contain max of 8 icons
|
|
623
542
|
for (let i = 0; i < items.length; i += 8) {
|
|
624
543
|
const slideItems = items.slice(i, i + 8).map(item => {
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
Component
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
)
|
|
544
|
+
try {
|
|
545
|
+
const Component = dataObject[item]?.component;
|
|
546
|
+
if (Component) {
|
|
547
|
+
return <Component />;
|
|
548
|
+
} else {
|
|
549
|
+
return null;
|
|
550
|
+
}
|
|
551
|
+
} catch (error) {
|
|
552
|
+
console.error(
|
|
553
|
+
'Error on rendering toolbar item in CarouselWrapper',
|
|
554
|
+
error,
|
|
555
|
+
);
|
|
556
|
+
return null;
|
|
557
|
+
}
|
|
633
558
|
});
|
|
634
559
|
|
|
635
560
|
slides.push({
|
|
@@ -645,13 +570,11 @@ const CarouselWrapper = ({data}) => {
|
|
|
645
570
|
|
|
646
571
|
const isPaginationRequired = slides.length > 1;
|
|
647
572
|
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
<
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
);
|
|
654
|
-
return <View style={styles.row}>{slides[0].component}</View>;
|
|
573
|
+
return (
|
|
574
|
+
<View style={{flexDirection: 'row'}}>
|
|
575
|
+
<Carousel data={slides} isPaginationRequired={isPaginationRequired} />
|
|
576
|
+
</View>
|
|
577
|
+
);
|
|
655
578
|
};
|
|
656
579
|
|
|
657
580
|
export default ActionSheetContent;
|
|
@@ -21,7 +21,7 @@ import {DispatchContext, RtcContext} from '../../../agora-rn-uikit';
|
|
|
21
21
|
import {
|
|
22
22
|
useLocalUserInfo,
|
|
23
23
|
useContent,
|
|
24
|
-
|
|
24
|
+
ToolbarPresetProps,
|
|
25
25
|
} from 'customization-api';
|
|
26
26
|
import CaptionContainer from '../../subComponents/caption/CaptionContainer';
|
|
27
27
|
import {useScreenContext} from '../../components/contexts/ScreenShareContext';
|
|
@@ -32,7 +32,7 @@ import useAppState from '../../utils/useAppState';
|
|
|
32
32
|
import {ToolbarPosition, ToolbarProvider} from '../../utils/useToolbar';
|
|
33
33
|
import {ActionSheetProvider} from '../../utils/useActionSheet';
|
|
34
34
|
import {useCustomization} from 'customization-implementation';
|
|
35
|
-
import NavbarMobile from '../../components/NavbarMobile';
|
|
35
|
+
import NavbarMobile, {NavbarProps} from '../../components/NavbarMobile';
|
|
36
36
|
import {useVB} from '../../components/virtual-background/useVB';
|
|
37
37
|
import VBPanel from '../../components/virtual-background/VBPanel';
|
|
38
38
|
import {WhiteboardListener} from '../../components/Controls';
|
|
@@ -163,23 +163,22 @@ const VideoCallView = React.memo(() => {
|
|
|
163
163
|
const {BottombarComponent, BottombarProps, TopbarComponent, TopbarProps} =
|
|
164
164
|
useCustomization(data => {
|
|
165
165
|
let components: {
|
|
166
|
-
BottombarComponent: React.ComponentType
|
|
167
|
-
BottombarProps?:
|
|
168
|
-
TopbarComponent: React.ComponentType
|
|
169
|
-
TopbarProps?:
|
|
166
|
+
BottombarComponent: React.ComponentType<any>;
|
|
167
|
+
BottombarProps?: ToolbarPresetProps['items'];
|
|
168
|
+
TopbarComponent: React.ComponentType<NavbarProps>;
|
|
169
|
+
TopbarProps?: ToolbarPresetProps['items'];
|
|
170
170
|
} = {
|
|
171
171
|
BottombarComponent: ActionSheet,
|
|
172
|
-
BottombarProps:
|
|
173
|
-
//@ts-ignore
|
|
172
|
+
BottombarProps: {},
|
|
174
173
|
TopbarComponent: NavbarMobile,
|
|
175
|
-
TopbarProps:
|
|
174
|
+
TopbarProps: {},
|
|
176
175
|
};
|
|
177
176
|
if (
|
|
178
177
|
data?.components?.videoCall &&
|
|
179
178
|
typeof data?.components?.videoCall === 'object'
|
|
180
179
|
) {
|
|
181
180
|
if (
|
|
182
|
-
data?.components?.videoCall
|
|
181
|
+
data?.components?.videoCall?.bottomToolBar &&
|
|
183
182
|
typeof data?.components?.videoCall.bottomToolBar !== 'object' &&
|
|
184
183
|
isValidReactComponent(data?.components?.videoCall.bottomToolBar)
|
|
185
184
|
) {
|
|
@@ -187,25 +186,25 @@ const VideoCallView = React.memo(() => {
|
|
|
187
186
|
data?.components?.videoCall.bottomToolBar;
|
|
188
187
|
}
|
|
189
188
|
if (
|
|
190
|
-
data?.components?.videoCall
|
|
191
|
-
typeof data?.components?.videoCall
|
|
192
|
-
data?.components?.videoCall.bottomToolBar
|
|
189
|
+
data?.components?.videoCall?.bottomToolBar &&
|
|
190
|
+
typeof data?.components?.videoCall?.bottomToolBar === 'object' &&
|
|
191
|
+
Object.keys(data?.components?.videoCall.bottomToolBar)?.length
|
|
193
192
|
) {
|
|
194
193
|
components.BottombarProps = data?.components?.videoCall.bottomToolBar;
|
|
195
194
|
}
|
|
196
195
|
|
|
197
196
|
if (
|
|
198
|
-
data?.components?.videoCall
|
|
199
|
-
typeof data?.components?.videoCall
|
|
197
|
+
data?.components?.videoCall?.topToolBar &&
|
|
198
|
+
typeof data?.components?.videoCall?.topToolBar !== 'object' &&
|
|
200
199
|
isValidReactComponent(data?.components?.videoCall.topToolBar)
|
|
201
200
|
) {
|
|
202
201
|
components.TopbarComponent = data?.components?.videoCall.topToolBar;
|
|
203
202
|
}
|
|
204
203
|
|
|
205
204
|
if (
|
|
206
|
-
data?.components?.videoCall
|
|
207
|
-
typeof data?.components?.videoCall
|
|
208
|
-
data?.components?.videoCall.topToolBar.length
|
|
205
|
+
data?.components?.videoCall?.topToolBar &&
|
|
206
|
+
typeof data?.components?.videoCall?.topToolBar === 'object' &&
|
|
207
|
+
Object.keys(data?.components?.videoCall.topToolBar).length
|
|
209
208
|
) {
|
|
210
209
|
components.TopbarProps = data?.components?.videoCall.topToolBar;
|
|
211
210
|
}
|
|
@@ -218,12 +217,8 @@ const VideoCallView = React.memo(() => {
|
|
|
218
217
|
<View style={styles.container}>
|
|
219
218
|
<>
|
|
220
219
|
<ToolbarProvider value={{position: ToolbarPosition.top}}>
|
|
221
|
-
{TopbarProps?.length ? (
|
|
222
|
-
<TopbarComponent
|
|
223
|
-
//@ts-ignore
|
|
224
|
-
customItems={TopbarProps}
|
|
225
|
-
includeDefaultItems={false}
|
|
226
|
-
/>
|
|
220
|
+
{Object.keys(TopbarProps)?.length ? (
|
|
221
|
+
<TopbarComponent items={TopbarProps} includeDefaultItems={false} />
|
|
227
222
|
) : (
|
|
228
223
|
<TopbarComponent />
|
|
229
224
|
)}
|
|
@@ -234,10 +229,9 @@ const VideoCallView = React.memo(() => {
|
|
|
234
229
|
</View>
|
|
235
230
|
<ToolbarProvider value={{position: ToolbarPosition.bottom}}>
|
|
236
231
|
<ActionSheetProvider>
|
|
237
|
-
{BottombarProps?.length ? (
|
|
232
|
+
{Object.keys(BottombarProps)?.length ? (
|
|
238
233
|
<BottombarComponent
|
|
239
|
-
|
|
240
|
-
customItems={BottombarProps}
|
|
234
|
+
items={BottombarProps}
|
|
241
235
|
includeDefaultItems={false}
|
|
242
236
|
/>
|
|
243
237
|
) : (
|