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.

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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. * Disabled forced keyboard dismiss?
  19. */
  20. disableForcedKeyboardDismiss?: boolean,
  21. /**
  22. * Optional function that renders a footer component, if needed.
  23. */
  24. footerComponent?: Function,
  25. /**
  26. * Is a text input rendered at the bottom of the screen?
  27. */
  28. hasBottomTextInput?: boolean,
  29. /**
  30. * Is the screen rendering a tab navigator?
  31. */
  32. hasTabNavigator?: boolean,
  33. /**
  34. * Insets for the SafeAreaView.
  35. */
  36. safeAreaInsets?: Array,
  37. /**
  38. * Additional style to be appended to the KeyboardAvoidingView containing the content of the modal.
  39. */
  40. style?: StyleType
  41. }
  42. const JitsiScreen = ({
  43. contentContainerStyle,
  44. children,
  45. footerComponent,
  46. hasTabNavigator = false,
  47. hasBottomTextInput = false,
  48. disableForcedKeyboardDismiss = false,
  49. safeAreaInsets = [ 'left', 'right' ],
  50. style
  51. }: Props) => (
  52. <View
  53. style = { styles.jitsiScreenContainer }>
  54. <JitsiKeyboardAvoidingView
  55. contentContainerStyle = { contentContainerStyle }
  56. disableForcedKeyboardDismiss = { disableForcedKeyboardDismiss }
  57. hasBottomTextInput = { hasBottomTextInput }
  58. hasTabNavigator = { hasTabNavigator }
  59. style = { style }>
  60. <SafeAreaView
  61. edges = { safeAreaInsets }
  62. style = { styles.safeArea }>
  63. {children}
  64. </SafeAreaView>
  65. { footerComponent && footerComponent() }
  66. </JitsiKeyboardAvoidingView>
  67. </View>
  68. );
  69. export default JitsiScreen;