Skip to content

Commit 2c1cf2d

Browse files
committed
fix length in feed card components
1 parent b86a65f commit 2c1cf2d

4 files changed

Lines changed: 22 additions & 8 deletions

File tree

projects/social_platform/src/app/office/features/news-card/news-card.component.html

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
77
[src]="feedItem.imageAddress || placeholderUrl"
88
[alt]="feedItem.name"
99
/>
10-
<p class="card__name text-body-10">{{ feedItem.name }}</p>
10+
<p class="card__name text-body-10">
11+
{{ feedItem.name.length > 30 ? feedItem.name.slice(0, 26) + "..." : feedItem.name }}
12+
</p>
1113
</a>
1214
@if (isOwner) {
1315
<div class="card__menu" (clickOutside)="onCloseMenu()">
@@ -28,7 +30,7 @@
2830
@if (feedItem.text) {
2931
<div class="card__text text-body-10">
3032
@if (!editMode) {
31-
<p class="text-body-10" #newsTextEl [innerHTML]="feedItem.text | parseLinks"></p>
33+
<p class="text-body-10" #newsTextEl [innerHTML]="feedItem.text | parseLinks | parseBreaks"></p>
3234
} @else { @if (editForm.get("text"); as text) {
3335
<app-textarea size="big" [formControl]="text | formControl"></app-textarea>
3436
} }

projects/social_platform/src/app/office/features/news-card/news-card.component.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,13 @@ import { FeedNews } from "@office/projects/models/project-news.model";
1414
import { SnackbarService } from "@ui/services/snackbar.service";
1515
import { ActivatedRoute, RouterLink } from "@angular/router";
1616
import { FormBuilder, FormGroup, ReactiveFormsModule, Validators } from "@angular/forms";
17-
import { DayjsPipe, FormControlPipe, ParseLinksPipe, ValidationService } from "projects/core";
17+
import {
18+
DayjsPipe,
19+
FormControlPipe,
20+
ParseBreaksPipe,
21+
ParseLinksPipe,
22+
ValidationService,
23+
} from "projects/core";
1824
import { FileService } from "@core/services/file.service";
1925
import { nanoid } from "nanoid";
2026
import { expandElement } from "@utils/expand-element";
@@ -50,6 +56,7 @@ import { ImgCardComponent } from "@office/shared/img-card/img-card.component";
5056
DayjsPipe,
5157
FormControlPipe,
5258
ParseLinksPipe,
59+
ParseBreaksPipe,
5360
CarouselComponent,
5461
ImgCardComponent,
5562
],

projects/social_platform/src/app/office/feed/shared/open-vacancy/open-vacancy.component.html

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@
1717
alt="newsItem.name"
1818
></app-avatar>
1919

20-
<p class="text-body-12">{{ project.name }}</p>
20+
<p class="text-body-12">
21+
{{ project.name.length > 30 ? project.name.slice(0, 26) + "..." : project.name }}
22+
</p>
2123

2224
@if (industryService.industries | async; as industries) { @if
2325
(industryService.getIndustry(industries, project.industry); as industry) {
@@ -29,7 +31,9 @@
2931
} @if (feedItem; as vacancy) {
3032
<div class="card__vacancy">
3133
<div class="lists__section">
32-
<h3 class="text-body-10 lists__title">{{ vacancy.role }}</h3>
34+
<h3 class="text-body-10 lists__title">
35+
{{ vacancy.role.length > 30 ? vacancy.role.slice(0, 26) + "..." : vacancy.role }}
36+
</h3>
3337
<p class="text-body-10">{{ vacancy.datetimeCreated | dayjs: "format":"DD MM YY" }}</p>
3438
</div>
3539

@@ -57,7 +61,7 @@ <h3 class="text-body-10 lists__title">{{ vacancy.role }}</h3>
5761
</div>
5862
} @if (skillsLength > 8) {
5963
<div class="read-more text-body-10" (click)="readFullSkills = !readFullSkills">
60-
{{ readFullSkills ? "cкрыть" : "xитать полностью" }}
64+
{{ readFullSkills ? "cкрыть" : "подробнее" }}
6165
</div>
6266
} }
6367
</div>

projects/social_platform/src/app/office/feed/shared/open-vacancy/open-vacancy.component.scss

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,9 @@
5757
}
5858

5959
&__description {
60-
overflow-wrap: break-word;
61-
white-space: pre-wrap;
60+
word-break: break-word;
61+
overflow-wrap: anywhere;
62+
white-space: wrap;
6263
}
6364

6465
&__project {

0 commit comments

Comments
 (0)