From 3cde0731a1260f6a0bfd6a3d68fc9b7ca17921d1 Mon Sep 17 00:00:00 2001 From: Mohammed Abad Date: Tue, 16 Apr 2024 19:04:05 +0100 Subject: [PATCH] add entry seen component --- .../seen-modal/seen-modal.component.css | 32 ++++++++++ .../seen-modal/seen-modal.component.html | 26 +++++++++ .../seen-modal/seen-modal.component.spec.ts | 23 ++++++++ .../modals/seen-modal/seen-modal.component.ts | 58 +++++++++++++++++++ 4 files changed, 139 insertions(+) create mode 100644 frontend/src/app/shared/components/modals/seen-modal/seen-modal.component.css create mode 100644 frontend/src/app/shared/components/modals/seen-modal/seen-modal.component.html create mode 100644 frontend/src/app/shared/components/modals/seen-modal/seen-modal.component.spec.ts create mode 100644 frontend/src/app/shared/components/modals/seen-modal/seen-modal.component.ts diff --git a/frontend/src/app/shared/components/modals/seen-modal/seen-modal.component.css b/frontend/src/app/shared/components/modals/seen-modal/seen-modal.component.css new file mode 100644 index 0000000..b6e64b0 --- /dev/null +++ b/frontend/src/app/shared/components/modals/seen-modal/seen-modal.component.css @@ -0,0 +1,32 @@ +.mod-container { + padding: 20px; + background-color: var(--bs-body-bg) !important; + border-right: 1px solid var(--bs-border-color); + +} + +.mod-container .form-group, +.mod-container .form-group input{ + margin-top: 5px; +} + +.mod-container { + display: flex; + flex-direction: column; + height: 100%; /* Adjust this to match the modal container's height */ +} + +.modal-body { + flex: 1 0 auto; /* This will make the body expand to fill the available space */ +} + +.modal-footer { + margin-top: 10px; + flex-shrink: 0; /* This ensures the footer does not shrink */ +} + +.modal-footer button{ + margin-left: 5px; + color: var(--bs-border-color); +} + diff --git a/frontend/src/app/shared/components/modals/seen-modal/seen-modal.component.html b/frontend/src/app/shared/components/modals/seen-modal/seen-modal.component.html new file mode 100644 index 0000000..6701e2e --- /dev/null +++ b/frontend/src/app/shared/components/modals/seen-modal/seen-modal.component.html @@ -0,0 +1,26 @@ + +
+ + + +
+ \ No newline at end of file diff --git a/frontend/src/app/shared/components/modals/seen-modal/seen-modal.component.spec.ts b/frontend/src/app/shared/components/modals/seen-modal/seen-modal.component.spec.ts new file mode 100644 index 0000000..26516f2 --- /dev/null +++ b/frontend/src/app/shared/components/modals/seen-modal/seen-modal.component.spec.ts @@ -0,0 +1,23 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { SeenModalComponent } from './seen-modal.component'; + +describe('SeenModalComponent', () => { + let component: SeenModalComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + imports: [SeenModalComponent] + }) + .compileComponents(); + + fixture = TestBed.createComponent(SeenModalComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/frontend/src/app/shared/components/modals/seen-modal/seen-modal.component.ts b/frontend/src/app/shared/components/modals/seen-modal/seen-modal.component.ts new file mode 100644 index 0000000..ca3b719 --- /dev/null +++ b/frontend/src/app/shared/components/modals/seen-modal/seen-modal.component.ts @@ -0,0 +1,58 @@ +import { Component, Inject, Input, OnInit, ViewChild } from '@angular/core'; +import { FormControl } from '@angular/forms'; +import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; +import { UserCollectionService } from '../../../../core/services/userCollection.service'; +import { NotificationPopupComponent } from '../../notification-popup/notification-popup.component'; +import { NotificationService } from '../../../services/notification.service'; +import { UserCollection } from '../../../models/userCollection.model'; + +import { + trigger, + state, + style, + transition, + animate, +} from '@angular/animations'; + +@Component({ + selector: 'app-seen-modal', + templateUrl: './seen-modal.component.html', + styleUrl: './seen-modal.component.css', + animations: [ + trigger('fadeInOut', [ + state('in', style({ opacity: 1 })), + transition(':enter', [style({ opacity: 0 }), animate(600)]), + transition(':leave', [animate(600, style({ opacity: 0 }))]), + ]), + trigger('scaleInOut', [ + transition(':enter', [ + state('in', style({ opacity: 1 })), + style({ transform: 'scale(0)' }), + animate('200ms ease-in-out', style({ transform: 'scale(1)' })), + ]), + transition(':leave', [ + animate('200ms ease-in-out', style({ transform: 'scale(0)' })), + ]), + ]), + ], +}) +export class SeenModalComponent { + public watchDate: string = ''; + public watchedWith: string = ''; + + constructor( + public dialogRef: MatDialogRef, + @Inject(MAT_DIALOG_DATA) public data: any + ) {} + + onConfirm(): void { + this.dialogRef.close({ + watchDate: this.watchDate, + watchedWith: this.watchedWith, + }); + } + + onClose(): void { + this.dialogRef.close(); + } +}