2021-10-20 19:29:21 +00:00
|
|
|
// @flow
|
|
|
|
|
|
|
|
import React from 'react';
|
|
|
|
import { View } from 'react-native';
|
|
|
|
import { SafeAreaView } from 'react-native-safe-area-context';
|
|
|
|
|
|
|
|
import { StyleType } from '../../styles';
|
|
|
|
|
|
|
|
import JitsiKeyboardAvoidingView from './JitsiKeyboardAvoidingView';
|
|
|
|
import styles from './styles';
|
|
|
|
|
|
|
|
|
|
|
|
type Props = {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Additional style to be appended to the KeyboardAvoidingView content container.
|
|
|
|
*/
|
|
|
|
contentContainerStyle?: StyleType,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The children component(s) of the Modal, to be rendered.
|
|
|
|
*/
|
|
|
|
children: React$Node,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Optional function that renders a footer component, if needed.
|
|
|
|
*/
|
|
|
|
footerComponent?: Function,
|
|
|
|
|
2021-12-08 14:35:20 +00:00
|
|
|
/**
|
|
|
|
* Is a text input rendered at the bottom of the screen?
|
|
|
|
*/
|
|
|
|
hasBottomTextInput?: boolean,
|
|
|
|
|
2021-10-20 19:29:21 +00:00
|
|
|
/**
|
|
|
|
* Is the screen rendering a tab navigator?
|
|
|
|
*/
|
2021-11-11 14:32:56 +00:00
|
|
|
hasTabNavigator?: boolean,
|
2021-10-20 19:29:21 +00:00
|
|
|
|
2022-06-16 09:49:53 +00:00
|
|
|
/**
|
|
|
|
* Is the screen presented as a modal?
|
|
|
|
*/
|
|
|
|
isModalPresentation?: boolean,
|
|
|
|
|
2022-04-26 10:15:31 +00:00
|
|
|
/**
|
|
|
|
* Insets for the SafeAreaView.
|
|
|
|
*/
|
|
|
|
safeAreaInsets?: Array,
|
|
|
|
|
2021-10-20 19:29:21 +00:00
|
|
|
/**
|
|
|
|
* Additional style to be appended to the KeyboardAvoidingView containing the content of the modal.
|
|
|
|
*/
|
|
|
|
style?: StyleType
|
|
|
|
}
|
|
|
|
|
|
|
|
const JitsiScreen = ({
|
|
|
|
contentContainerStyle,
|
|
|
|
children,
|
|
|
|
footerComponent,
|
2021-11-11 14:32:56 +00:00
|
|
|
hasTabNavigator = false,
|
2021-12-08 14:35:20 +00:00
|
|
|
hasBottomTextInput = false,
|
2022-06-16 09:49:53 +00:00
|
|
|
isModalPresentation = true,
|
|
|
|
safeAreaInsets = [ 'left', 'right' ],
|
2021-10-20 19:29:21 +00:00
|
|
|
style
|
|
|
|
}: Props) => (
|
|
|
|
<View
|
|
|
|
style = { styles.jitsiScreenContainer }>
|
|
|
|
<JitsiKeyboardAvoidingView
|
|
|
|
contentContainerStyle = { contentContainerStyle }
|
2021-12-08 14:35:20 +00:00
|
|
|
hasBottomTextInput = { hasBottomTextInput }
|
2021-10-20 19:29:21 +00:00
|
|
|
hasTabNavigator = { hasTabNavigator }
|
2022-06-16 09:49:53 +00:00
|
|
|
isModalPresentation = { isModalPresentation }
|
2021-10-20 19:29:21 +00:00
|
|
|
style = { style }>
|
|
|
|
<SafeAreaView
|
2022-04-26 10:15:31 +00:00
|
|
|
edges = { safeAreaInsets }
|
2021-10-20 19:29:21 +00:00
|
|
|
style = { styles.safeArea }>
|
2022-06-21 14:16:38 +00:00
|
|
|
{children}
|
2021-10-20 19:29:21 +00:00
|
|
|
</SafeAreaView>
|
2022-06-21 14:16:38 +00:00
|
|
|
{footerComponent && footerComponent()}
|
2021-10-20 19:29:21 +00:00
|
|
|
</JitsiKeyboardAvoidingView>
|
|
|
|
</View>
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
export default JitsiScreen;
|