added close btn
This commit is contained in:
parent
bd8b4e14da
commit
54c38b73dc
5 changed files with 46 additions and 21 deletions
|
|
@ -2,7 +2,10 @@
|
||||||
<div class="overlay-content">
|
<div class="overlay-content">
|
||||||
@if (overlayType === "taskOverlay") {
|
@if (overlayType === "taskOverlay") {
|
||||||
<div class="task-overlay">
|
<div class="task-overlay">
|
||||||
<app-task-overlay [overlayData]="overlayData"></app-task-overlay>
|
<app-task-overlay
|
||||||
|
[overlayData]="overlayData"
|
||||||
|
(closeDialogEmitter)="onCloseOverlay($event)"
|
||||||
|
></app-task-overlay>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,10 @@
|
||||||
import { Component, HostListener, OnInit } from '@angular/core';
|
import {
|
||||||
|
Component,
|
||||||
|
EventEmitter,
|
||||||
|
HostListener,
|
||||||
|
OnInit,
|
||||||
|
Output,
|
||||||
|
} from '@angular/core';
|
||||||
import { OverlayService } from '../../../services/overlay.service';
|
import { OverlayService } from '../../../services/overlay.service';
|
||||||
import { CommonModule } from '@angular/common';
|
import { CommonModule } from '@angular/common';
|
||||||
import { TaskOverlayComponent } from './task-overlay/task-overlay.component';
|
import { TaskOverlayComponent } from './task-overlay/task-overlay.component';
|
||||||
|
|
@ -25,8 +31,8 @@ export class OverlayComponent implements OnInit {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
onCloseOverlay() {
|
onCloseOverlay(emitter: string) {
|
||||||
this.overlayData = '';
|
this.overlayData = emitter;
|
||||||
}
|
}
|
||||||
|
|
||||||
@HostListener('document:click', ['$event'])
|
@HostListener('document:click', ['$event'])
|
||||||
|
|
@ -36,7 +42,7 @@ export class OverlayComponent implements OnInit {
|
||||||
targetElement.closest('.overlay') &&
|
targetElement.closest('.overlay') &&
|
||||||
!targetElement.closest('.overlay-content')
|
!targetElement.closest('.overlay-content')
|
||||||
) {
|
) {
|
||||||
this.onCloseOverlay();
|
this.onCloseOverlay('');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
<section>
|
<section>
|
||||||
|
<div class="header">
|
||||||
<div
|
<div
|
||||||
class="category"
|
class="category"
|
||||||
[style.background-color]="
|
[style.background-color]="
|
||||||
|
|
@ -7,6 +8,8 @@
|
||||||
>
|
>
|
||||||
{{ getTask(overlayData)[0].category }}
|
{{ getTask(overlayData)[0].category }}
|
||||||
</div>
|
</div>
|
||||||
|
<app-btn-close (click)="sendMessage()"></app-btn-close>
|
||||||
|
</div>
|
||||||
<div class="headline">{{ getTask(overlayData)[0].title }}</div>
|
<div class="headline">{{ getTask(overlayData)[0].title }}</div>
|
||||||
<div class="description">
|
<div class="description">
|
||||||
{{ getTask(overlayData)[0].description }}
|
{{ getTask(overlayData)[0].description }}
|
||||||
|
|
|
||||||
|
|
@ -6,8 +6,17 @@ section {
|
||||||
background-color: var(--white);
|
background-color: var(--white);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.header {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
}
|
||||||
|
|
||||||
.category {
|
.category {
|
||||||
font-size: 16px;
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
font-size: 23px;
|
||||||
|
font-weight: 400;
|
||||||
padding: 4px 16px;
|
padding: 4px 16px;
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
color: var(--white);
|
color: var(--white);
|
||||||
|
|
@ -16,16 +25,14 @@ section {
|
||||||
|
|
||||||
.headline {
|
.headline {
|
||||||
color: var(--dark-blue);
|
color: var(--dark-blue);
|
||||||
font-size: 16px;
|
font-size: 61px;
|
||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
margin-top: 40px;
|
margin-top: 32px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.description {
|
.description {
|
||||||
color: var(--gray);
|
color: var(--gray);
|
||||||
font-size: 16px;
|
font-size: 20px;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
margin-top: 8px;
|
margin-top: 32px;
|
||||||
max-height: 100px;
|
|
||||||
overflow: auto;
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,15 +1,17 @@
|
||||||
import { Component, Input } from '@angular/core';
|
import { Component, EventEmitter, Input, Output } from '@angular/core';
|
||||||
import { FirebaseService } from '../../../../services/firebase.service';
|
import { FirebaseService } from '../../../../services/firebase.service';
|
||||||
|
import { BtnCloseComponent } from '../../buttons/btn-close/btn-close.component';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-task-overlay',
|
selector: 'app-task-overlay',
|
||||||
standalone: true,
|
standalone: true,
|
||||||
imports: [],
|
imports: [BtnCloseComponent],
|
||||||
templateUrl: './task-overlay.component.html',
|
templateUrl: './task-overlay.component.html',
|
||||||
styleUrl: './task-overlay.component.scss',
|
styleUrl: './task-overlay.component.scss',
|
||||||
})
|
})
|
||||||
export class TaskOverlayComponent {
|
export class TaskOverlayComponent {
|
||||||
@Input() overlayData: string = '';
|
@Input() overlayData: string = '';
|
||||||
|
@Output() closeDialogEmitter = new EventEmitter<string>();
|
||||||
|
|
||||||
constructor(private firebaseService: FirebaseService) {}
|
constructor(private firebaseService: FirebaseService) {}
|
||||||
|
|
||||||
|
|
@ -18,6 +20,10 @@ export class TaskOverlayComponent {
|
||||||
['Technical Task', '#20d7c2'],
|
['Technical Task', '#20d7c2'],
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
sendMessage() {
|
||||||
|
this.closeDialogEmitter.emit('');
|
||||||
|
}
|
||||||
|
|
||||||
getTask(taskId: string) {
|
getTask(taskId: string) {
|
||||||
return this.firebaseService
|
return this.firebaseService
|
||||||
.getAllTasks()
|
.getAllTasks()
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue