-
Notifications
You must be signed in to change notification settings - Fork 18
/
OutgoingCallControls.tsx
52 lines (49 loc) · 1.31 KB
/
OutgoingCallControls.tsx
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
import React from 'react';
import { StyleSheet, View } from 'react-native';
import { useTheme } from '../../../contexts';
import { HangUpCallButton } from './HangupCallButton';
import { ToggleAudioPreviewButton } from './ToggleAudioPreviewButton';
import { ToggleVideoPreviewButton } from './ToggleVideoPreviewButton';
/**
* Props for the OutgoingCallControls Component.
*/
export type OutgoingCallControlsProps = {
/**
* Handler to be executed when the outgoing call is cancelled or hanged up.
*/
onHangupCallHandler?: () => void;
};
export const OutgoingCallControls = ({
onHangupCallHandler,
}: OutgoingCallControlsProps) => {
const {
theme: {
outgoingCall,
variants: { buttonSizes },
},
} = useTheme();
return (
<View style={[styles.buttonGroup, outgoingCall.buttonGroup]}>
<View
style={[styles.deviceControlButtons, outgoingCall.deviceControlButtons]}
>
<ToggleAudioPreviewButton />
<ToggleVideoPreviewButton />
</View>
<HangUpCallButton
onPressHandler={onHangupCallHandler}
size={buttonSizes.md}
/>
</View>
);
};
const styles = StyleSheet.create({
buttonGroup: {
alignItems: 'center',
},
deviceControlButtons: {
width: '100%',
flexDirection: 'row',
justifyContent: 'space-evenly',
},
});