Prettify enter-new-password
This commit is contained in:
@@ -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 = {
|
||||
@@ -52,15 +51,12 @@ export default class EnterNewPassword extends Component {
|
||||
this.setState({ passwordConfirmation })
|
||||
}
|
||||
|
||||
render () {
|
||||
const {
|
||||
password,
|
||||
passwordConfirmation,
|
||||
shouldShowErrorMessage
|
||||
} = this.state
|
||||
render() {
|
||||
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,
|
||||
},
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user