started working on discover page

This commit is contained in:
X4Lo committed 2024-08-29 19:03:03 +01:00
1 parent 58edac7259
commit 92aedb65d0
13 files changed
+233 -3

No files matched your search

@@ -194,11 +194,13 @@ export class MainCardComponent implements OnInit {
cardClick() {
if (this.entry.isInLibrary)
this.router.navigate([`/entries/${this.entry.id}`]);
else
else {
let type = this.entry.is_tvseries ? 'tv' : 'movie';
window.open(
'https://www.themoviedb.org/movie/' + this.entry.entryId.tmdb_id,
`https://www.themoviedb.org/${type}/` + this.entry.entryId.tmdb_id,
'_blank'
);
}
}
getTmdbLink() {
@@ -0,0 +1,12 @@
.movies-container {
display: grid;
grid-template-columns: repeat(2,
minmax(160px, 2fr));
gap: 20px;
}
.pagination-container {
display: flex;
justify-content: center;
align-items: center;
}
@@ -0,0 +1,6 @@
<div class="movies-container">
<ng-container *ngFor="let entry of entries">
<app-main-card [entry]="entry" (onEntryRemove)="entryRemoved($event)" (onEntryUpdate)="entryUpdated($event)"
@animateDestroy></app-main-card>
</ng-container>
</div>
@@ -0,0 +1,23 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { TwoLinesGridComponent } from './two-lines-grid.component';
describe('TwoLinesGridComponent', () => {
let component: TwoLinesGridComponent;
let fixture: ComponentFixture<TwoLinesGridComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [TwoLinesGridComponent]
})
.compileComponents();
fixture = TestBed.createComponent(TwoLinesGridComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
@@ -0,0 +1,37 @@
import { Component, EventEmitter, Input, Output } from '@angular/core';
import { Entry } from '../../../../shared/models/entry.model';
import { Event } from '@angular/router';
import {
animate,
state,
style,
transition,
trigger,
} from '@angular/animations';
@Component({
selector: 'app-two-lines-grid',
templateUrl: './two-lines-grid.component.html',
styleUrl: './two-lines-grid.component.css',
animations: [
trigger('animateDestroy', [
state('void', style({ opacity: '0' })),
transition('* => void', animate('300ms ease')),
]),
],
})
export class TwoLinesGridComponent {
@Output() onEntryRemove = new EventEmitter();
@Output() onEntryUpdate = new EventEmitter();
@Input() entries: Entry[] = [];
// ? EVENT CATCHER
entryRemoved(event: Event) {
// ? emit (entry removed) to library
this.onEntryRemove.emit(event);
}
entryUpdated(event: Event){
this.onEntryUpdate
}
}