-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathtop-bar.tsx
More file actions
120 lines (116 loc) · 3.16 KB
/
top-bar.tsx
File metadata and controls
120 lines (116 loc) · 3.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
/*
********************************************
Copyright © 2021 Agora Lab, Inc., all rights reserved.
AppBuilder and all associated components, source code, APIs, services, and documentation
(the “Materials”) are owned by Agora Lab, Inc. and its licensors. The Materials may not be
accessed, used, modified, or distributed for any purpose without a license from Agora Lab, Inc.
Use without a license or in violation of any license terms and conditions (including use for
any purpose competitive to Agora Lab, Inc.’s business) is strictly prohibited. For more
information visit https://appbuilder.agora.io.
*********************************************
*/
import {customize} from 'customization-api';
import React from 'react';
import {View, Text, StyleSheet} from 'react-native';
import {
useMeetingInfo,
useRecording,
NavBarComponentsArray,
$config,
} from 'customization-api';
import Notice from '../notice';
const TopBar = () => {
const {
data: {meetingTitle},
} = useMeetingInfo();
const [
CopyJoinInfo,
ParticipantsCountView,
ParticipantsIconButton,
ChatIconButton,
LayoutIconButton,
SettingsIconButton,
] = NavBarComponentsArray;
return (
<View style={style.rootContainer}>
<Notice message="This top bar component was rebuilt using the sub-components library." />
<View style={style.container}>
<View style={style.titleContainer}>
<View>
<Text>
{meetingTitle} {' - Sample App'}
</Text>
</View>
<View style={[style.navItem]}>
<CopyJoinInfo />
</View>
</View>
<View style={style.iconContainer}>
<View style={[style.navItem]}>
<ParticipantsIconButton />
</View>
{$config.CHAT ? (
<>
<View style={[style.navItem]}>
<ChatIconButton />
</View>
</>
) : (
<></>
)}
<View
style={[style.navItem]}
/**
* .measure returns undefined on Android unless collapsable=false or onLayout are specified
* so added collapsable property
* https://github.com/facebook/react-native/issues/29712
* */
collapsable={false}>
<LayoutIconButton />
</View>
<View style={[style.navItem]}>
<SettingsIconButton />
</View>
</View>
</View>
</View>
);
};
const style = StyleSheet.create({
rootContainer: {
flex: 1,
},
container: {
flex: 1,
flexDirection: 'row',
justifyContent: 'space-between',
},
titleContainer: {
flex: 1,
flexDirection: 'row',
justifyContent: 'flex-start',
alignSelf: 'center',
paddingHorizontal: 10,
},
iconContainer: {
flex: 1,
flexDirection: 'row',
justifyContent: 'space-around',
alignSelf: 'center',
maxWidth: 300,
},
navItem: {
width: 30,
height: 30,
alignItems: 'center',
position: 'relative',
},
});
const customization = customize({
components: {
videoCall: {
topBar: TopBar,
},
},
});
export default customization;