@@ -3,24 +3,26 @@ import React, { useState, useCallback } from 'react';
33import type { Node } from 'react' ;
44import { View } from 'react-native' ;
55
6+ import Icon from 'react-native-vector-icons/Ionicons' ;
67import Input from './Input' ;
78import type { Props as InputProps } from './Input' ;
89import { BRAND_COLOR , createStyleSheet } from '../styles' ;
9- import ZulipTextIntl from './ZulipTextIntl' ;
1010import Touchable from './Touchable' ;
1111
1212const styles = createStyleSheet ( {
1313 showPasswordButton : {
14- position : 'absolute' ,
15- right : 0 ,
16- top : 0 ,
17- bottom : 0 ,
1814 justifyContent : 'center' ,
1915 } ,
20- showPasswordButtonText : {
16+ showPasswordButtonIcon : {
2117 margin : 8 ,
2218 color : BRAND_COLOR ,
2319 } ,
20+ passwordTextInput : {
21+ flex : 1 ,
22+ } ,
23+ passwordInputView : {
24+ flexDirection : 'row' ,
25+ } ,
2426} ) ;
2527
2628// Prettier wants a ", >" here, which is silly.
@@ -44,10 +46,16 @@ export default function PasswordInput(props: Props): Node {
4446 } , [ ] ) ;
4547
4648 return (
47- < View >
48- < Input { ...props } secureTextEntry = { isHidden } autoCorrect = { false } autoCapitalize = "none" />
49+ < View style = { styles . passwordInputView } >
50+ < Input
51+ { ...props }
52+ secureTextEntry = { isHidden }
53+ autoCorrect = { false }
54+ autoCapitalize = "none"
55+ style = { styles . passwordTextInput }
56+ />
4957 < Touchable style = { styles . showPasswordButton } onPress = { handleShow } >
50- < ZulipTextIntl style = { styles . showPasswordButtonText } text = { isHidden ? 'show ' : 'hide' } />
58+ < Icon name = { isHidden ? 'eye-off ' : 'eye' } size = { 20 } style = { styles . showPasswordButtonIcon } />
5159 </ Touchable >
5260 </ View >
5361 ) ;
0 commit comments