Skip to content

Commit 3ed5916

Browse files
committed
add fixes of design and modals
1 parent b87f340 commit 3ed5916

5 files changed

Lines changed: 121 additions & 10 deletions

File tree

projects/skills/src/app/profile/shared/skills-block/skills-block.component.html

Lines changed: 33 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,9 @@ <h2 class="skills__title">Навыки</h2>
1616
}}</span>
1717
<div class="skills_list">
1818
@for (skill of displayedSkills; track $index) {
19-
<app-personal-rating-card
20-
[routerLink]="['/skills', skill.skillId]"
21-
[personalRatingCardData]="skill"
22-
></app-personal-rating-card>
19+
<div (click)="onSkillClick(skill.skillId)">
20+
<app-personal-rating-card [personalRatingCardData]="skill"></app-personal-rating-card>
21+
</div>
2322
} @empty {
2423
<!-- <p class="skills__placeholder-text">
2524
выберите навыки,которые Вы будете развивать в этом месяце
@@ -72,6 +71,36 @@ <h2 class="skills__title">Навыки</h2>
7271
</div>
7372
</app-modal>
7473

74+
<app-modal [open]="nonConfirmerModalOpen()">
75+
<div class="confirm">
76+
<h4 class="confirm__title text-heading-4">У вас нет активной подписки</h4>
77+
<div class="cancel__confirm">
78+
<img alt="more image" src="assets\images\trajectories\more.svg" class="confirm__image" />
79+
<p class="text-body-12 cancel__subtext">
80+
Чтобы получить доступ ко всем возможностям платформы, оформите подписку прямо сейчас!
81+
</p>
82+
83+
<div class="cancel__buttons-group">
84+
<app-button
85+
customTypographyClass="text-body-12"
86+
[color]="'grey'"
87+
style="width: 100%"
88+
(click)="nonConfirmerModalOpen.set(false)"
89+
>Назад</app-button
90+
>
91+
92+
<app-button
93+
routerLink="/subscription"
94+
style="width: 100%"
95+
customTypographyClass="text-body-12"
96+
[color]="'primary'"
97+
>Купить</app-button
98+
>
99+
</div>
100+
</div>
101+
</div>
102+
</app-modal>
103+
75104
<app-skill-chooser
76105
[open]="openSkillChoose"
77106
(openChange)="onOpenSkillsChange($event)"

projects/skills/src/app/profile/shared/skills-block/skills-block.component.scss

Lines changed: 63 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -180,10 +180,6 @@
180180
}
181181
}
182182

183-
&__subtext {
184-
color: var(--black);
185-
}
186-
187183
&__wave {
188184
position: absolute;
189185
bottom: -20%;
@@ -192,4 +188,67 @@
192188
width: 100%;
193189
opacity: 0.3;
194190
}
191+
192+
&__buttons-group {
193+
display: flex;
194+
gap: 15px;
195+
width: 100%;
196+
margin-top: 20px;
197+
198+
app-button {
199+
width: 100%;
200+
border-radius: 15px;
201+
}
202+
}
203+
204+
&__confirm {
205+
display: flex;
206+
flex-direction: column;
207+
align-items: center;
208+
209+
@include responsive.apply-desktop {
210+
align-items: center;
211+
text-align: center;
212+
}
213+
}
214+
215+
&__subtext {
216+
width: 100%;
217+
margin-bottom: 24px;
218+
219+
@include responsive.apply-desktop {
220+
width: 80%;
221+
}
222+
}
195223
}
224+
225+
226+
.confirm {
227+
z-index: 100;
228+
display: flex;
229+
flex-direction: column;
230+
align-items: center;
231+
justify-content: center;
232+
padding: 0;
233+
text-align: center;
234+
235+
@include responsive.apply-desktop {
236+
padding: 20px 50px 24px;
237+
}
238+
239+
&__title {
240+
margin-bottom: 20px;
241+
}
242+
243+
&__image {
244+
width: 130px;
245+
height: 125px;
246+
margin-top: 24px;
247+
margin-bottom: 18px;
248+
249+
@include responsive.apply-desktop {
250+
width: 100%;
251+
height: 218px;
252+
}
253+
}
254+
}

