Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add common-page #111

Merged
merged 7 commits into from
Aug 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"forecastday",
"mintemp",
"maxtemp",
"Tiko"
"Tiko",
"Create"
]
}
7 changes: 7 additions & 0 deletions apps/taiga-lumbermill/src/components/app/app.routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,12 @@ export const appRoutes: Route[] = [
},
],
},
{
path: '',
loadComponent: async () =>
import('../../dashboards/common-page/common-page.component').then(
(mod) => mod.CommonPageComponent,
),
},
{path: '**', redirectTo: 'dashboards'},
];
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<header
tuiHeader="l"
[style.margin-top]="'1.25rem'"
>
<h2
tuiTitle
[style.text-align]="'center'"
>
Taiga Lumbermill
</h2>
</header>
<p class="description">
This project contains a comprehensive set of ready-made templates, dashboards, and pages built using the Taiga UI
component library. Our goal is to provide developers with a robust foundation for quickly creating beautiful and
functional web applications.
</p>
<div class="row">
<div
routerLink="/dashboards"
tuiAppearance="whiteblock"
tuiCardLarge="normal"
class="card"
>
<div>
<header tuiHeader>
<h2
tuiTitle
[style.text-align]="'center'"
>
Dashboards
</h2>
</header>
</div>
</div>
<div
routerLink="/theme"
tuiAppearance="whiteblock"
tuiCardLarge="normal"
class="card"
>
<div>
<header tuiHeader>
<h2
tuiTitle
[style.text-align]="'center'"
>
Theme generator
</h2>
</header>
</div>
</div>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
.description {
margin-top: 0.75rem;
font-size: 0.9rem;
text-align: center;
margin-left: auto;
margin-right: auto;
max-width: 40rem;
}

.row {
display: flex;
margin-top: 1.25rem;
gap: 1.25rem;
justify-content: space-between;

@media (max-width: 800px) {
flex-direction: column;
}
}

.card {
flex-grow: 1;

@media (max-width: 800px) {
width: 100%;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import {CommonModule} from '@angular/common';
import {ChangeDetectionStrategy, Component} from '@angular/core';
import {RouterLink} from '@angular/router';
import {TuiAppearance, TuiTitle} from '@taiga-ui/core';
import {TuiCardLarge, TuiHeader} from '@taiga-ui/layout';

@Component({
standalone: true,
selector: 'lmb-common-page',
imports: [CommonModule, RouterLink, TuiAppearance, TuiCardLarge, TuiHeader, TuiTitle],
templateUrl: './common-page.component.html',
styleUrl: './common-page.component.less',
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class CommonPageComponent {}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ interface DashboardsData {
readonly description: string;
}

const INITIAL_DATA: DashboardsData[] = [
export const INITIAL_DATA: DashboardsData[] = [
{
title: 'Iot Dashboard',
link: '/dashboards/iot',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@
tuiNavigationNav
[style.position]="'sticky'"
>
<a routerLink="/dashboards">
@let title = (data$ | async) ?? '';
<a [routerLink]="title ? '/dashboards' : '/'">
<tui-icon icon="@tui.chevron-left" />
Back
</a>
/
<span tuiNavigationLogo>
<span tuiFade>{{ (data$ | async) ?? '' }} dashboard</span>
<span tuiFade>{{ title }} dashboard</span>
</span>
<hr />
</nav>
Expand Down
Loading