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.
Files changed (29) hide show
  1. package/package.json +1 -1
  2. package/template/android/app/src/main/assets/fonts/icomoon.ttf +0 -0
  3. package/template/customization-api/typeDefinition.ts +3 -8
  4. package/template/customization-api/utils.ts +1 -0
  5. package/template/defaultConfig.js +51 -51
  6. package/template/src/AppWrapper.tsx +1 -1
  7. package/template/src/assets/font-styles.css +4 -0
  8. package/template/src/assets/fonts/icomoon.ttf +0 -0
  9. package/template/src/assets/selection.json +1 -3452
  10. package/template/src/atoms/ActionMenu.tsx +88 -23
  11. package/template/src/atoms/Carousel.tsx +30 -24
  12. package/template/src/atoms/CustomIcon.tsx +1 -0
  13. package/template/src/atoms/ParticipantsCount.tsx +3 -10
  14. package/template/src/atoms/RecordingInfo.tsx +25 -30
  15. package/template/src/atoms/Toolbar.tsx +0 -8
  16. package/template/src/atoms/ToolbarPreset.tsx +77 -45
  17. package/template/src/components/Controls.tsx +289 -218
  18. package/template/src/components/Leftbar.tsx +62 -43
  19. package/template/src/components/Navbar.tsx +80 -77
  20. package/template/src/components/NavbarMobile.tsx +51 -46
  21. package/template/src/components/Rightbar.tsx +60 -43
  22. package/template/src/components/room-info/useRoomInfo.tsx +1 -1
  23. package/template/src/language/default-labels/videoCallScreenLabels.ts +1 -2
  24. package/template/src/pages/video-call/ActionSheet.tsx +4 -4
  25. package/template/src/pages/video-call/ActionSheetContent.tsx +134 -211
  26. package/template/src/pages/video-call/VideoCallMobileView.tsx +21 -27
  27. package/template/src/pages/video-call/VideoCallScreen.tsx +30 -20
  28. package/template/src/pages/video-call/index.ts +2 -0
  29. package/template/src/utils/common.tsx +48 -0
@@ -10,74 +10,93 @@
10
10
  *********************************************
11
11
  */
12
12
  import React from 'react';
13
- import {View, StyleSheet} from 'react-native';
13
+ import {View, StyleSheet, useWindowDimensions} from 'react-native';
14
14
  import Toolbar from '../atoms/Toolbar';
15
- import {ToolbarCustomItem} from '../atoms/ToolbarPreset';
16
- import {CustomToolbarSort} from '../utils/common';
15
+ import {CustomToolbarMerge, CustomToolbarSorting} from '../utils/common';
16
+ import {ToolbarItemHide, ToolbarLeftPresetProps} from '../atoms/ToolbarPreset';
17
+ import {filterObject} from '../utils';
17
18
 
18
- const defaultStartItems: ToolbarCustomItem[] = [];
19
- const defaultCenterItems: ToolbarCustomItem[] = [];
20
- const defaultEndItems: ToolbarCustomItem[] = [];
19
+ const defaultItems: ToolbarLeftPresetProps['items'] = {};
21
20
 
22
21
  export interface LeftbarProps {
23
- customItems?: ToolbarCustomItem[];
22
+ items?: ToolbarLeftPresetProps['items'];
24
23
  includeDefaultItems?: boolean;
25
24
  }
