add entry seen component
This commit is contained in:
1 parent
281daf06e2
commit
3cde0731a1
4 files changed
+139
No files matched your search
@@ -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);
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
<!-- <div class="modal fade" id="watchModal" tabindex="-1" role="dialog" aria-labelledby="watchModalLabel"
|
||||||
|
aria-hidden="true"> -->
|
||||||
|
<div class="mod-container">
|
||||||
|
<div class="modal-header">
|
||||||
|
<h5 class="modal-title" id="watchModalLabel">Watch Details</h5>
|
||||||
|
<button type="button" class="btn-close" (click)="onClose()" aria-label="Close">
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<div class="modal-body">
|
||||||
|
<form>
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="watch-date">Watch Date</label>
|
||||||
|
<input tabindex0 type="date" class="form-control" name="watch-date" [(ngModel)]="watchDate">
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="watched-with">Watched With</label>
|
||||||
|
<input type="text" class="form-control" name="watched-with" [(ngModel)]="watchedWith" placeholder="Enter names">
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
<div class="modal-footer">
|
||||||
|
<button type="button" class="btn btn-secondary" (click)="onClose()">Cancel</button>
|
||||||
|
<button type="button" class="btn btn-primary" (click)="onConfirm()">OK</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- </div> -->
|
||||||
@@ -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<SeenModalComponent>;
|
||||||
|
|
||||||
|
beforeEach(async () => {
|
||||||
|
await TestBed.configureTestingModule({
|
||||||
|
imports: [SeenModalComponent]
|
||||||
|
})
|
||||||
|
.compileComponents();
|
||||||
|
|
||||||
|
fixture = TestBed.createComponent(SeenModalComponent);
|
||||||
|
component = fixture.componentInstance;
|
||||||
|
fixture.detectChanges();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should create', () => {
|
||||||
|
expect(component).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -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<SeenModalComponent>,
|
||||||
|
@Inject(MAT_DIALOG_DATA) public data: any
|
||||||
|
) {}
|
||||||
|
|
||||||
|
onConfirm(): void {
|
||||||
|
this.dialogRef.close({
|
||||||
|
watchDate: this.watchDate,
|
||||||
|
watchedWith: this.watchedWith,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
onClose(): void {
|
||||||
|
this.dialogRef.close();
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in new issue
Block a user