You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

JitsiScreen.js 1.8KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. // @flow
  2. import React from 'react';
  3. import { View } from 'react-native';
  4. import { SafeAreaView } from 'react-native-safe-area-context';
  5. import { StyleType } from '../../styles';
  6. import JitsiKeyboardAvoidingView from './JitsiKeyboardAvoidingView';
  7. import styles from './styles';
  8. type Props = {
  9. /**
  10. * Additional style to be appended to the KeyboardAvoidingView content container.
  11. */
  12. contentContainerStyle?: StyleType,
  13. /**
  14. * The children component(s) of the Modal, to be rendered.
  15. */
  16. children: React$Node,
  17. /**
  18. * Optional function that renders a footer component, if needed.
  19. */
  20. footerComponent?: Function,
  21. /**
  22. * Is a text input rendered at the bottom of the screen?
  23. */
  24. hasBottomTextInput?: boolean,
  25. /**
  26. * Is the screen rendering a tab navigator?
  27. */
  28. hasTabNavigator?: boolean,
  29. /**
  30. * Additional style to be appended to the KeyboardAvoidingView containing the content of the modal.
  31. */
  32. style?: StyleType
  33. }
  34. const JitsiScreen = ({
  35. contentContainerStyle,
  36. children,
  37. footerComponent,
  38. hasTabNavigator = false,
  39. hasBottomTextInput = false,
  40. style
  41. }: Props) => (
  42. <View
  43. style = { styles.jitsiScreenContainer }>
  44. <JitsiKeyboardAvoidingView
  45. contentContainerStyle = { contentContainerStyle }
  46. hasBottomTextInput = { hasBottomTextInput }
  47. hasTabNavigator = { hasTabNavigator }
  48. style = { style }>
  49. <SafeAreaView
  50. edges = { [
  51. 'bottom',
  52. 'left',
  53. 'right'
  54. ] }
  55. style = { styles.safeArea }>
  56. { children }
  57. </SafeAreaView>
  58. { footerComponent && footerComponent() }
  59. </JitsiKeyboardAvoidingView>
  60. </View>
  61. );
  62. export default JitsiScreen;