Skip to content
Snippets Groups Projects
Commit 4cbbb64b authored by Bastien DUMONT's avatar Bastien DUMONT :angel:
Browse files

feat(clickable eye): eye closed when showing password

parent ce2cd3ea
No related branches found
No related tags found
Loading
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
</div> </div>
<div class="form-group password" fxLayout="column"> <div class="form-group password" fxLayout="column">
<label for="password">Mot de passe</label> <label for="password">Mot de passe</label>
<div fxLayout="row" fxLayoutGap="13px"> <div fxLayout="row" fxLayoutGap="13px" fxLayoutAlign="default center">
<input <input
[type]="isShowPassword ? 'text' : 'password'" [type]="isShowPassword ? 'text' : 'password'"
autocomplete="on" autocomplete="on"
...@@ -29,9 +29,12 @@ ...@@ -29,9 +29,12 @@
class="form-input" class="form-input"
[ngClass]="{ inputInvalid: f.password.invalid && f.password.value }" [ngClass]="{ inputInvalid: f.password.invalid && f.password.value }"
/> />
<svg (click)="toggleShowPassword()" class="eyePassword" aria-hidden="true"> <div class="eyePassword">
<use [attr.xlink:href]="'assets/form/sprite.svg#eyePassword'"></use> <svg (click)="toggleShowPassword()" aria-hidden="true" preserveAspectRatio="xMinYMid">
</svg> <use *ngIf="!isShowPassword" [attr.xlink:href]="'assets/form/sprite.svg#eyePasswordVisible'"></use>
<use *ngIf="isShowPassword" [attr.xlink:href]="'assets/form/sprite.svg#eyePasswordInvisible'"></use>
</svg>
</div>
<svg *ngIf="f.password.invalid && f.password.value" class="notValidate" aria-hidden="true"> <svg *ngIf="f.password.invalid && f.password.value" class="notValidate" aria-hidden="true">
<use [attr.xlink:href]="'assets/form/sprite.svg#notValidate'"></use> <use [attr.xlink:href]="'assets/form/sprite.svg#notValidate'"></use>
</svg> </svg>
......
...@@ -79,11 +79,15 @@ ...@@ -79,11 +79,15 @@
} }
} }
.eyePassword { .eyePassword {
cursor: pointer; display: flex;
width: 24px; align-content: center;
height: 40px; svg {
stroke: $grey-3; cursor: pointer;
fill: $grey-3; width: 32px;
height: 32px;
stroke: $grey-3;
fill: $grey-3;
}
} }
.passHint { .passHint {
margin-top: 0.5rem; margin-top: 0.5rem;
......
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment