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

JitsiScreen.js 2.3KB

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