diff options
| author | Syndamia <kamen.d.mladenov@protonmail.com> | 2021-03-29 16:05:06 +0300 |
|---|---|---|
| committer | Syndamia <kamen.d.mladenov@protonmail.com> | 2021-03-29 16:05:06 +0300 |
| commit | 1059b56781fdd6390c4c44fb00e99cc831971285 (patch) | |
| tree | 8e0d369df9837f99063cb917bf066dcad6f7d104 /src/app/components | |
| parent | 0dd2a9ac545a8bdce63f403122503fef9510378c (diff) | |
| download | DevHive-Angular-1059b56781fdd6390c4c44fb00e99cc831971285.tar DevHive-Angular-1059b56781fdd6390c4c44fb00e99cc831971285.tar.gz DevHive-Angular-1059b56781fdd6390c4c44fb00e99cc831971285.zip | |
Added show/hide button in profile settings confirm password field
Diffstat (limited to 'src/app/components')
| -rw-r--r-- | src/app/components/profile-settings/profile-settings.component.html | 7 | ||||
| -rw-r--r-- | src/app/components/profile-settings/profile-settings.component.ts | 7 |
2 files changed, 12 insertions, 2 deletions
diff --git a/src/app/components/profile-settings/profile-settings.component.html b/src/app/components/profile-settings/profile-settings.component.html index fd2d0c5..1471859 100644 --- a/src/app/components/profile-settings/profile-settings.component.html +++ b/src/app/components/profile-settings/profile-settings.component.html @@ -116,7 +116,7 @@ </div> </section> </section> - <section class="flex-col margin-top-dot5"> + <section class="flex-col input-selection"> <div class="flex-row"> <label class="flexible fg-focus">Current Password</label> @@ -124,7 +124,10 @@ <label *ngIf="updateUserFormGroup.get('password')?.errors?.minlength" class="error">*Minimum 3 characters</label> <label *ngIf="updateUserFormGroup.get('password')?.errors?.pattern" class="error">*At least 1 number</label> </div> - <input type="password" class="fancy-input border-faded-slim border-bottom-only" formControlName="password" required> + <input [type]="showCurrentPassword ? 'text' : 'password'" class="fancy-input border-faded-slim border-bottom-only padding-right-1dot5" formControlName="password" required> + <button type="button" class="show-password-button hover-half-opacity click-effect" (click)="toggleShowPassword(0)"> + <img [src]="showCurrentPassword ? '/assets/icons/tabler-icon-eye-off.svg' : '/assets/icons/tabler-icon-eye.svg'"> + </button> </section> <section class="margin-top-bot-dot3"> <app-success-bar></app-success-bar> diff --git a/src/app/components/profile-settings/profile-settings.component.ts b/src/app/components/profile-settings/profile-settings.component.ts index 78a57ec..f329942 100644 --- a/src/app/components/profile-settings/profile-settings.component.ts +++ b/src/app/components/profile-settings/profile-settings.component.ts @@ -38,6 +38,7 @@ export class ProfileSettingsComponent implements OnInit { public chosenTechnologies: Technology[]; public availableLanguages: Language[]; public availableTechnologies: Technology[]; + public showCurrentPassword = false; constructor(private _titleService: Title, private _router: Router, private _userService: UserService, private _languageService: LanguageService, private _technologyService: TechnologyService, private _tokenService: TokenService, private _fb: FormBuilder, private _location: Location) { this._titleService.setTitle(this._title); @@ -346,4 +347,10 @@ export class ProfileSettingsComponent implements OnInit { this._router.onSameUrlNavigation = 'reload'; this._router.navigate([this._router.url]); } + + toggleShowPassword(index: number): void { + switch (index) { + case 0: this.showCurrentPassword = !this.showCurrentPassword; + } + } } |
