diff --git a/app/presentation/KeyboardView.tsx b/app/presentation/KeyboardView.tsx index 572b9eaf..5319df82 100644 --- a/app/presentation/KeyboardView.tsx +++ b/app/presentation/KeyboardView.tsx @@ -5,6 +5,7 @@ import scrollPersistTaps from '../utils/scrollPersistTaps'; interface IKeyboardViewProps extends KeyboardAwareScrollViewProps { keyboardVerticalOffset: number; + scrollEnabled?: boolean; children: React.ReactNode; } diff --git a/app/views/E2EEnterYourPasswordView.js b/app/views/E2EEnterYourPasswordView.tsx similarity index 75% rename from app/views/E2EEnterYourPasswordView.js rename to app/views/E2EEnterYourPasswordView.tsx index ebf5a890..dd9cdfa8 100644 --- a/app/views/E2EEnterYourPasswordView.js +++ b/app/views/E2EEnterYourPasswordView.tsx @@ -1,7 +1,8 @@ import React from 'react'; -import PropTypes from 'prop-types'; import { ScrollView, StyleSheet, Text } from 'react-native'; import { connect } from 'react-redux'; +import { Dispatch } from 'redux'; +import { StackNavigationOptions, StackNavigationProp } from '@react-navigation/stack'; import I18n from '../i18n'; import { withTheme } from '../theme'; @@ -27,18 +28,26 @@ const styles = StyleSheet.create({ ...sharedStyles.textRegular } }); -class E2EEnterYourPasswordView extends React.Component { - static navigationOptions = ({ navigation }) => ({ + +interface IE2EEnterYourPasswordViewState { + password: string; +} + +interface IE2EEnterYourPasswordViewProps { + encryptionDecodeKey: (password: string) => void; + theme: string; + navigation: StackNavigationProp; +} + +class E2EEnterYourPasswordView extends React.Component { + private passwordInput?: TextInput; + + static navigationOptions = ({ navigation }: Pick): StackNavigationOptions => ({ headerLeft: () => , title: I18n.t('Enter_Your_E2E_Password') }); - static propTypes = { - encryptionDecodeKey: PropTypes.func, - theme: PropTypes.string - }; - - constructor(props) { + constructor(props: IE2EEnterYourPasswordViewProps) { super(props); this.state = { password: '' @@ -65,12 +74,12 @@ class E2EEnterYourPasswordView extends React.Component { + contentContainerStyle={sharedStyles.containerScrollView}> { + inputRef={(e: TextInput) => { this.passwordInput = e; }} placeholder={I18n.t('Password')} @@ -99,7 +108,7 @@ class E2EEnterYourPasswordView extends React.Component { } } -const mapDispatchToProps = dispatch => ({ - encryptionDecodeKey: password => dispatch(encryptionDecodeKeyAction(password)) +const mapDispatchToProps = (dispatch: Dispatch) => ({ + encryptionDecodeKey: (password: string) => dispatch(encryptionDecodeKeyAction(password)) }); export default connect(null, mapDispatchToProps)(withTheme(E2EEnterYourPasswordView));