feat: add site header
This commit is contained in:
8
src/app/components/main-header/main-header.html
Normal file
8
src/app/components/main-header/main-header.html
Normal file
@@ -0,0 +1,8 @@
|
||||
<div class="bar-container">
|
||||
<div class="bar-container__elements">
|
||||
<div class="bar-container__action-button bar-container__action-button--left">
|
||||
<ng-content select="[slot='action-button']"></ng-content>
|
||||
</div>
|
||||
<h1 class="bar-container__title">{{title()|titlecase}}</h1>
|
||||
</div>
|
||||
</div>
|
||||
28
src/app/components/main-header/main-header.scss
Normal file
28
src/app/components/main-header/main-header.scss
Normal file
@@ -0,0 +1,28 @@
|
||||
.bar-container {
|
||||
background-color: var(--primaryDark);
|
||||
width: 100%;
|
||||
|
||||
&__elements {
|
||||
position: relative;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
margin: auto;
|
||||
max-width: 1100px;
|
||||
}
|
||||
|
||||
&__title {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
&__action-button {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 100%;
|
||||
justify-content: center;
|
||||
&--left {
|
||||
position: absolute;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
23
src/app/components/main-header/main-header.spec.ts
Normal file
23
src/app/components/main-header/main-header.spec.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { MainHeader } from './main-header';
|
||||
|
||||
describe('MainHeader', () => {
|
||||
let component: MainHeader;
|
||||
let fixture: ComponentFixture<MainHeader>;
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
imports: [MainHeader]
|
||||
})
|
||||
.compileComponents();
|
||||
|
||||
fixture = TestBed.createComponent(MainHeader);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
12
src/app/components/main-header/main-header.ts
Normal file
12
src/app/components/main-header/main-header.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
import { Component, input } from '@angular/core';
|
||||
import { TitleCasePipe } from '@angular/common';
|
||||
|
||||
@Component({
|
||||
selector: 'app-main-header',
|
||||
imports: [TitleCasePipe],
|
||||
templateUrl: './main-header.html',
|
||||
styleUrl: './main-header.scss',
|
||||
})
|
||||
export class MainHeader {
|
||||
title = input('');
|
||||
}
|
||||
Reference in New Issue
Block a user