diff --git a/src/common/PasswordInput.js b/src/common/PasswordInput.js index 5c21ec21bb6..fa662f15116 100644 --- a/src/common/PasswordInput.js +++ b/src/common/PasswordInput.js @@ -1,25 +1,24 @@ /* @flow strict-local */ import React, { useState, useCallback } from 'react'; import type { Node } from 'react'; -import { View } from 'react-native'; +import { View, Pressable } from 'react-native'; +import { Icon } from './Icons'; import Input from './Input'; import type { Props as InputProps } from './Input'; -import { BRAND_COLOR, createStyleSheet } from '../styles'; -import ZulipTextIntl from './ZulipTextIntl'; -import Touchable from './Touchable'; +import { BRAND_COLOR, HIGHLIGHT_COLOR, createStyleSheet } from '../styles'; +import { TranslationContext } from '../boot/TranslationProvider'; const styles = createStyleSheet({ showPasswordButton: { - position: 'absolute', - right: 0, - top: 0, - bottom: 0, - justifyContent: 'center', + marginLeft: 8, }, - showPasswordButtonText: { - margin: 8, - color: BRAND_COLOR, + passwordTextInput: { + flex: 1, + }, + passwordInputView: { + flexDirection: 'row', + alignItems: 'center', }, }); @@ -37,6 +36,8 @@ type Props = $ReadOnly<$Diff(true); const handleShow = useCallback(() => { @@ -44,11 +45,32 @@ export default function PasswordInput(props: Props): Node { }, []); return ( - - - - - + + + + {({ pressed }) => ( + + )} + ); } diff --git a/static/translations/messages_en.json b/static/translations/messages_en.json index cee337d8a1f..2391a776353 100644 --- a/static/translations/messages_en.json +++ b/static/translations/messages_en.json @@ -1,4 +1,5 @@ { + "Show password": "Show password", "Quote and reply": "Quote and reply", "{username} [said]({link_to_message}):": "{username} [said]({link_to_message}):", "[Quoting…]": "[Quoting…]", @@ -279,7 +280,6 @@ "Stream settings": "Stream settings", "Failed to show stream settings": "Failed to show stream settings", "show": "show", - "hide": "hide", "Debug": "Debug", "Administrators": "Administrators", "Normal users": "Normal users",