add redirect to entry page on click
This commit is contained in:
1 parent
4c665f005a
commit
33870be352
2 files changed
+14
-5
No files matched your search
+4
-2
@@ -18,12 +18,14 @@
|
||||
<!-- <div class="info" *ngIf="entry.isInLibrary">
|
||||
<i class='bx bx-list-plus' (click)="showAddToListModal()"></i>
|
||||
</div> -->
|
||||
|
||||
</div>
|
||||
|
||||
<!-- card body moved inside card head -->
|
||||
<div class="card-body" (click)="cardClick()">
|
||||
<a [href]="getTmdbLink()" target="_blank" rel="noopener noreferrer">
|
||||
<!-- <a [href]="getTmdbLink()" target="_blank" rel="noopener noreferrer">
|
||||
<h3 class="card-title">{{ entry.title }}</h3>
|
||||
</a> -->
|
||||
<a (click)="cardClick()" rel="noopener noreferrer">
|
||||
<h3 class="card-title">{{ entry.title }}</h3>
|
||||
</a>
|
||||
<div class="card-info">
|
||||
|
||||
+10
-3
@@ -4,6 +4,7 @@ import { LibraryService } from '../../../../core/services/library.service';
|
||||
import { Entry } from '../../../../shared/models/entry.model';
|
||||
import { trigger, transition, style, animate } from '@angular/animations';
|
||||
import { UserCollectionService } from '../../../../core/services/userCollection.service';
|
||||
import { Router } from '@angular/router';
|
||||
|
||||
@Component({
|
||||
selector: 'app-userCollection-grid-card',
|
||||
@@ -27,7 +28,8 @@ export class UserCollectionGridCardComponent {
|
||||
constructor(
|
||||
private libraryService: LibraryService,
|
||||
private listService: UserCollectionService,
|
||||
public dialog: MatDialog
|
||||
public dialog: MatDialog,
|
||||
private router: Router
|
||||
) {}
|
||||
|
||||
ngOnInit(): void {
|
||||
@@ -79,7 +81,9 @@ export class UserCollectionGridCardComponent {
|
||||
|
||||
removeEntryFromList() {
|
||||
// TODO: add confirm modal
|
||||
this.listService.removeEntryFromCollection(this.listId, this.entry.id).subscribe({
|
||||
this.listService
|
||||
.removeEntryFromCollection(this.listId, this.entry.id)
|
||||
.subscribe({
|
||||
next: (response) => {
|
||||
console.log('Entry successfully removed from list.', response);
|
||||
this.entry.id = 0;
|
||||
@@ -92,7 +96,10 @@ export class UserCollectionGridCardComponent {
|
||||
}
|
||||
|
||||
// ? EVENTS
|
||||
cardClick() {}
|
||||
cardClick() {
|
||||
if (this.entry.isInLibrary)
|
||||
this.router.navigate([`/entry/${this.entry.id}`]);
|
||||
}
|
||||
|
||||
// ? EVENT EMITTER
|
||||
emitRefrechEvent() {
|
||||
|
||||
Reference in new issue
Block a user