File tree Expand file tree Collapse file tree 4 files changed +6
-100
lines changed
reader/_components/main-page/posts-list Expand file tree Collapse file tree 4 files changed +6
-100
lines changed Original file line number Diff line number Diff line change 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 } "
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 >
Original file line number Diff line number Diff line change @@ -9,13 +9,12 @@ import {
99 ElementRef ,
1010 signal ,
1111 WritableSignal ,
12- OnInit ,
1312} from '@angular/core' ;
1413import { RouterModule } from '@angular/router' ;
1514import { AboutMeComponent } from '../../../../shared/about-me/about-me.component' ;
1615import { PostCardComponent } from './post-card/post-card.component' ;
17- import { TAGS } from '../../../../utlis/tags' ;
1816import { 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}
Load Diff This file was deleted.
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments