File tree Expand file tree Collapse file tree 2 files changed +7
-0
lines changed Expand file tree Collapse file tree 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';
77import Input from './Input' ;
88import type { Props as InputProps } from './Input' ;
99import { BRAND_COLOR , HIGHLIGHT_COLOR , createStyleSheet } from '../styles' ;
10+ import { TranslationContext } from '../boot/TranslationProvider' ;
1011
1112const styles = createStyleSheet ( {
1213 showPasswordButton : {
@@ -35,6 +36,8 @@ type Props = $ReadOnly<$Diff<InputProps,
3536 * All props are passed through to `Input`. See `Input` for descriptions.
3637 */
3738export default function PasswordInput ( props : Props ) : Node {
39+ const _ = React . useContext ( TranslationContext ) ;
40+
3841 const [ isHidden , setIsHidden ] = useState < boolean > ( true ) ;
3942
4043 const handleShow = useCallback ( ( ) => {
@@ -56,6 +59,9 @@ export default function PasswordInput(props: Props): Node {
5659 hitSlop = { 12 }
5760 style = { styles . showPasswordButton }
5861 onPress = { handleShow }
62+ accessibilityLabel = { _ ( 'Show password' ) }
63+ accessibilityRole = "switch"
64+ accessibilityState = { { checked : ! isHidden } }
5965 >
6066 { ( { pressed } ) => (
6167 < Icon
Original file line number Diff line number Diff line change 11{
2+ "Show password" : " Show password" ,
23 "Quote and reply" : " Quote and reply" ,
34 "{username} [said]({link_to_message}):" : " {username} [said]({link_to_message}):" ,
45 "[Quoting…]" : " [Quoting…]" ,
You can’t perform that action at this time.
0 commit comments