Skip to content

Commit 62a917e

Browse files
committed
fix skills sidebar & register password
1 parent d575d02 commit 62a917e

5 files changed

Lines changed: 76 additions & 6 deletions

File tree

projects/skills/src/app/app.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ export class AppComponent implements OnInit {
3939
{ name: "Навыки", icon: "lib", link: "skills" },
4040
{ name: "Рейтинг", icon: "growth", link: "rating" },
4141
{ name: "Подписка", icon: "receipt", link: "subscription" },
42-
{ name: "Траектория бизнеса", icon: "trackbuss", link: "trackBuss" },
42+
// { name: "Траектория бизнеса", icon: "trackbuss", link: "trackBuss" },
4343
{ name: "Траектория карьеры", icon: "trackcar", link: "trackCar" },
44-
{ name: "Вебинары", icon: "webinars", link: "webinars" },
44+
// { name: "Вебинары", icon: "webinars", link: "webinars" },
4545
];
4646

4747
userData = signal<UserData | null>(null);

projects/social_platform/src/app/auth/login/login.component.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { ErrorMessage } from "@error/models/error-message";
77
import { ControlErrorPipe, TokenService, ValidationService } from "projects/core";
88
import { ActivatedRoute, Router, RouterLink } from "@angular/router";
99
import { ButtonComponent, IconComponent, InputComponent } from "@ui/components";
10+
import { CommonModule } from "@angular/common";
1011

1112
@Component({
1213
selector: "app-login",
@@ -15,6 +16,7 @@ import { ButtonComponent, IconComponent, InputComponent } from "@ui/components";
1516
changeDetection: ChangeDetectionStrategy.OnPush,
1617
standalone: true,
1718
imports: [
19+
CommonModule,
1820
ReactiveFormsModule,
1921
RouterLink,
2022
InputComponent,

projects/social_platform/src/app/auth/register/register.component.html

Lines changed: 52 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,18 +57,66 @@ <h3 class="auth__title auth__title--register">
5757
<app-input
5858
[error]="(password | controlError) && credsSubmitInitiated"
5959
id="passowrd"
60-
type="password"
60+
[type]="showPassword ? 'text' : 'password'"
6161
formControlName="password"
6262
placeholder="Придумайте пароль"
63-
></app-input>
63+
>
64+
@if(showPassword) {
65+
<i
66+
appIcon
67+
icon="eye"
68+
appSquare="24"
69+
appWidth="24"
70+
appHeight="24"
71+
appViewBox="0 0 24 24"
72+
class="icon"
73+
(click)="toggleShowPassword('first')"
74+
></i>
75+
} @else {
76+
<i
77+
appIcon
78+
icon="eye-off"
79+
appSquare="24"
80+
appWidth="24"
81+
appHeight="24"
82+
appViewBox="0 0 24 24"
83+
class="icon"
84+
(click)="toggleShowPassword('first')"
85+
></i>
86+
}
87+
</app-input>
6488
<app-input
6589
class="register__repeated-password"
6690
[error]="(password | controlError) && credsSubmitInitiated"
6791
id="repeatedPassword"
68-
type="password"
92+
[type]="showPasswordRepeat ? 'text' : 'password'"
6993
formControlName="repeatedPassword"
7094
placeholder="Повторите пароль"
71-
></app-input>
95+
>
96+
@if(showPasswordRepeat) {
97+
<i
98+
appIcon
99+
icon="eye"
100+
appSquare="24"
101+
appWidth="24"
102+
appHeight="24"
103+
appViewBox="0 0 24 24"
104+
class="icon"
105+
(click)="toggleShowPassword('repeat')"
106+
></i>
107+
} @else {
108+
<i
109+
appIcon
110+
icon="eye-off"
111+
appSquare="24"
112+
appWidth="24"
113+
appHeight="24"
114+
appViewBox="0 0 24 24"
115+
class="icon"
116+
(click)="toggleShowPassword('repeat')"
117+
></i>
118+
}
119+
</app-input>
72120
@if (credsSubmitInitiated) {
73121
<ng-container>
74122
@if (password | controlError: "required") {

projects/social_platform/src/app/auth/register/register.component.scss

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,3 +85,8 @@
8585
padding: 20px 0;
8686
}
8787
}
88+
89+
.icon {
90+
color: var(--dark-grey);
91+
cursor: pointer;
92+
}

projects/social_platform/src/app/auth/register/register.component.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ import * as cpf from "dayjs/plugin/customParseFormat";
1010
import { ButtonComponent, CheckboxComponent, InputComponent } from "@ui/components";
1111
import { AuthService } from "@auth/services";
1212
import { ModalComponent } from "@ui/components/modal/modal.component";
13+
import { IconComponent } from "@uilib";
14+
import { CommonModule } from "@angular/common";
1315

1416
dayjs.extend(cpf);
1517

@@ -19,12 +21,14 @@ dayjs.extend(cpf);
1921
styleUrl: "./register.component.scss",
2022
standalone: true,
2123
imports: [
24+
CommonModule,
2225
ReactiveFormsModule,
2326
InputComponent,
2427
CheckboxComponent,
2528
ButtonComponent,
2629
ModalComponent,
2730
RouterLink,
31+
IconComponent,
2832
ControlErrorPipe,
2933
],
3034
})
@@ -68,6 +72,9 @@ export class RegisterComponent implements OnInit {
6872
credsSubmitInitiated = false;
6973
infoSubmitInitiated = false;
7074

75+
showPassword = false;
76+
showPasswordRepeat = false;
77+
7178
isUserCreationModalError = false;
7279

7380
serverErrors: string[] = [];
@@ -76,6 +83,14 @@ export class RegisterComponent implements OnInit {
7683

7784
errorMessage = ErrorMessage;
7885

86+
toggleShowPassword(type: "repeat" | "first") {
87+
if (type === 'repeat') {
88+
this.showPasswordRepeat = !this.showPasswordRepeat
89+
} else {
90+
this.showPassword = !this.showPassword;
91+
}
92+
}
93+
7994
onInfoStep() {
8095
const fields = [
8196
this.registerForm.get("email"),

0 commit comments

Comments
 (0)