projects/skills/src/app/profile/shared/skills-block/skills-block.component.ts

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,14 @@ import { CommonModule, NgOptimizedImage } from "@angular/common";
55
import { ButtonComponent } from "@ui/components";
66
import { PersonalRatingCardComponent } from "../personal-rating-card/personal-rating-card.component";
77
import { IconComponent } from "@uilib";
8-
import { RouterLink } from "@angular/router";
8+
import { Router, RouterLink } from "@angular/router";
99
import { SkillChooserComponent } from "../skill-chooser/skill-chooser.component";
1010
import { ProfileService } from "../../services/profile.service";
1111
import { Profile } from "projects/skills/src/models/profile.model";
1212
import { ModalComponent } from "@ui/components/modal/modal.component";
1313
import { PersonalSkillCardComponent } from "../personal-skill-card/personal-skill-card.component";
1414
import { animate, style, transition, trigger } from "@angular/animations";
15+
import { SkillService } from "../../../skills/services/skill.service";
1516

1617
@Component({
1718
selector: "app-skills-block",
@@ -34,8 +35,12 @@ export class SkillsBlockComponent implements OnInit {
3435
isHintVisible = false;
3536

3637
profileService = inject(ProfileService);
38+
skillService = inject(SkillService);
39+
router = inject(Router);
40+
3741
skillsList: Profile["skills"] = [];
3842
displayedSkills: Profile["skills"] = [];
43+
nonConfirmerModalOpen = signal(false);
3944

4045
limit = 2;
4146
offset = 0;
@@ -89,6 +94,15 @@ export class SkillsBlockComponent implements OnInit {
8994
this.displayedSkills = this.skillsList.slice(this.offset, this.offset + this.limit);
9095
}
9196

97+
onSkillClick(skillId: number) {
98+
this.skillService.setSkillId(skillId);
99+
this.router.navigate(["skills", skillId]).catch(err => {
100+
if (err.status === 403) {
101+
this.nonConfirmerModalOpen.set(true);
102+
}
103+
});
104+
}
105+
92106
ngOnInit(): void {
93107
this.profileService.getProfile().subscribe((r: Profile) => {
94108
this.skillsList = r["skills"];

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,13 @@
33
import { Component, inject, OnDestroy, OnInit, signal } from "@angular/core";
44
import { CommonModule } from "@angular/common";
55
import { BackComponent, IconComponent } from "@uilib";
6-
import { ActivatedRoute, Router, RouterLink, RouterLinkActive } from "@angular/router";
6+
import {
7+
ActivatedRoute,
8+
Router,
9+
RouterLink,
10+
RouterLinkActive,
11+
RouterModule,
12+
} from "@angular/router";
713
import { BarComponent, ButtonComponent } from "@ui/components";
814
import { SkillCardComponent } from "../shared/skill-card/skill-card.component";
915
import { map, Observable, Subscription } from "rxjs";
@@ -27,6 +33,8 @@ import { ModalComponent } from "@ui/components/modal/modal.component";
2733
SkillCardComponent,
2834
BarComponent,
2935
ReactiveFormsModule,
36+
RouterLink,
37+
RouterModule,
3038
],
3139
templateUrl: "./list.component.html",
3240
styleUrl: "./list.component.scss",

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ export class SubscriptionComponent implements OnInit, OnDestroy {
4646
} else return [subscription];
4747
})
4848
)
49+
.pipe(map(subs => subs.sort((a, b) => a.price - b.price)))
4950
.subscribe(subscriptions => {
5051
this.subscriptions.set(subscriptions);
5152
});

0 commit comments

Comments
 (0)