chore: evaluate `LoginView` (#4098)

This commit is contained in:
Gerzon Z 2022-05-03 12:05:01 -04:00 committed by GitHub
parent 99409d1af4
commit 784b016736
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 4 deletions

View File

@ -1,6 +1,6 @@
import { dequal } from 'dequal'; import { dequal } from 'dequal';
import React from 'react'; import React from 'react';
import { Alert, Keyboard, StyleSheet, Text, View } from 'react-native'; import { Alert, Keyboard, StyleSheet, Text, View, TextInput as RNTextInput } from 'react-native';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import { loginRequest } from '../actions/login'; import { loginRequest } from '../actions/login';
@ -64,8 +64,13 @@ interface ILoginViewProps extends IBaseScreen<OutsideParamList, 'LoginView'> {
inviteLinkToken: string; inviteLinkToken: string;
} }
class LoginView extends React.Component<ILoginViewProps, any> { interface ILoginViewState {
private passwordInput: any; user: string;
password: string;
}
class LoginView extends React.Component<ILoginViewProps, ILoginViewState> {
private passwordInput: RNTextInput | null | undefined;
static navigationOptions = ({ route, navigation }: ILoginViewProps) => ({ static navigationOptions = ({ route, navigation }: ILoginViewProps) => ({
title: route?.params?.title ?? 'Rocket.Chat', title: route?.params?.title ?? 'Rocket.Chat',
@ -160,7 +165,7 @@ class LoginView extends React.Component<ILoginViewProps, any> {
returnKeyType='next' returnKeyType='next'
onChangeText={(value: string) => this.setState({ user: value })} onChangeText={(value: string) => this.setState({ user: value })}
onSubmitEditing={() => { onSubmitEditing={() => {
this.passwordInput.focus(); this.passwordInput?.focus();
}} }}
testID='login-view-email' testID='login-view-email'
textContentType='username' textContentType='username'