26
25
  const Leftbar = (props: LeftbarProps) => {
27
- const {customItems = [], includeDefaultItems = true} = props;
28
- const isHidden = i => {
29
- return i?.hide === 'yes';
26
+ const {includeDefaultItems = true, items = {}} = props;
27
+ const {width, height} = useWindowDimensions();
28
+
29
+ const isHidden = (hide: ToolbarItemHide = false) => {
30
+ try {
31
+ return typeof hide === 'boolean'
32
+ ? hide
33
+ : typeof hide === 'function'
34
+ ? hide(width, height)
35
+ : false;
36
+ } catch (error) {
37
+ console.log('debugging isHidden error', error);
38
+ return false;
39
+ }
30
40
  };
31
- const customStartItems = customItems
32
- ?.filter(i => i?.align === 'start' && !isHidden(i))
33
- ?.concat(includeDefaultItems ? defaultStartItems : [])
34
- ?.sort(CustomToolbarSort);
35
41
 
36
- const customCenterItems = customItems
37
- ?.filter(i => i?.align === 'center' && !isHidden(i))
38
- ?.concat(includeDefaultItems ? defaultCenterItems : [])
39
- ?.sort(CustomToolbarSort);
42
+ const mergedItems = CustomToolbarMerge(
43
+ includeDefaultItems ? defaultItems : {},
44
+ items,
45
+ );
40
46
 
41
- const customEndItems = customItems
42
- ?.filter(i => i?.align === 'end' && !isHidden(i))
43
- ?.concat(includeDefaultItems ? defaultEndItems : [])
44
- ?.sort(CustomToolbarSort);
47
+ const startItems = filterObject(
48
+ mergedItems,
49
+ ([_, v]) => v?.align === 'start' && !isHidden(v?.hide),
50
+ );
51
+ const centerItems = filterObject(
52
+ mergedItems,
53
+ ([_, v]) => v?.align === 'center' && !isHidden(v?.hide),
54
+ );
55
+ const endItems = filterObject(
56
+ mergedItems,
57
+ ([_, v]) => v?.align === 'end' && !isHidden(v?.hide),
58
+ );
59
+
60
+ const startItemsOrdered = CustomToolbarSorting(startItems);
61
+ const centerItemsOrdered = CustomToolbarSorting(centerItems);
62
+ const endItemsOrdered = CustomToolbarSorting(endItems);
45
63
 
46
64
  const renderContent = (
47
- items: ToolbarCustomItem[],
65
+ orderedKeys: string[],
48
66
  type: 'start' | 'center' | 'end',
49
67
  ) => {
50
- return items?.map((item, index) => {
51
- const ToolbarItem = item?.component;
52
- if (ToolbarItem) {
53
- return <ToolbarItem key={`left-toolbar-${type}` + index} />;
68
+ const renderContentItem = [];
69
+ let index = 0;
70
+ orderedKeys.forEach(keyName => {
71
+ index = index + 1;
72
+ let ToolbarComponent = null;
73
+ if (type === 'start') {
74
+ ToolbarComponent = startItems[keyName]?.component;
75
+ } else if (type === 'center') {
76
+ ToolbarComponent = centerItems[keyName]?.component;
54
77
  } else {
55
- return null;
78
+ ToolbarComponent = endItems[keyName]?.component;
79
+ }
80
+ if (ToolbarComponent) {
81
+ renderContentItem.push(
82
+ <ToolbarComponent key={`top-toolbar-${type}` + index} />,
83
+ );
56
84
  }
57
85
  });
86
+
87
+ return renderContentItem;
58
88
  };
89
+
59
90
  return (
60
91
  <Toolbar>
61
92
  <View style={style.startContent}>
62
- {customStartItems && customStartItems?.length ? (
63
- renderContent(customStartItems, 'start')
64
- ) : (
65
- <></>
66
- )}
93
+ {renderContent(startItemsOrdered, 'start')}
67
94
  </View>
68
95
  <View style={style.centerContent}>
69
- {customCenterItems && customCenterItems?.length ? (
70
- renderContent(customCenterItems, 'center')
71
- ) : (
72
- <></>
73
- )}
96
+ {renderContent(centerItemsOrdered, 'center')}
74
97
  </View>
75
98
  <View style={style.endContent}>
76
- {customEndItems && customEndItems?.length ? (
77
- renderContent(customEndItems, 'end')
78
- ) : (
79
- <></>
80
- )}
99
+ {renderContent(endItemsOrdered, 'end')}
81
100
  </View>
82
101
  </Toolbar>
83
102
  );
@@ -26,13 +26,15 @@ import {SidePanelType} from '../subComponents/SidePanelEnum';
26
26
  import ChatContext from '../components/ChatContext';
27
27
  import isMobileOrTablet from '../utils/isMobileOrTablet';
28
28
  import LiveStreamContext from './livestream';
29
- import {numFormatter} from '../utils/index';
29
+ import {filterObject, numFormatter} from '../utils/index';
30
30
  import {useLayout} from '../utils/useLayout';
31
31
  import {useChatNotification} from '../components/chat-notification/useChatNotification';
32
32
  import useLayoutsData from '../pages/video-call/useLayoutsData';
33
33
  import {
34
34
  BREAKPOINTS,
35
+ CustomToolbarMerge,
35
36
  CustomToolbarSort,
37
+ CustomToolbarSorting,
36
38
  isAndroid,
37
39
  isIOS,
38
40
  isMobileUA,
@@ -62,11 +64,7 @@ import styles from 'react-native-toast-message/src/styles';
62
64
  import RecordingInfo from '../atoms/RecordingInfo';
63
65
  import Toolbar from '../atoms/Toolbar';
64
66
  import ToolbarItem from '../atoms/ToolbarItem';
65
- import {
66
- ToolbarCustomItem,
67
- ToolbarDefaultItem,
68
- ToolbarDefaultItemConfig,
69
- } from '../atoms/ToolbarPreset';
67
+ import {ToolbarTopPresetProps, ToolbarItemHide} from '../atoms/ToolbarPreset';
70
68
  import {useToolbarMenu} from '../utils/useMenu';
71
69
  import ToolbarMenuItem from '../atoms/ToolbarMenuItem';
72
70
  import {useActionSheet} from '../utils/useActionSheet';
@@ -470,123 +468,128 @@ export const SettingsToobarItem = () => {
470
468
  );
471
469
  };
472
470
 
473
- const defaultItems: ToolbarDefaultItem[] = [
474
- {
471
+ const defaultItems: ToolbarTopPresetProps['items'] = {
472
+ 'meeting-title': {
475
473
  align: 'start',
476
- componentName: 'meeting-title',
477
474
  component: MeetingTitleToolbarItem,
478
475
  order: 0,
479
- hide: 'no',
480
476
  },
481
- {
477
+ 'participant-count': {
482
478
  align: 'start',
483
- componentName: 'participant-count',
484
479
  component: ParticipantCountToolbarItem,
485
480
  order: 1,
486
- hide: 'no',
487
481
  },
488
- {
482
+ 'recording-status': {
489
483
  align: 'start',
490
- componentName: 'recording-status',
491
484
  component: RecordingStatusToolbarItem,
492
485
  order: 2,
493
- hide: 'no',
494
486
  },
495
- {
487
+ participant: {
496
488
  align: 'end',
497
- componentName: 'participant',
498
489
  component: ParticipantToolbarItem,
499
490
  order: 0,
500
- hide: 'no',
491
+ hide: w => {
492
+ return w < BREAKPOINTS.lg ? true : false;
493
+ },
501
494
  },
502
- {
495
+ chat: {
503
496
  align: 'end',
504
- componentName: 'chat',
505
497
  component: ChatToolbarItem,
506
498
  order: 1,
507
- hide: 'no',
499
+ hide: w => {
500
+ return w < BREAKPOINTS.lg ? true : false;
501
+ },
508
502
  },
509
- {
503
+ settings: {
510
504
  align: 'end',
511
- componentName: 'settings',
512
505
  component: SettingsToobarItem,
513
506
  order: 2,
514
- hide: 'no',
507
+ hide: w => {
508
+ return w < BREAKPOINTS.lg ? true : false;
509
+ },
515
510
  },
516
- ];
511
+ };
517
512
 
518
513
  export interface NavbarProps {
519
- customItems?: ToolbarCustomItem[];
514
+ items?: ToolbarTopPresetProps['items'];
520
515
  includeDefaultItems?: boolean;
521
- defaultItemsConfig?: ToolbarDefaultItemConfig;
522
516
  }
523
517
  const Navbar = (props: NavbarProps) => {
524
- const {
525
- customItems = [],
526
- includeDefaultItems = true,
527
- defaultItemsConfig = {},
528
- } = props;
529
- const {width} = useWindowDimensions();
518
+ const {includeDefaultItems = true, items = {}} = props;
519
+ const {width, height} = useWindowDimensions();
530
520
 
531
- const isHidden = i => {
532
- return i?.hide === 'yes';
521
+ const isHidden = (hide: ToolbarItemHide = false) => {
522
+ try {
523
+ return typeof hide === 'boolean'
524
+ ? hide
525
+ : typeof hide === 'function'
526
+ ? hide(width, height)
527
+ : false;
528
+ } catch (error) {
529
+ console.log('debugging isHidden error', error);
530
+ return false;
531
+ }
533
532
  };
534
533
 
535
- const customStartItems = customItems
536
- ?.concat(
537
- includeDefaultItems
538
- ? updateToolbarDefaultConfig(defaultItems, defaultItemsConfig)
539
- : [],
540
- )
541
- ?.filter(i => i.align === 'start' && !isHidden(i))
542
- ?.sort(CustomToolbarSort);
543
-
544
- const customCenterItems = customItems
545
- ?.concat(
546
- includeDefaultItems
547
- ? updateToolbarDefaultConfig(defaultItems, defaultItemsConfig)
548
- : [],
549
- )
550
- ?.filter(i => i.align === 'center' && !isHidden(i))
551
- ?.sort(CustomToolbarSort);
552
-
553
- const customEndItems = customItems
554
- ?.concat(
555
- includeDefaultItems
556
- ? updateToolbarDefaultConfig(defaultItems, defaultItemsConfig)
557
- : [],
558
- )
559
- ?.filter(i => i.align === 'end' && !isHidden(i))
560
- ?.sort(CustomToolbarSort);
534
+ const mergedItems = CustomToolbarMerge(
535
+ includeDefaultItems ? defaultItems : {},
536
+ items,
537
+ );
538
+
539
+ const startItems = filterObject(
540
+ mergedItems,
541
+ ([_, v]) => v?.align === 'start' && !isHidden(v?.hide),
542
+ );
543
+ const centerItems = filterObject(
544
+ mergedItems,
545
+ ([_, v]) => v?.align === 'center' && !isHidden(v?.hide),
546
+ );
547
+ const endItems = filterObject(
548
+ mergedItems,
549
+ ([_, v]) => v?.align === 'end' && !isHidden(v?.hide),
550
+ );
551
+
552
+ const startItemsOrdered = CustomToolbarSorting(startItems);
553
+ const centerItemsOrdered = CustomToolbarSorting(centerItems);
554
+ const endItemsOrdered = CustomToolbarSorting(endItems);
561
555
 
562
556
  const renderContent = (
563
- items: ToolbarCustomItem[],
557
+ orderedKeys: string[],
564
558
  type: 'start' | 'center' | 'end',
565
559
  ) => {
566
- return items?.map((item, index) => {
567
- const ToolbarItem = item?.component;
568
- if (ToolbarItem) {
569
- return <ToolbarItem key={`top-toolbar-${type}` + index} />;
560
+ const renderContentItem = [];
561
+ let index = 0;
562
+ orderedKeys.forEach(keyName => {
563
+ index = index + 1;
564
+ let ToolbarComponent = null;
565
+ if (type === 'start') {
566
+ ToolbarComponent = startItems[keyName]?.component;
567
+ } else if (type === 'center') {
568
+ ToolbarComponent = centerItems[keyName]?.component;
570
569
  } else {
571
- return null;
570
+ ToolbarComponent = endItems[keyName]?.component;
571
+ }
572
+ if (ToolbarComponent) {
573
+ renderContentItem.push(
574
+ <ToolbarComponent key={`top-toolbar-${type}` + index} />,
575
+ );
572
576
  }
573
577
  });
578
+
579
+ return renderContentItem;
574
580
  };
581
+
575
582
  return (
576
583
  <Toolbar>
577
584
  <View style={style.startContent}>
578
- {renderContent(customStartItems, 'start')}
585
+ {renderContent(startItemsOrdered, 'start')}
579
586
  </View>
580
587
  <View style={style.centerContent}>
581
- {renderContent(customCenterItems, 'center')}
588
+ {renderContent(centerItemsOrdered, 'center')}
589
+ </View>
590
+ <View style={style.endContent}>
591
+ {renderContent(endItemsOrdered, 'end')}
582
592
  </View>
583
- {width > BREAKPOINTS.sm || isMobileUA() ? (
584
- <View style={style.endContent}>
585
- {renderContent(customEndItems, 'end')}
586
- </View>
587
- ) : (
588
- <></>
589
- )}
590
593
  </Toolbar>
591
594
  );
592
595
  };
@@ -1,85 +1,90 @@
1
1
  import React from 'react';
2
- import {View, StyleSheet} from 'react-native';
2
+ import {View, StyleSheet, useWindowDimensions} from 'react-native';
3
3
  import Toolbar from '../atoms/Toolbar';
4
- import {
5
- ToolbarCustomItem,
6
- ToolbarDefaultItem,
7
- ToolbarDefaultItemConfig,
8
- } from '../atoms/ToolbarPreset';
4
+ import {ToolbarItemHide, ToolbarTopPresetProps} from '../atoms/ToolbarPreset';
9
5
  import {
10
6
  MeetingTitleToolbarItem,
11
7
  ParticipantCountToolbarItem,
12
8
  RecordingStatusToolbarItem,
13
9
  } from './Navbar';
14
10
  import {useRecording} from '../subComponents/recording/useRecording';
15
- import {CustomToolbarSort, updateToolbarDefaultConfig} from '../utils/common';
11
+ import {CustomToolbarMerge, CustomToolbarSorting} from '../utils/common';
12
+ import {filterObject} from '../utils';
16
13
 
17
14
  export interface NavbarProps {
18
- customItems?: ToolbarCustomItem[];
19
15
  includeDefaultItems?: boolean;
20
- defaultItemsConfig?: ToolbarDefaultItemConfig;
16
+ items?: ToolbarTopPresetProps['items'];
21
17
  }
22
18
 
23
19
  const NavbarMobile = (props: NavbarProps) => {
24
20
  const {isRecordingActive} = useRecording();
25
- const defaultItems: ToolbarDefaultItem[] = [
26
- {
21
+ const defaultItems: NavbarProps['items'] = {
22
+ 'meeting-title': {
27
23
  align: 'start',
28
- componentName: 'meeting-title',
29
24
  component: MeetingTitleToolbarItem,
30
25
  order: 0,
31
- hide: 'no',
32
26
  },
33
- {
27
+ 'participant-count': {
34
28
  align: 'start',
35
- componentName: 'participant-count',
36
29
  component: ParticipantCountToolbarItem,
37
30
  order: 1,
38
- hide: 'no',
39
31
  },
40
- {
32
+ 'recording-status': {
41
33
  align: 'start',
42
- componentName: 'recording-status',
43
34
  component: isRecordingActive ? RecordingStatusToolbarItem : null,
44
35
  order: 2,
45
- hide: 'no',
46
36
  },
47
- ];
48
- const {
49
- customItems = [],
50
- includeDefaultItems = true,
51
- defaultItemsConfig = {},
52
- } = props;
53
- const isHidden = i => {
54
- return i?.hide === 'yes';
55
37
  };
38
+ const {items = {}, includeDefaultItems = true} = props;
39
+ const {width, height} = useWindowDimensions();
56
40
 
57
- const customTopBarItems = customItems
58
- ?.concat(
59
- includeDefaultItems
60
- ? updateToolbarDefaultConfig(defaultItems, defaultItemsConfig)
61
- : [],
62
- )
63
- ?.filter(i => !isHidden(i) && i?.component)
64
- ?.sort(CustomToolbarSort);
41
+ const isHidden = (hide: ToolbarItemHide = false) => {
42
+ try {
43
+ return typeof hide === 'boolean'
44
+ ? hide
45
+ : typeof hide === 'function'
46
+ ? hide(width, height)
47
+ : false;
48
+ } catch (error) {
49
+ console.log('debugging isHidden error', error);
50
+ return false;
51
+ }
52
+ };
65
53
 
66
- const renderContent = (
67
- items: ToolbarCustomItem[],
68
- type: 'start' | 'center' | 'end',
69
- ) => {
70
- return items?.map((item, index) => {
71
- const ToolbarItem = item?.component;
72
- if (ToolbarItem) {
73
- return <ToolbarItem key={`top-toolbar-${type}` + index} />;
74
- } else {
75
- return null;
54
+ const mergedItems = CustomToolbarMerge(
55
+ includeDefaultItems ? defaultItems : {},
56
+ items,
57
+ );
58
+
59
+ const startItems = filterObject(
60
+ mergedItems,
61
+ ([_, v]) => v?.align === 'start' && !isHidden(v?.hide),
62
+ );
63
+
64
+ const startItemsOrdered = CustomToolbarSorting(startItems);
65
+
66
+ const renderContent = (orderedKeys: string[], type: 'start') => {
67
+ const renderContentItem = [];
68
+ let index = 0;
69
+ orderedKeys.forEach(keyName => {
70
+ index = index + 1;
71
+ let ToolbarComponent = null;
72
+ if (type === 'start') {
73
+ ToolbarComponent = startItems[keyName]?.component;
74
+ }
75
+ if (ToolbarComponent) {
76
+ renderContentItem.push(
77
+ <ToolbarComponent key={`top-toolbar-${type}` + index} />,
78
+ );
76
79
  }
77
80
  });
81
+
82
+ return renderContentItem;
78
83
  };
79
84
  return (
80
85
  <Toolbar>
81
86
  <View style={style.startContent}>
82
- {renderContent(customTopBarItems, 'start')}
87
+ {renderContent(startItemsOrdered, 'start')}
83
88
  </View>
84
89
  </Toolbar>
85
90
  );
@@ -10,76 +10,93 @@
10
10
  *********************************************
11
11
  */
12
12
  import React from 'react';
13
- import {View, StyleSheet} from 'react-native';
13
+ import {View, StyleSheet, useWindowDimensions} from 'react-native';
14
14
  import Toolbar from '../atoms/Toolbar';
15
- import {ToolbarCustomItem} from '../atoms/ToolbarPreset';
16
- import {CustomToolbarSort} from '../utils/common';
15
+ import {CustomToolbarMerge, CustomToolbarSorting} from '../utils/common';
16
+ import {ToolbarItemHide, ToolbarRightPresetProps} from '../atoms/ToolbarPreset';
17
+ import {filterObject} from '../utils';
17
18
 
18
- const defaultStartItems: ToolbarCustomItem[] = [];
19
- const defaultCenterItems: ToolbarCustomItem[] = [];
20
- const defaultEndItems: ToolbarCustomItem[] = [];
19
+ const defaultItems: ToolbarRightPresetProps['items'] = {};
21
20
 
22
21
  export interface RightbarProps {
23
- customItems?: ToolbarCustomItem[];
22
+ items?: ToolbarRightPresetProps['items'];
24
23
  includeDefaultItems?: boolean;
25
24
  }
26
25
  const Rightbar = (props: RightbarProps) => {
27
- const {customItems = [], includeDefaultItems = true} = props;
26
+ const {includeDefaultItems = true, items = {}} = props;
27
+ const {width, height} = useWindowDimensions();
28
28
 
29
- const isHidden = (i) => {
30
- return i?.hide === 'yes';
29
+ const isHidden = (hide: ToolbarItemHide = false) => {
30
+ try {
31
+ return typeof hide === 'boolean'
32
+ ? hide
33
+ : typeof hide === 'function'
34
+ ? hide(width, height)
35
+ : false;
36
+ } catch (error) {
37
+ console.log('debugging isHidden error', error);
38
+ return false;
39
+ }
31
40
  };
32
41
 
33
- const customStartItems = customItems
34
- ?.filter((i) => i?.align === 'start' && !isHidden(i))
35
- ?.concat(includeDefaultItems ? defaultStartItems : [])
36
- ?.sort(CustomToolbarSort);
42
+ const mergedItems = CustomToolbarMerge(
43
+ includeDefaultItems ? defaultItems : {},
44
+ items,
45
+ );
37
46
 
38
- const customCenterItems = customItems
39
- ?.filter((i) => i?.align === 'center' && !isHidden(i))
40
- ?.concat(includeDefaultItems ? defaultCenterItems : [])
41
- ?.sort(CustomToolbarSort);
47
+ const startItems = filterObject(
48
+ mergedItems,
49
+ ([_, v]) => v?.align === 'start' && !isHidden(v?.hide),
50
+ );
51
+ const centerItems = filterObject(
52
+ mergedItems,
53
+ ([_, v]) => v?.align === 'center' && !isHidden(v?.hide),
54
+ );
55
+ const endItems = filterObject(
56
+ mergedItems,
57
+ ([_, v]) => v?.align === 'end' && !isHidden(v?.hide),
58
+ );
42
59
 
43
- const customEndItems = customItems
44
- ?.filter((i) => i?.align === 'end' && !isHidden(i))
45
- ?.concat(includeDefaultItems ? defaultEndItems : [])
46
- ?.sort(CustomToolbarSort);
60
+ const startItemsOrdered = CustomToolbarSorting(startItems);
61
+ const centerItemsOrdered = CustomToolbarSorting(centerItems);
62
+ const endItemsOrdered = CustomToolbarSorting(endItems);
47
63
 
48
64
  const renderContent = (
49
- items: ToolbarCustomItem[],
65
+ orderedKeys: string[],
50
66
  type: 'start' | 'center' | 'end',
51
67
  ) => {
52
- return items?.map((item, index) => {
53
- const ToolbarItem = item?.component;
54
- if (ToolbarItem) {
55
- return <ToolbarItem key={`left-toolbar-${type}` + index} />;
68
+ const renderContentItem = [];
69
+ let index = 0;
70
+ orderedKeys.forEach(keyName => {
71
+ index = index + 1;
72
+ let ToolbarComponent = null;
73
+ if (type === 'start') {
74
+ ToolbarComponent = startItems[keyName]?.component;
75
+ } else if (type === 'center') {
76
+ ToolbarComponent = centerItems[keyName]?.component;
56
77
  } else {
57
- return null;
78
+ ToolbarComponent = endItems[keyName]?.component;
79
+ }
80
+ if (ToolbarComponent) {
81
+ renderContentItem.push(
82
+ <ToolbarComponent key={`top-toolbar-${type}` + index} />,
83
+ );
58
84
  }
59
85
  });
86
+
87
+ return renderContentItem;
60
88
  };
89
+
61
90
  return (
62
91
  <Toolbar>
63
92
  <View style={style.startContent}>
64
- {customStartItems && customStartItems?.length ? (
65
- renderContent(customStartItems, 'start')
66
- ) : (
67
- <></>
68
- )}
93
+ {renderContent(startItemsOrdered, 'start')}
69
94
  </View>
70
95
  <View style={style.centerContent}>
71
- {customCenterItems && customCenterItems?.length ? (
72
- renderContent(customCenterItems, 'center')
73
- ) : (
74
- <></>
75
- )}
96
+ {renderContent(centerItemsOrdered, 'center')}
76
97
  </View>
77
98
  <View style={style.endContent}>
78
- {customEndItems && customEndItems?.length ? (
79
- renderContent(customEndItems, 'end')
80
- ) : (
81
- <></>
82
- )}
99
+ {renderContent(endItemsOrdered, 'end')}
83
100
  </View>
84
101
  </Toolbar>
85
102
  );
@@ -69,7 +69,7 @@ export interface RoomInfoContextInterface {
69
69
  prevLang?: LanguageType[];
70
70
  newLang?: LanguageType[];
71
71
  uid?: UidType;
72
- langChanged?: Boolean;
72
+ langChanged?: boolean;
73
73
  };
74
74
  isSTTActive?: boolean;
75
75
  roomPreference?: joinRoomPreference;
@@ -1254,8 +1254,7 @@ export const VideoCallScreenLabels: I18nVideoCallScreenLabelsInterface = {
1254
1254
  [waitingRoomApprovalRejectionToastSubHeading]:
1255
1255
  'Permission to enter the meeting was denied by the host',
1256
1256
 
1257
- [videoRoomRecordingText]: mode =>
1258
- mode === 'MIX' ? 'Cloud recording' : 'Web recording',
1257
+ [videoRoomRecordingText]: 'REC',
1259
1258
 
1260
1259
  [videoRoomGoToActiveSpeakerText]: 'Go To Active Speaker',
1261
1260
  [videoRoomScreenshareText]: username => `${username}'s screenshare`,