Skip to content

Commit 0787ac3

Browse files
committed
update UI post card
1 parent 6b5704e commit 0787ac3

File tree

3 files changed

+17
-3
lines changed

3 files changed

+17
-3
lines changed

src/app/core/services/config-service/api.enpoints.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export const version = 'v1';
1212

1313
export const API_CONFIG = {
1414
BASE_URLS: {
15-
MAIN_API: environment.IP_SERVER, //chạy ở local thì đổi ip thành IP_SERVER_LOCAL và thêm "+ version" vào chuỗi MAIN_API (sau IP). push lên github nhớ stash commit hoặc không làm thay đổi dòng này.
15+
MAIN_API: environment.IP_SERVER_LOCAL + version, //chạy ở local thì đổi ip thành IP_SERVER_LOCAL và thêm "+ version" vào chuỗi MAIN_API (sau IP). push lên github nhớ stash commit hoặc không làm thay đổi dòng này.
1616
SECONDARY_API: '',
1717
},
1818
ENDPOINTS: {

src/app/shared/components/my-shared/post-card/post-card.html

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,22 @@ <h2 class="post-card__title">{{ post.title | truncate :35}}</h2>
2626

2727
@if (post.tags.length) {
2828
<div class="post-card__tags">
29-
@for (tag of post.tags; track trackByFn($index, tag)) {
29+
@for (tag of post.tags.slice(0, 3); track trackByFn($index, tag)) {
3030
<span class="post-card__tag">#{{ tag }}</span>
3131
}
32+
33+
<div style="position: relative">
34+
<app-tooltip
35+
[content]="(post.tags || []).slice(3).join(', ')"
36+
[position]="'bottom'"
37+
[delay]="0.5"
38+
[distance]="50"
39+
>
40+
@if ((post.tags.length || 0) > 3) {
41+
<span class="tag other"> +{{ (post.tags.length || 0) - 3 }} </span>
42+
}
43+
</app-tooltip>
44+
</div>
3245
</div>
3346
}
3447
</main>

src/app/shared/components/my-shared/post-card/post-card.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,14 @@ import {
1616
import { MarkdownModule, MarkdownService } from 'ngx-markdown';
1717

1818
import hljs from 'highlight.js';
19+
import { Tooltip } from '../../fxdonad-shared/tooltip/tooltip';
1920

2021
@Component({
2122
selector: 'app-post-card',
2223
templateUrl: './post-card.html',
2324
styleUrls: ['./post-card.scss'],
2425
standalone: true,
25-
imports: [CommonModule, TruncatePipe, MarkdownModule],
26+
imports: [CommonModule, TruncatePipe, MarkdownModule, Tooltip],
2627
changeDetection: ChangeDetectionStrategy.OnPush, // Tối ưu hiệu suất
2728
})
2829
export class PostCardComponent {

0 commit comments

Comments
 (0)