Skip to content

Commit

Permalink
chore: update sign up
Browse files Browse the repository at this point in the history
  • Loading branch information
MishaZhem committed Aug 23, 2024
1 parent e7c50b1 commit 043ae12
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,9 @@
[style.margin-right]="'auto'"
/>
<tui-error
class="error-passwords"
[error]="[] | tuiFieldError | async"
[formGroup]="form"
[style.margin-bottom]="'0.8rem'"
[style.margin-right]="'auto'"
[style.margin-top]="'0'"
/>
<div class="under-password">
<label tuiLabel>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,3 +81,8 @@ form {
.icons-title {
font-weight: 700;
}

.error-passwords {
margin-bottom: 0.8rem;
margin-right: auto;
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ export const checkPasswords: ValidatorFn = (
const password = control.get('password');
const confirmPassword = control.get('confirmPassword');

return password && confirmPassword && password.value === confirmPassword.value
return (password && confirmPassword && password?.value === confirmPassword?.value) ||
!password?.touched ||
!confirmPassword?.touched
? null
: {differentPasswords: true};
};
Expand Down Expand Up @@ -60,7 +62,7 @@ export const checkPasswords: ValidatorFn = (
email: 'Invalid email',
minlength: ({requiredLength}: {requiredLength: string}) =>
of(`Minimum length — ${requiredLength}`),
differentPasswords: 'Passwords should be the same',
differentPasswords: 'Passwords must be the same',
},
},
],
Expand Down

0 comments on commit 043ae12

Please sign in to comment.