Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

JitsiScreen.js 2.2KB

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