feat: create and integrate HeadlineComponent, replace all headlines across the app

This commit is contained in:
Chneemann 2025-04-15 04:50:11 +02:00
parent dc9585c4c1
commit 82af32ab5c
16 changed files with 160 additions and 173 deletions

View file

@ -8,7 +8,7 @@
class="header" class="header"
[ngStyle]="{ display: overlayData !== '' ? 'none' : 'block' }" [ngStyle]="{ display: overlayData !== '' ? 'none' : 'block' }"
> >
<div class="title">{{ "addTask.headline" | translate }}</div> <app-headline [title]="'addTask.headline' | translate"></app-headline>
</div> </div>
<form <form

View file

@ -78,10 +78,6 @@ select:valid {
.header { .header {
margin-bottom: 48px; margin-bottom: 48px;
.title {
font-size: 61px;
font-weight: 700;
}
} }
/*------------- LEFT SIDE -------------*/ /*------------- LEFT SIDE -------------*/
@ -265,9 +261,6 @@ select:valid {
@media screen and (max-width: 950px) { @media screen and (max-width: 950px) {
.header { .header {
margin-bottom: 24px; margin-bottom: 24px;
.title {
font-size: 50px;
}
} }
} }

View file

@ -13,6 +13,7 @@ import { TaskService } from '../../services/task.service';
import { ApiService } from '../../services/api.service'; import { ApiService } from '../../services/api.service';
import { UpdateNotifierService } from '../../services/update-notifier.service'; import { UpdateNotifierService } from '../../services/update-notifier.service';
import { ToastNotificationService } from '../../services/toast-notification.service'; import { ToastNotificationService } from '../../services/toast-notification.service';
import { HeadlineComponent } from '../../shared/components/headline/headline.component';
@Component({ @Component({
selector: 'app-add-task', selector: 'app-add-task',
@ -20,6 +21,7 @@ import { ToastNotificationService } from '../../services/toast-notification.serv
imports: [ imports: [
FormsModule, FormsModule,
CommonModule, CommonModule,
HeadlineComponent,
AssignedComponent, AssignedComponent,
FormBtnComponent, FormBtnComponent,
TranslateModule, TranslateModule,

View file

@ -1,6 +1,6 @@
<section> <section>
<div class="header"> <div class="header">
<div class="title">{{ "board.headline" | translate }}</div> <app-headline [title]="'Board'"></app-headline>
<div class="search"> <div class="search">
<div class="search-inner"> <div class="search-inner">
<input <input

View file

@ -4,12 +4,6 @@ section {
padding-bottom: 32px; padding-bottom: 32px;
} }
.title {
font-size: 61px;
font-weight: 700;
padding-right: 24px;
}
/*------------- HEADER -------------*/ /*------------- HEADER -------------*/
.header { .header {
@ -112,7 +106,7 @@ d-none {
flex-wrap: wrap; flex-wrap: wrap;
width: 100%; width: 100%;
margin-top: 48px; margin-top: 48px;
gap: 32px; gap: 28px;
} }
.headline { .headline {
@ -140,7 +134,7 @@ d-none {
.column { .column {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
width: 270px; width: 265px;
&:first-child { &:first-child {
padding-left: 0; padding-left: 0;
} }
@ -168,14 +162,6 @@ d-none {
display: none; display: none;
} }
} }
.title {
font-size: 50px;
}
.status {
justify-content: center;
}
} }
@media screen and (max-width: 750px) { @media screen and (max-width: 750px) {
@ -184,10 +170,6 @@ d-none {
align-items: flex-start; align-items: flex-start;
} }
.title {
margin-bottom: 24px;
}
.search { .search {
width: 100%; width: 100%;
.search-inner { .search-inner {

View file

@ -16,12 +16,14 @@ import { debounceTime, finalize, Subject, take, takeUntil } from 'rxjs';
import { UpdateNotifierService } from '../../services/update-notifier.service'; import { UpdateNotifierService } from '../../services/update-notifier.service';
import { ToastNotificationService } from '../../services/toast-notification.service'; import { ToastNotificationService } from '../../services/toast-notification.service';
import { ResizeService } from '../../services/resize.service'; import { ResizeService } from '../../services/resize.service';
import { HeadlineComponent } from '../../shared/components/headline/headline.component';
@Component({ @Component({
selector: 'app-board', selector: 'app-board',
standalone: true, standalone: true,
imports: [ imports: [
CommonModule, CommonModule,
HeadlineComponent,
TaskComponent, TaskComponent,
TaskEmptyComponent, TaskEmptyComponent,
FormsModule, FormsModule,

View file

@ -1,12 +1,9 @@
<section> <section>
<div class="header"> <div class="header">
<div class="headline"> <app-headline
<div class="title">{{ "contacts.headline" | translate }}</div> [title]="'contacts.headline' | translate"
<div class="blue-bar"></div> [description]="'contacts.headlineDescription' | translate"
<div class="metrics-txt"> ></app-headline>
{{ "contacts.headlineDescription" | translate }}
</div>
</div>
<div <div
class="btn-back" class="btn-back"
[ngClass]="{ 'd-none': !selectedUserId }" [ngClass]="{ 'd-none': !selectedUserId }"

View file

@ -29,28 +29,6 @@
} }
} }
.headline {
display: flex;
align-items: center;
position: relative;
height: 73px;
.title {
font-size: 61px;
font-weight: 700;
padding-right: 24px;
}
.metrics-txt {
font-size: 27px;
font-weight: 400;
padding-left: 24px;
}
.blue-bar {
height: 80%;
width: 3px;
background-color: var(--light-blue);
}
}
.content { .content {
display: flex; display: flex;
align-items: center; align-items: center;
@ -239,34 +217,7 @@
/*------------- RESPONSIVE -------------*/ /*------------- RESPONSIVE -------------*/
@media screen and (max-width: 1300px) {
.headline {
.title {
font-size: 50px;
}
.metrics-txt {
font-size: 24px;
}
}
}
@media screen and (max-width: 1235px) { @media screen and (max-width: 1235px) {
.headline {
flex-direction: column;
align-items: flex-start;
padding-left: 0;
height: 100%;
.metrics-txt {
padding-left: 0;
}
.blue-bar {
position: absolute;
bottom: -15px;
height: 3px;
width: 100px;
}
}
.name { .name {
display: block; display: block;
font-size: 32px; font-size: 32px;
@ -298,15 +249,4 @@
font-weight: 400; font-weight: 400;
} }
} }
.headline {
.title {
font-size: 47px;
font-weight: 700;
}
.metrics-txt {
font-size: 20px;
font-weight: 400;
}
}
} }

View file

@ -17,11 +17,12 @@ import { OverlayService } from '../../../services/overlay.service';
import { ApiService } from '../../../services/api.service'; import { ApiService } from '../../../services/api.service';
import { ToastNotificationService } from '../../../services/toast-notification.service'; import { ToastNotificationService } from '../../../services/toast-notification.service';
import { UpdateNotifierService } from '../../../services/update-notifier.service'; import { UpdateNotifierService } from '../../../services/update-notifier.service';
import { HeadlineComponent } from '../../../shared/components/headline/headline.component';
@Component({ @Component({
selector: 'app-contact-detail', selector: 'app-contact-detail',
standalone: true, standalone: true,
imports: [CommonModule, TranslateModule], imports: [HeadlineComponent, CommonModule, TranslateModule],
templateUrl: './contact-detail.component.html', templateUrl: './contact-detail.component.html',
styleUrl: './contact-detail.component.scss', styleUrl: './contact-detail.component.scss',
}) })

View file

@ -1,11 +1,8 @@
<section> <section>
<div class="header"> <app-headline
<div class="title">Join 360</div> [title]="'Join 360'"
<div class="blue-bar"></div> [description]="'summary.headlineDescription' | translate"
<div class="metrics-txt"> ></app-headline>
{{ "summary.headlineDescription" | translate }}
</div>
</div>
@if (!isLoading) { @if (!isLoading) {
<div class="content"> <div class="content">
<div class="summary-container"> <div class="summary-container">

View file

@ -1,28 +1,3 @@
.header {
display: flex;
align-items: center;
position: relative;
height: 73px;
.title {
font-size: 61px;
font-weight: 700;
padding-right: 24px;
}
.metrics-txt {
font-size: 27px;
font-weight: 400;
padding-left: 24px;
}
.blue-bar {
height: 80%;
width: 3px;
background-color: var(--light-blue);
}
}
.content { .content {
display: flex; display: flex;
margin-top: 48px; margin-top: 48px;
@ -192,39 +167,6 @@
} }
} }
@media screen and (max-width: 1020px) {
.header {
.title {
font-size: 50px;
}
.metrics-txt {
font-size: 24px;
}
}
}
@media screen and (max-width: 700px) {
.header {
flex-direction: column;
align-items: start;
padding: 0;
width: 100%;
height: 100%;
.metrics-txt {
padding: 0;
}
.blue-bar {
position: absolute;
bottom: -15px;
height: 3px;
width: 100px;
}
}
}
@media screen and (max-width: 650px) { @media screen and (max-width: 650px) {
.summary-container { .summary-container {
width: auto; width: auto;
@ -327,16 +269,6 @@
} }
@media screen and (max-width: 470px) { @media screen and (max-width: 470px) {
.header {
.title {
font-size: 47px;
}
.metrics-txt {
font-size: 20px;
}
}
.todo-done, .todo-done,
.urgent, .urgent,
.tasks { .tasks {

View file

@ -8,11 +8,17 @@ import { finalize, Subject, takeUntil } from 'rxjs';
import { UserService } from '../../services/user.service'; import { UserService } from '../../services/user.service';
import { User } from '../../interfaces/user.interface'; import { User } from '../../interfaces/user.interface';
import { HeadlineComponent } from '../../shared/components/headline/headline.component';
@Component({ @Component({
selector: 'app-summary', selector: 'app-summary',
standalone: true, standalone: true,
imports: [RouterModule, TranslateModule, LoadingSpinnerComponent], imports: [
RouterModule,
TranslateModule,
LoadingSpinnerComponent,
HeadlineComponent,
],
templateUrl: './summary.component.html', templateUrl: './summary.component.html',
styleUrl: './summary.component.scss', styleUrl: './summary.component.scss',
}) })

View file

@ -0,0 +1,10 @@
<div class="headline" [class.is-contacts]="isContacts">
<div class="title">{{ title }}</div>
@if (description) {
<div class="blue-bar"></div>
<div class="description">
{{ description }}
</div>
}
</div>

View file

@ -0,0 +1,83 @@
.headline {
display: flex;
align-items: center;
position: relative;
height: 73px;
.title {
font-size: 61px;
font-weight: 700;
padding-right: 24px;
}
.description {
font-size: 27px;
font-weight: 400;
padding-left: 24px;
}
.blue-bar {
height: 80%;
width: 3px;
background-color: var(--light-blue);
}
}
/*------------- MIXIN -------------*/
@mixin mobileHeadlineLayout {
flex-direction: column;
align-items: start;
padding: 0;
width: 100%;
height: 100%;
.description {
padding: 0;
}
.blue-bar {
position: absolute;
bottom: -15px;
height: 3px;
width: 100px;
}
}
/*------------- RESPONSIVE -------------*/
@media screen and (max-width: 1020px) {
.headline {
.title {
font-size: 50px;
}
.description {
font-size: 24px;
}
}
}
@media screen and (max-width: 1235px) {
.headline.is-contacts {
@include mobileHeadlineLayout;
}
}
@media screen and (max-width: 700px) {
.headline {
@include mobileHeadlineLayout;
}
}
@media screen and (max-width: 470px) {
.headline {
.title {
font-size: 47px;
}
.description {
font-size: 20px;
}
}
}

View file

@ -0,0 +1,23 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { HeadlineComponent } from './headline.component';
describe('HeadlineComponent', () => {
let component: HeadlineComponent;
let fixture: ComponentFixture<HeadlineComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [HeadlineComponent]
})
.compileComponents();
fixture = TestBed.createComponent(HeadlineComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View file

@ -0,0 +1,19 @@
import { CommonModule } from '@angular/common';
import { Component, Input } from '@angular/core';
import { TranslateModule } from '@ngx-translate/core';
@Component({
selector: 'app-headline',
standalone: true,
imports: [TranslateModule],
templateUrl: './headline.component.html',
styleUrl: './headline.component.scss',
})
export class HeadlineComponent {
@Input() title: string = '';
@Input() description: string = '';
get isContacts(): boolean {
return this.title === 'Contacts' || this.title === 'Kontakte';
}
}