Prettify enter-new-password

This commit is contained in:
Sofiya Tepikin
2022-08-08 12:37:20 +02:00
parent aff1e2735f
commit 10f731525b
@@ -13,7 +13,6 @@ import settings from '../../../i18n/en/settings'
const LISTENER_TYPE = 'create-or-change-pw' const LISTENER_TYPE = 'create-or-change-pw'
export default class EnterNewPassword extends Component { export default class EnterNewPassword extends Component {
constructor() { constructor() {
super() super()
this.state = { this.state = {
@@ -52,15 +51,12 @@ export default class EnterNewPassword extends Component {
this.setState({ passwordConfirmation }) this.setState({ passwordConfirmation })
} }
render () { render() {
const { const { password, passwordConfirmation, shouldShowErrorMessage } =
password, this.state
passwordConfirmation,
shouldShowErrorMessage
} = this.state
const labels = settings.passwordSettings const labels = settings.passwordSettings
const isButtonActive = const isButtonActive =
(password.length > 0) && (passwordConfirmation.length > 0) password.length > 0 && passwordConfirmation.length > 0
return ( return (
<React.Fragment> <React.Fragment>
@@ -80,9 +76,9 @@ export default class EnterNewPassword extends Component {
value={passwordConfirmation} value={passwordConfirmation}
secureTextEntry={true} secureTextEntry={true}
/> />
{shouldShowErrorMessage && {shouldShowErrorMessage && (
<AppText style={styles.error}>{labels.passwordsDontMatch}</AppText> <AppText style={styles.error}>{labels.passwordsDontMatch}</AppText>
} )}
<Button isCTA={isButtonActive} onPress={this.savePassword}> <Button isCTA={isButtonActive} onPress={this.savePassword}>
{labels.savePassword} {labels.savePassword}
</Button> </Button>
@@ -94,6 +90,6 @@ export default class EnterNewPassword extends Component {
const styles = StyleSheet.create({ const styles = StyleSheet.create({
error: { error: {
color: Colors.orange, color: Colors.orange,
marginTop: Spacing.base marginTop: Spacing.base,
} },
}) })