Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions app/presentation/KeyboardView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import scrollPersistTaps from '../utils/scrollPersistTaps';

interface IKeyboardViewProps extends KeyboardAwareScrollViewProps {
keyboardVerticalOffset: number;
scrollEnabled?: boolean;
children: React.ReactNode;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -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<any, 'E2EEnterYourPasswordView'>;
}

class E2EEnterYourPasswordView extends React.Component<IE2EEnterYourPasswordViewProps, IE2EEnterYourPasswordViewState> {
private passwordInput?: TextInput;

static navigationOptions = ({ navigation }: Pick<IE2EEnterYourPasswordViewProps, 'navigation'>): StackNavigationOptions => ({
headerLeft: () => <HeaderButton.CloseModal navigation={navigation} testID='e2e-enter-your-password-view-close' />,
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: ''
Expand All @@ -65,12 +74,12 @@ class E2EEnterYourPasswordView extends React.Component {
<ScrollView
{...scrollPersistTaps}
style={sharedStyles.container}
contentContainerStyle={[sharedStyles.containerScrollView, styles.scrollView]}>
contentContainerStyle={sharedStyles.containerScrollView}>
<SafeAreaView
style={[styles.container, { backgroundColor: themes[theme].backgroundColor }]}
testID='e2e-enter-your-password-view'>
<TextInput
inputRef={e => {
inputRef={(e: TextInput) => {
this.passwordInput = e;
}}
placeholder={I18n.t('Password')}
Expand Down Expand Up @@ -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));