feat(base/modal): renamed prop and fixed scroll inside webview

This commit is contained in:
Calin-Teodor 2022-08-01 12:16:13 +03:00 committed by Calinteodor
parent 727b6dab9e
commit ccba7e8f75
4 changed files with 16 additions and 15 deletions

View File

@ -24,6 +24,11 @@ type Props = {
*/ */
contentContainerStyle?: StyleType, contentContainerStyle?: StyleType,
/**
* Disable forced keyboard dismiss?
*/
disableForcedKeyboardDismiss?: boolean,
/** /**
* Is a text input rendered at the bottom of the screen? * Is a text input rendered at the bottom of the screen?
*/ */
@ -34,11 +39,6 @@ type Props = {
*/ */
hasTabNavigator: boolean, hasTabNavigator: boolean,
/**
* Is the keyboard already dismissible?
*/
keyboardAlreadyDismissible?: boolean,
/** /**
* Additional style to be appended to the KeyboardAvoidingView. * Additional style to be appended to the KeyboardAvoidingView.
*/ */
@ -51,7 +51,7 @@ const JitsiKeyboardAvoidingView = (
contentContainerStyle, contentContainerStyle,
hasTabNavigator, hasTabNavigator,
hasBottomTextInput, hasBottomTextInput,
keyboardAlreadyDismissible, disableForcedKeyboardDismiss,
style style
}: Props) => { }: Props) => {
const headerHeight = useHeaderHeight(); const headerHeight = useHeaderHeight();
@ -74,7 +74,7 @@ const JitsiKeyboardAvoidingView = (
? headerHeight + StatusBar.currentHeight : headerHeight; ? headerHeight + StatusBar.currentHeight : headerHeight;
// Tells the view what to do with taps // Tells the view what to do with taps
const shouldSetResponse = useCallback(() => !keyboardAlreadyDismissible); const shouldSetResponse = useCallback(() => !disableForcedKeyboardDismiss);
const onRelease = useCallback(() => Keyboard.dismiss()); const onRelease = useCallback(() => Keyboard.dismiss());
return ( return (

View File

@ -22,6 +22,11 @@ type Props = {
*/ */
children: React$Node, children: React$Node,
/**
* Disabled forced keyboard dismiss?
*/
disableForcedKeyboardDismiss?: boolean,
/** /**
* Optional function that renders a footer component, if needed. * Optional function that renders a footer component, if needed.
*/ */
@ -37,11 +42,6 @@ type Props = {
*/ */
hasTabNavigator?: boolean, hasTabNavigator?: boolean,
/**
* Is the keyboard already dismissible?
*/
keyboardAlreadyDismissible?: boolean,
/** /**
* Insets for the SafeAreaView. * Insets for the SafeAreaView.
*/ */
@ -59,7 +59,7 @@ const JitsiScreen = ({
footerComponent, footerComponent,
hasTabNavigator = false, hasTabNavigator = false,
hasBottomTextInput = false, hasBottomTextInput = false,
keyboardAlreadyDismissible = false, disableForcedKeyboardDismiss = false,
safeAreaInsets = [ 'left', 'right' ], safeAreaInsets = [ 'left', 'right' ],
style style
}: Props) => ( }: Props) => (
@ -67,9 +67,9 @@ const JitsiScreen = ({
style = { styles.jitsiScreenContainer }> style = { styles.jitsiScreenContainer }>
<JitsiKeyboardAvoidingView <JitsiKeyboardAvoidingView
contentContainerStyle = { contentContainerStyle } contentContainerStyle = { contentContainerStyle }
disableForcedKeyboardDismiss = { disableForcedKeyboardDismiss }
hasBottomTextInput = { hasBottomTextInput } hasBottomTextInput = { hasBottomTextInput }
hasTabNavigator = { hasTabNavigator } hasTabNavigator = { hasTabNavigator }
keyboardAlreadyDismissible = { keyboardAlreadyDismissible }
style = { style }> style = { style }>
<SafeAreaView <SafeAreaView
edges = { safeAreaInsets } edges = { safeAreaInsets }

View File

@ -20,6 +20,7 @@ type Props = {
const JitsiScreenWebView = ({ source, style }: Props) => ( const JitsiScreenWebView = ({ source, style }: Props) => (
<JitsiScreen <JitsiScreen
disableForcedKeyboardDismiss = { true }
style = { style }> style = { style }>
<WebView source = {{ uri: source }} /> <WebView source = {{ uri: source }} />
</JitsiScreen> </JitsiScreen>

View File

@ -53,9 +53,9 @@ class Chat extends AbstractChat<Props> {
return ( return (
<JitsiScreen <JitsiScreen
disableForcedKeyboardDismiss = { true }
hasBottomTextInput = { true } hasBottomTextInput = { true }
hasTabNavigator = { true } hasTabNavigator = { true }
keyboardAlreadyDismissible = { true }
style = { styles.chatContainer }> style = { styles.chatContainer }>
<MessageContainer messages = { _messages } /> <MessageContainer messages = { _messages } />
<MessageRecipient privateMessageRecipient = { privateMessageRecipient } /> <MessageRecipient privateMessageRecipient = { privateMessageRecipient } />