Skip to content

Commit 407cb61

Browse files
tags fixed
1 parent d15b5a6 commit 407cb61

File tree

4 files changed

+6
-100
lines changed

4 files changed

+6
-100
lines changed

src/app/reader/_components/main-page/posts-list/posts-list.component.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
class="shadow-lg bg-white p-4 sm:p-6 sm:px-14 rounded-[32px] sm:rounded-[64px] overflow-x-scroll hide-scrollbar whitespace-nowrap scroll-smooth"
66
>
77
<div class="inline-flex space-x-4 gap-x-0 md:gap-x-6">
8-
@for (tag of TAGS; track tag.name) {
8+
@for (tag of tags(); track tag.name) {
99
<div class="flex flex-col items-center min-w-24 group">
1010
<div
1111
[ngStyle]="{ 'background-color': tag.color }"
@@ -82,7 +82,7 @@
8282
<div class="flex justify-center mt-5">
8383
<div class="w-full">
8484
<div class="grid">
85-
@for (post of posts(); track post.id; let f = $first) {
85+
@for (post of posts(); track post.id) {
8686
<app-post-card [post]="post"></app-post-card>
8787
}
8888
</div>

src/app/reader/_components/main-page/posts-list/posts-list.component.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,12 @@ import {
99
ElementRef,
1010
signal,
1111
WritableSignal,
12-
OnInit,
1312
} from '@angular/core';
1413
import { RouterModule } from '@angular/router';
1514
import { AboutMeComponent } from '../../../../shared/about-me/about-me.component';
1615
import { PostCardComponent } from './post-card/post-card.component';
17-
import { TAGS } from '../../../../utlis/tags';
1816
import { PostsStore } from './posts.store';
17+
import { TagsStore } from '../../../../shared/stores/tags.store';
1918

2019
@Component({
2120
selector: 'app-posts-list',
@@ -37,7 +36,10 @@ export class PostsListComponent {
3736
scroll = viewChild<ElementRef<HTMLElement>>('scrollContainer');
3837
scrollProgress: WritableSignal<number> = signal(0);
3938
postStore = inject(PostsStore);
39+
tagsStore = inject(TagsStore);
40+
4041
posts = this.postStore.posts;
42+
tags = this.tagsStore.tags;
4143

4244
initialScroll = 2;
4345

@@ -62,6 +64,4 @@ export class PostsListComponent {
6264

6365
this.scrollProgress.set(scrollPercentage);
6466
}
65-
66-
protected readonly TAGS = TAGS;
6767
}

src/app/utlis/tag.interface.ts

Lines changed: 0 additions & 5 deletions
This file was deleted.

src/app/utlis/tags.ts

Lines changed: 0 additions & 89 deletions
This file was deleted.

0 commit comments

Comments
 (0)