Refactor header structure
Reorganized header component to use content projection for titles and simplified input properties.
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
import {Component, HostListener, Input} from '@angular/core';
|
||||
import {ALTITUDE_VERSION} from '../constant';
|
||||
|
||||
@Component({
|
||||
standalone: false,
|
||||
@@ -8,8 +7,6 @@ import {ALTITUDE_VERSION} from '../constant';
|
||||
styleUrls: ['./header.component.scss']
|
||||
})
|
||||
export class HeaderComponent {
|
||||
@Input() title: string = '';
|
||||
@Input() sub_title: string = '';
|
||||
@Input() current_page: string = '';
|
||||
@Input() background_image: string = '';
|
||||
|
||||
@@ -25,22 +22,10 @@ export class HeaderComponent {
|
||||
}
|
||||
}
|
||||
|
||||
scrollToSection(): void {
|
||||
const element = document.getElementById('scrollingpoint');
|
||||
if (element) {
|
||||
element.scrollIntoView({behavior: 'smooth', block: 'start'});
|
||||
} else {
|
||||
console.error('Element with id "scrollingpoint" not found.');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public getCurrentPageId(options: string[]) {
|
||||
if (options.includes(this.current_page)) {
|
||||
return 'current_page'
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
protected readonly ALTITUDE_VERSION = ALTITUDE_VERSION;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user