File tree 2 files changed +7
-0
lines changed
2 files changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ import { Icon } from './Icons';
7
7
import Input from './Input' ;
8
8
import type { Props as InputProps } from './Input' ;
9
9
import { BRAND_COLOR , HIGHLIGHT_COLOR , createStyleSheet } from '../styles' ;
10
+ import { TranslationContext } from '../boot/TranslationProvider' ;
10
11
11
12
const styles = createStyleSheet ( {
12
13
showPasswordButton : {
@@ -35,6 +36,8 @@ type Props = $ReadOnly<$Diff<InputProps,
35
36
* All props are passed through to `Input`. See `Input` for descriptions.
36
37
*/
37
38
export default function PasswordInput ( props : Props ) : Node {
39
+ const _ = React . useContext ( TranslationContext ) ;
40
+
38
41
const [ isHidden , setIsHidden ] = useState < boolean > ( true ) ;
39
42
40
43
const handleShow = useCallback ( ( ) => {
@@ -56,6 +59,9 @@ export default function PasswordInput(props: Props): Node {
56
59
hitSlop = { 12 }
57
60
style = { styles . showPasswordButton }
58
61
onPress = { handleShow }
62
+ accessibilityLabel = { _ ( 'Show password' ) }
63
+ accessibilityRole = "switch"
64
+ accessibilityState = { { checked : ! isHidden } }
59
65
>
60
66
{ ( { pressed } ) => (
61
67
< Icon
Original file line number Diff line number Diff line change 1
1
{
2
+ "Show password" : " Show password" ,
2
3
"Quote and reply" : " Quote and reply" ,
3
4
"{username} [said]({link_to_message}):" : " {username} [said]({link_to_message}):" ,
4
5
"[Quoting…]" : " [Quoting…]" ,
You can’t perform that action at this time.
0 commit comments