From a9225280a93121c1d56fb68ed9365c61f93fa3aa Mon Sep 17 00:00:00 2001 From: abhishek71994 Date: Fri, 30 Mar 2018 10:53:57 +0530 Subject: [PATCH] password show/hide feature --- app/views/LoginView.js | 29 +++---- app/views/Styles.js | 10 +++ package-lock.json | 172 +++++++++-------------------------------- 3 files changed, 64 insertions(+), 147 deletions(-) diff --git a/app/views/LoginView.js b/app/views/LoginView.js index d1647cff..6aa06772 100644 --- a/app/views/LoginView.js +++ b/app/views/LoginView.js @@ -65,6 +65,7 @@ export default class LoginView extends React.Component { username: '', password: '', modalVisible: false, + showPassword: false, oAuthUrl: '' }; this.redirectRegex = new RegExp(`(?=.*(${ this.props.server }))(?=.*(credentialToken))(?=.*(credentialSecret))`, 'g'); @@ -238,19 +239,21 @@ export default class LoginView extends React.Component { onSubmitEditing={() => { this.password.focus(); }} placeholder={this.props.Accounts_EmailOrUsernamePlaceholder || 'Email or username'} /> - { this.password = e; }} - style={styles.input_white} - onChangeText={password => this.setState({ password })} - secureTextEntry - autoCorrect={false} - returnKeyType='done' - autoCapitalize='none' - underlineColorAndroid='transparent' - onSubmitEditing={this.submit} - placeholder={this.props.Accounts_PasswordPlaceholder || 'Password'} - /> - + + { this.password = e; }} + style={styles.input_white} + onChangeText={password => this.setState({ password })} + secureTextEntry={!this.state.showPassword} + autoCorrect={false} + returnKeyType='done' + autoCapitalize='none' + underlineColorAndroid='transparent' + onSubmitEditing={this.submit} + placeholder={this.props.Accounts_PasswordPlaceholder || 'Password'} + /> + { this.setState({ showPassword: !this.state.showPassword }); }}/> + {this.renderTOTP()}