Skip to content

Commit a6095f6

Browse files
fix
1 parent 19841ad commit a6095f6

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

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

Lines changed: 1 addition & 1 deletion
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.id) {
99
<div class="flex flex-col items-center min-w-24 group">
1010
<div
1111
[ngStyle]="{ 'background-color': tag.color }"

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,17 +35,17 @@ import { TagsStore } from '../../../../shared/stores/tags.store';
3535
})
3636
export class PostsListComponent implements OnInit {
3737
scroll = viewChild<ElementRef<HTMLElement>>('scrollContainer');
38-
scrollProgress: WritableSignal<number> = signal(0);
38+
3939
postStore = inject(PostsStore);
4040
tagsStore = inject(TagsStore);
4141

42+
scrollProgress: WritableSignal<number> = signal(0);
4243
posts = this.postStore.posts;
4344
tags = this.tagsStore.tags;
44-
45-
initialScroll = 2;
45+
initialTagScrollProgressBarForMobile = 2;
4646

4747
constructor() {
48-
this.initializeScrolling();
48+
this.initializeScrollingForMobileView();
4949
}
5050

5151
ngOnInit() {
@@ -68,8 +68,8 @@ export class PostsListComponent implements OnInit {
6868
setTimeout(() => {}, 0);
6969
}
7070

71-
private initializeScrolling(): void {
72-
this.scrollProgress.set(this.initialScroll);
71+
private initializeScrollingForMobileView(): void {
72+
this.scrollProgress.set(this.initialTagScrollProgressBarForMobile);
7373
afterNextRender(() => {
7474
this.scroll()?.nativeElement.addEventListener(
7575
'scroll',

src/styles.scss

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
@use 'tailwindcss/utilities';
21
@import "../node_modules/quill/dist/quill.core.css";
32
@import "../node_modules/quill/dist/quill.snow.css";
43
@import 'highlight.js/styles/atom-one-dark.css';
@@ -81,6 +80,8 @@ h4 {
8180
@apply bg-gray-300 text-gray-500 cursor-not-allowed;
8281
}
8382

83+
/* Import TailwindCSS */
84+
@import 'tailwindcss/utilities';
8485

8586
/* Additional styles for the card component */
8687
.post-card {

0 commit comments

Comments
 (0)