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.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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 the screen rendering a tab navigator?
  23. */
  24. hasTabNavigator: boolean,
  25. /**
  26. * Additional style to be appended to the KeyboardAvoidingView containing the content of the modal.
  27. */
  28. style?: StyleType
  29. }
  30. const JitsiScreen = ({
  31. contentContainerStyle,
  32. children,
  33. footerComponent,
  34. hasTabNavigator,
  35. style
  36. }: Props) => (
  37. <View
  38. style = { styles.jitsiScreenContainer }>
  39. <JitsiKeyboardAvoidingView
  40. contentContainerStyle = { contentContainerStyle }
  41. hasTabNavigator = { hasTabNavigator }
  42. style = { style }>
  43. <SafeAreaView
  44. edges = { [
  45. 'bottom',
  46. 'left',
  47. 'right'
  48. ] }
  49. style = { styles.safeArea }>
  50. { children }
  51. </SafeAreaView>
  52. { footerComponent && footerComponent() }
  53. </JitsiKeyboardAvoidingView>
  54. </View>
  55. );
  56. export default JitsiScreen;