diff --git a/app/containers/FormContainer.tsx b/app/containers/FormContainer.tsx index 3cdf0de7f..ae73db6ed 100644 --- a/app/containers/FormContainer.tsx +++ b/app/containers/FormContainer.tsx @@ -4,7 +4,7 @@ import { ScrollView, ScrollViewProps, StyleSheet, View } from 'react-native'; import { themes } from '../lib/constants'; import sharedStyles from '../views/Styles'; import scrollPersistTaps from '../utils/scrollPersistTaps'; -import KeyboardView from '../presentation/KeyboardView'; +import KeyboardView from './KeyboardView'; import { useTheme } from '../theme'; import StatusBar from './StatusBar'; import AppVersion from './AppVersion'; diff --git a/app/containers/KeyboardView.tsx b/app/containers/KeyboardView.tsx new file mode 100644 index 000000000..894b8fb5e --- /dev/null +++ b/app/containers/KeyboardView.tsx @@ -0,0 +1,24 @@ +import React from 'react'; +import { KeyboardAwareScrollView, KeyboardAwareScrollViewProps } from '@codler/react-native-keyboard-aware-scroll-view'; + +import scrollPersistTaps from '../utils/scrollPersistTaps'; + +interface IKeyboardViewProps extends KeyboardAwareScrollViewProps { + keyboardVerticalOffset?: number; + scrollEnabled?: boolean; + children: React.ReactElement[] | React.ReactElement; +} + +const KeyboardView = ({ style, contentContainerStyle, scrollEnabled, keyboardVerticalOffset, children }: IKeyboardViewProps) => ( + + {children} + +); + +export default KeyboardView; diff --git a/app/presentation/KeyboardView.tsx b/app/presentation/KeyboardView.tsx deleted file mode 100644 index aa4f1182d..000000000 --- a/app/presentation/KeyboardView.tsx +++ /dev/null @@ -1,28 +0,0 @@ -import React from 'react'; -import { KeyboardAwareScrollView, KeyboardAwareScrollViewProps } from '@codler/react-native-keyboard-aware-scroll-view'; - -import scrollPersistTaps from '../utils/scrollPersistTaps'; - -interface IKeyboardViewProps extends KeyboardAwareScrollViewProps { - keyboardVerticalOffset?: number; - scrollEnabled?: boolean; - children: React.ReactNode; -} - -export default class KeyboardView extends React.PureComponent { - render() { - const { style, contentContainerStyle, scrollEnabled, keyboardVerticalOffset, children } = this.props; - - return ( - - {children} - - ); - } -} diff --git a/app/views/CreateChannelView.tsx b/app/views/CreateChannelView.tsx index c99ec91fe..a0b33abbb 100644 --- a/app/views/CreateChannelView.tsx +++ b/app/views/CreateChannelView.tsx @@ -8,7 +8,7 @@ import TextInput from '../presentation/TextInput'; import Loading from '../containers/Loading'; import { createChannelRequest } from '../actions/createChannel'; import { removeUser } from '../actions/selectedUsers'; -import KeyboardView from '../presentation/KeyboardView'; +import KeyboardView from '../containers/KeyboardView'; import scrollPersistTaps from '../utils/scrollPersistTaps'; import I18n from '../i18n'; import UserItem from '../containers/UserItem'; diff --git a/app/views/CreateDiscussionView/index.tsx b/app/views/CreateDiscussionView/index.tsx index 2810daaa2..11bb8e6cb 100644 --- a/app/views/CreateDiscussionView/index.tsx +++ b/app/views/CreateDiscussionView/index.tsx @@ -4,7 +4,7 @@ import { ScrollView, Switch, Text } from 'react-native'; import { StackNavigationOptions } from '@react-navigation/stack'; import Loading from '../../containers/Loading'; -import KeyboardView from '../../presentation/KeyboardView'; +import KeyboardView from '../../containers/KeyboardView'; import scrollPersistTaps from '../../utils/scrollPersistTaps'; import I18n from '../../i18n'; import * as HeaderButton from '../../containers/HeaderButton'; diff --git a/app/views/E2EEnterYourPasswordView.tsx b/app/views/E2EEnterYourPasswordView.tsx index 0486247ca..bef50cafe 100644 --- a/app/views/E2EEnterYourPasswordView.tsx +++ b/app/views/E2EEnterYourPasswordView.tsx @@ -12,7 +12,7 @@ import StatusBar from '../containers/StatusBar'; import TextInput from '../containers/TextInput'; import { IBaseScreen } from '../definitions'; import I18n from '../i18n'; -import KeyboardView from '../presentation/KeyboardView'; +import KeyboardView from '../containers/KeyboardView'; import { E2EEnterYourPasswordStackParamList } from '../stacks/types'; import { withTheme } from '../theme'; import { events, logEvent } from '../utils/log'; diff --git a/app/views/LivechatEditView.tsx b/app/views/LivechatEditView.tsx index 692065d53..31f186b4d 100644 --- a/app/views/LivechatEditView.tsx +++ b/app/views/LivechatEditView.tsx @@ -8,7 +8,7 @@ import { BLOCK_CONTEXT } from '@rocket.chat/ui-kit'; import { TSupportedThemes, withTheme } from '../theme'; import { themes } from '../lib/constants'; import TextInput from '../containers/TextInput'; -import KeyboardView from '../presentation/KeyboardView'; +import KeyboardView from '../containers/KeyboardView'; import RocketChat from '../lib/rocketchat'; import I18n from '../i18n'; import { LISTENER } from '../containers/Toast'; diff --git a/app/views/ProfileView/index.tsx b/app/views/ProfileView/index.tsx index 91a82d9ef..6c5552f5e 100644 --- a/app/views/ProfileView/index.tsx +++ b/app/views/ProfileView/index.tsx @@ -10,7 +10,7 @@ import omit from 'lodash/omit'; import { StackNavigationOptions } from '@react-navigation/stack'; import Touch from '../../utils/touch'; -import KeyboardView from '../../presentation/KeyboardView'; +import KeyboardView from '../../containers/KeyboardView'; import sharedStyles from '../Styles'; import scrollPersistTaps from '../../utils/scrollPersistTaps'; import { showConfirmationAlert, showErrorAlert } from '../../utils/info'; diff --git a/app/views/RoomInfoEditView/index.tsx b/app/views/RoomInfoEditView/index.tsx index 8c451672c..5b1e499a7 100644 --- a/app/views/RoomInfoEditView/index.tsx +++ b/app/views/RoomInfoEditView/index.tsx @@ -22,7 +22,7 @@ import I18n from '../../i18n'; import database from '../../lib/database'; import { CustomIcon } from '../../lib/Icons'; import RocketChat from '../../lib/rocketchat'; -import KeyboardView from '../../presentation/KeyboardView'; +import KeyboardView from '../../containers/KeyboardView'; import { TSupportedPermissions } from '../../reducers/permissions'; import { ModalStackParamList } from '../../stacks/MasterDetailStack/types'; import { ChatsStackParamList } from '../../stacks/types'; diff --git a/app/views/SetUsernameView.tsx b/app/views/SetUsernameView.tsx index a7c27a283..479e755ed 100644 --- a/app/views/SetUsernameView.tsx +++ b/app/views/SetUsernameView.tsx @@ -15,7 +15,7 @@ import TextInput from '../containers/TextInput'; import { IApplicationState } from '../definitions'; import I18n from '../i18n'; import RocketChat from '../lib/rocketchat'; -import KeyboardView from '../presentation/KeyboardView'; +import KeyboardView from '../containers/KeyboardView'; import { getUserSelector } from '../selectors/login'; import { TSupportedThemes, withTheme } from '../theme'; import { isTablet } from '../utils/deviceInfo';