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'
export default class EnterNewPassword extends Component {
constructor() {
super()
this.state = {
@@ -53,14 +52,11 @@ export default class EnterNewPassword extends Component {
}
render() {
const {
password,
passwordConfirmation,
shouldShowErrorMessage
} = this.state
const { password, passwordConfirmation, shouldShowErrorMessage } =
this.state
const labels = settings.passwordSettings
const isButtonActive =
(password.length > 0) && (passwordConfirmation.length > 0)
password.length > 0 && passwordConfirmation.length > 0
return (
<React.Fragment>
@@ -80,9 +76,9 @@ export default class EnterNewPassword extends Component {
value={passwordConfirmation}
secureTextEntry={true}
/>
{shouldShowErrorMessage &&
{shouldShowErrorMessage && (
<AppText style={styles.error}>{labels.passwordsDontMatch}</AppText>
}
)}
<Button isCTA={isButtonActive} onPress={this.savePassword}>
{labels.savePassword}
</Button>
@@ -94,6 +90,6 @@ export default class EnterNewPassword extends Component {
const styles = StyleSheet.create({
error: {
color: Colors.orange,
marginTop: Spacing.base
}
marginTop: Spacing.base,
},
})