Skip to content

Commit a51cc26

Browse files
committed
feat(demo-app): added github link & enhanced meta tags data with description and image
1 parent d6baff6 commit a51cc26

File tree

15 files changed

+87
-13
lines changed

15 files changed

+87
-13
lines changed
Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
1-
1+
<div class="app-header">
2+
<h1>{{title}}</h1>
3+
<a href="https://github.com/katoid/angular-grid-layout" target="_blank">
4+
<button mat-icon-button>
5+
<mat-icon svgIcon="github" class="github-icon">
6+
</mat-icon>
7+
</button>
8+
</a>
9+
</div>
210
<router-outlet></router-outlet>
311

412

projects/demo-app/src/app/app.component.scss

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,26 @@
22
width: 100%;
33
display: block;
44
background: #121212;
5+
box-sizing: border-box;
6+
7+
.app-header {
8+
display: flex;
9+
align-items: center;
10+
justify-content: space-between;
11+
padding: 12px 24px;
12+
background-color: #222222;
13+
border-bottom: 1px solid #424242;
14+
15+
h1 {
16+
margin-bottom: 0;
17+
}
18+
19+
mat-icon.github-icon {
20+
line-height: 32px;
21+
width: 32px;
22+
height: 32px;
23+
}
24+
}
25+
26+
527
}
Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,28 @@
11
import { Component } from '@angular/core';
2+
import { MatIconRegistry } from '@angular/material/icon';
3+
import { DomSanitizer } from '@angular/platform-browser';
4+
import { ActivatedRoute, Router, RoutesRecognized } from '@angular/router';
25

6+
const defaultTitle = 'Angular Grid Layout';
37

48
@Component({
59
selector: 'ktd-root',
610
templateUrl: './app.component.html',
711
styleUrls: ['./app.component.scss']
812
})
913
export class KtdAppComponent {
14+
title: string = defaultTitle;
1015

16+
constructor(private matIconRegistry: MatIconRegistry, private domSanitizer: DomSanitizer, private router: Router, private readonly route: ActivatedRoute) {
17+
this.matIconRegistry.addSvgIcon(
18+
`github`,
19+
this.domSanitizer.bypassSecurityTrustResourceUrl(`assets/logos/github.svg`)
20+
);
1121

12-
constructor() {
22+
this.router.events.subscribe((data) => {
23+
if (data instanceof RoutesRecognized) {
24+
this.title = data.state.root.firstChild?.data.title || defaultTitle;
25+
}
26+
});
1327
}
1428
}

projects/demo-app/src/app/app.module.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ import { NgModule } from '@angular/core';
33
import { KtdAppComponent } from './app.component';
44
import { KtdAppRoutingModule } from './app-routing.module';
55
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
6+
import { HttpClientModule } from '@angular/common/http';
7+
import { MatIconModule } from '@angular/material/icon';
8+
import { MatButtonModule } from '@angular/material/button';
69

710
@NgModule({
811
declarations: [
@@ -11,7 +14,10 @@ import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
1114
imports: [
1215
BrowserModule,
1316
BrowserAnimationsModule,
14-
KtdAppRoutingModule
17+
KtdAppRoutingModule,
18+
HttpClientModule,
19+
MatIconModule,
20+
MatButtonModule
1521
],
1622
providers: [],
1723
bootstrap: [KtdAppComponent]

projects/demo-app/src/app/custom-handles/custom-handles.component.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
<h1>Angular Grid Layout - Custom handles</h1>
21
<div class="grid-container">
32
<ktd-grid cols="12"
43
rowHeight="50"

projects/demo-app/src/app/custom-handles/custom-handles.module.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,11 @@ import { RouterModule, Routes } from '@angular/router';
66
import { MatIconModule } from '@angular/material/icon';
77

88
const routes: Routes = [
9-
{path: 'custom-handles', component: KtdCustomHandlesComponent},
9+
{
10+
path: 'custom-handles',
11+
component: KtdCustomHandlesComponent,
12+
data: {title: 'Angular Grid Layout - Custom handles'}
13+
},
1014
];
1115

1216
@NgModule({

projects/demo-app/src/app/playground/playground.component.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
<h1>Angular Grid Layout - Playground</h1>
21
<div class="playground-container">
32
<div class="layout-json">
43
</div>

projects/demo-app/src/app/playground/playground.module.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,11 @@ import { MatInputModule } from '@angular/material/input';
1010
import { MatChipsModule } from '@angular/material/chips';
1111

1212
const routes: Routes = [
13-
{path: 'playground', component: KtdPlaygroundComponent},
13+
{
14+
path: 'playground',
15+
component: KtdPlaygroundComponent,
16+
data: {title: 'Angular Grid Layout - Playground'}
17+
},
1418
];
1519

1620

projects/demo-app/src/app/real-life-example/real-life-example.component.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
<h1>Angular Grid Layout - Real life example</h1>
21
<div class="grid-container">
32
<ktd-grid [cols]="cols"
43
[rowHeight]="rowHeight"

projects/demo-app/src/app/real-life-example/real-life-example.module.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,11 @@ import { KtdTableSortingComponent } from './table-sorting/table-sorting.componen
1111
import { MatSortModule } from '@angular/material/sort';
1212

1313
const routes: Routes = [
14-
{path: 'real-life-example', component: KtdRealLifeExampleComponent},
14+
{
15+
path: 'real-life-example',
16+
component: KtdRealLifeExampleComponent,
17+
data: {title: 'Angular Grid Layout - Real life example'}
18+
},
1519
];
1620

1721
@NgModule({

0 commit comments

Comments
 (0)