refactor(navigation): update navigation links to use routerLink and streamline page switching logic

This commit is contained in:
4gray committed 2025-05-04 23:05:16 +02:00
1 parent 715c624328
commit d18a11fb8b
2 files changed
+11 -3

No files matched your search

@@ -85,8 +85,9 @@
<mat-nav-list>
<a
mat-list-item
routerLink="./search"
routerLinkActive="active"
(click)="pageClicked.emit('search')"
(click)="pageSwitch('search')"
>
<mat-icon matListItemIcon>search</mat-icon>
<span matListItemTitle>{{
@@ -95,8 +96,9 @@
</a>
<a
mat-list-item
routerLink="./recent"
routerLinkActive="active"
(click)="pageClicked.emit('recent')"
(click)="pageSwitch('recent')"
>
<mat-icon matListItemIcon>history</mat-icon>
<span matListItemTitle>{{
@@ -105,8 +107,9 @@
</a>
<a
mat-list-item
routerLink="./favorites"
routerLinkActive="active"
(click)="pageClicked.emit('favorites')"
(click)="pageSwitch('favorites')"
>
<mat-icon matListItemIcon>favorite</mat-icon>
<span matListItemTitle>{{
@@ -101,4 +101,9 @@ export class NavigationComponent {
data: this.currentPlaylist(),
});
}
pageSwitch(page: 'search' | 'recent' | 'favorites') {
this.pageClicked.emit(page);
this.xtreamStore.setSelectedContentType(undefined);
}
}