fix: make validity error match design
This commit is contained in:
parent
12bdec6b39
commit
398a6b2fc0
|
@ -214,8 +214,7 @@ QtObject {
|
|||
//% "You need to repeat your password"
|
||||
return [false, qsTrId("you-need-to-repeat-your-password")];
|
||||
} else if (repeatPasswordField.text !== firstPasswordField.text) {
|
||||
//% Both passwords must match
|
||||
return [true, qsTrId("both-passwords-must-match")];
|
||||
return [false, qsTr("Passwords don't match")];
|
||||
}
|
||||
return [true, ""];
|
||||
|
||||
|
|
|
@ -31,7 +31,6 @@ ModalPopup {
|
|||
//% "New password..."
|
||||
placeholderText: qsTrId("new-password...")
|
||||
textField.echoMode: TextInput.Password
|
||||
validationError: popup.passwordValidationError
|
||||
onTextChanged: {
|
||||
[firstPasswordFieldValid, passwordValidationError] =
|
||||
Utils.validatePasswords("first", firstPasswordField, repeatPasswordField);
|
||||
|
@ -50,7 +49,6 @@ ModalPopup {
|
|||
//% "Confirm password…"
|
||||
placeholderText: qsTrId("confirm-password…")
|
||||
textField.echoMode: TextInput.Password
|
||||
validationError: popup.repeatPasswordValidationError
|
||||
Keys.onReturnPressed: {
|
||||
submitBtn.clicked()
|
||||
}
|
||||
|
@ -60,6 +58,24 @@ ModalPopup {
|
|||
}
|
||||
}
|
||||
|
||||
StyledText {
|
||||
id: validationError
|
||||
text: {
|
||||
if (passwordValidationError !== "") return passwordValidationError;
|
||||
if (repeatPasswordValidationError !== "") return repeatPasswordValidationError;
|
||||
return "";
|
||||
}
|
||||
anchors.top: repeatPasswordField.bottom
|
||||
anchors.topMargin: 20
|
||||
anchors.right: parent.right
|
||||
anchors.rightMargin: Style.current.xlPadding
|
||||
anchors.left: parent.left
|
||||
anchors.leftMargin: Style.current.xlPadding
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
color: Style.current.danger
|
||||
font.pixelSize: 11
|
||||
}
|
||||
|
||||
StyledText {
|
||||
//% "At least 6 characters. You will use this password to unlock status on this device & sign transactions."
|
||||
text: qsTrId("at-least-6-characters-you-will-use-this-password-to-unlock-status-on-this-device-sign-transactions.")
|
||||
|
|
Loading…
Reference in New Issue