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.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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. * Insets for the SafeAreaView.
  31. */
  32. safeAreaInsets?: Array,
  33. /**
  34. * Additional style to be appended to the KeyboardAvoidingView containing the content of the modal.
  35. */
  36. style?: StyleType
  37. }
  38. const JitsiScreen = ({
  39. contentContainerStyle,
  40. children,
  41. footerComponent,
  42. hasTabNavigator = false,
  43. hasBottomTextInput = false,
  44. safeAreaInsets = [ 'left', 'right' ],
  45. style
  46. }: Props) => (
  47. <View
  48. style = { styles.jitsiScreenContainer }>
  49. <JitsiKeyboardAvoidingView
  50. contentContainerStyle = { contentContainerStyle }
  51. hasBottomTextInput = { hasBottomTextInput }
  52. hasTabNavigator = { hasTabNavigator }
  53. style = { style }>
  54. <SafeAreaView
  55. edges = { safeAreaInsets }
  56. style = { styles.safeArea }>
  57. {children}
  58. </SafeAreaView>
  59. {footerComponent && footerComponent()}
  60. </JitsiKeyboardAvoidingView>
  61. </View>
  62. );
  63. export default JitsiScreen;