@@ -3,24 +3,26 @@ import React, { useState, useCallback } from 'react';
3
3
import type { Node } from 'react' ;
4
4
import { View } from 'react-native' ;
5
5
6
+ import { Icon } from './Icons' ;
6
7
import Input from './Input' ;
7
8
import type { Props as InputProps } from './Input' ;
8
9
import { BRAND_COLOR , createStyleSheet } from '../styles' ;
9
- import ZulipTextIntl from './ZulipTextIntl' ;
10
10
import Touchable from './Touchable' ;
11
11
12
12
const styles = createStyleSheet ( {
13
13
showPasswordButton : {
14
- position : 'absolute' ,
15
- right : 0 ,
16
- top : 0 ,
17
- bottom : 0 ,
18
14
justifyContent : 'center' ,
19
15
} ,
20
- showPasswordButtonText : {
16
+ showPasswordButtonIcon : {
21
17
margin : 8 ,
22
18
color : BRAND_COLOR ,
23
19
} ,
20
+ passwordTextInput : {
21
+ flex : 1 ,
22
+ } ,
23
+ passwordInputView : {
24
+ flexDirection : 'row' ,
25
+ } ,
24
26
} ) ;
25
27
26
28
// Prettier wants a ", >" here, which is silly.
@@ -44,10 +46,16 @@ export default function PasswordInput(props: Props): Node {
44
46
} , [ ] ) ;
45
47
46
48
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
+ />
49
57
< Touchable style = { styles . showPasswordButton } onPress = { handleShow } >
50
- < ZulipTextIntl style = { styles . showPasswordButtonText } text = { isHidden ? 'show ' : 'hide' } />
58
+ < Icon name = { isHidden ? 'eye-off ' : 'eye' } size = { 24 } style = { styles . showPasswordButtonIcon } />
51
59
</ Touchable >
52
60
</ View >
53
61
) ;
0 commit comments