-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a612e3e
commit 51c53b0
Showing
31 changed files
with
197 additions
and
172 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 0 additions & 13 deletions
13
apps/taiga-lumbermill/src/components/dashboards-list/dashboards-list.component.html
This file was deleted.
Oops, something went wrong.
46 changes: 0 additions & 46 deletions
46
apps/taiga-lumbermill/src/components/dashboards-list/dashboards-list.component.ts
This file was deleted.
Oops, something went wrong.
28 changes: 28 additions & 0 deletions
28
apps/taiga-lumbermill/src/components/list/list.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<nav | ||
tuiNavigationNav | ||
[style.position]="'sticky'" | ||
> | ||
<a routerLink="/"> | ||
<tui-icon icon="@tui.chevron-left" /> | ||
Back | ||
</a> | ||
/ | ||
<span tuiNavigationLogo> | ||
<span tuiFade>{{ type() }}</span> | ||
</span> | ||
<hr /> | ||
</nav> | ||
|
||
@for (card of list(); track $index) { | ||
<a | ||
tuiCardLarge | ||
tuiHeader | ||
tuiSurface="elevated" | ||
[routerLink]="card.link" | ||
> | ||
<h2 tuiTitle> | ||
{{ card.title }} | ||
<span tuiSubtitle>{{ card.description }}</span> | ||
</h2> | ||
</a> | ||
} |
1 change: 0 additions & 1 deletion
1
...oards-list/dashboards-list.component.less → ...l/src/components/list/list.component.less
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
:host { | ||
display: flex; | ||
padding-top: 1rem; | ||
flex-direction: column; | ||
gap: 1rem; | ||
} |
72 changes: 72 additions & 0 deletions
72
apps/taiga-lumbermill/src/components/list/list.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
import {CommonModule} from '@angular/common'; | ||
import {ChangeDetectionStrategy, Component, computed, inject} from '@angular/core'; | ||
import {toSignal} from '@angular/core/rxjs-interop'; | ||
import {NavigationEnd, Router, RouterLink, RouterOutlet} from '@angular/router'; | ||
import {TuiIcon, TuiSurface, TuiTitle} from '@taiga-ui/core'; | ||
import {TuiCardLarge, TuiHeader, TuiLogoComponent, TuiNavigation} from '@taiga-ui/layout'; | ||
import {filter, map, startWith} from 'rxjs'; | ||
|
||
interface CardData { | ||
readonly title: string; | ||
readonly link: string; | ||
readonly description: string; | ||
} | ||
|
||
const LIST: {Dashboards: CardData[]; Pages: CardData[]} = { | ||
Dashboards: [ | ||
{ | ||
title: 'Iot Dashboard', | ||
link: '/dashboards/iot', | ||
description: 'Smart home dashboard', | ||
}, | ||
{ | ||
title: 'Crypto Dashboard', | ||
link: '/dashboards/crypto', | ||
description: 'Crypto token dashboard', | ||
}, | ||
], | ||
Pages: [ | ||
{ | ||
title: 'Login', | ||
link: '/pages/login', | ||
description: 'Ready to use login page', | ||
}, | ||
{ | ||
title: 'Sign up', | ||
link: '/pages/login', | ||
description: 'Ready to use registration page', | ||
}, | ||
], | ||
}; | ||
|
||
@Component({ | ||
standalone: true, | ||
selector: 'lmb-dashboards-list', | ||
imports: [ | ||
CommonModule, | ||
RouterLink, | ||
RouterOutlet, | ||
TuiCardLarge, | ||
TuiHeader, | ||
TuiIcon, | ||
TuiLogoComponent, | ||
TuiNavigation, | ||
TuiSurface, | ||
TuiTitle, | ||
], | ||
templateUrl: './list.component.html', | ||
styleUrl: './list.component.less', | ||
changeDetection: ChangeDetectionStrategy.OnPush, | ||
}) | ||
export class ListComponent { | ||
protected readonly router = inject(Router); | ||
protected readonly type = toSignal( | ||
this.router.events.pipe( | ||
filter((event) => event instanceof NavigationEnd), | ||
startWith(null), | ||
map(() => (this.router.url.includes('dashboards') ? 'Dashboards' : 'Pages')), | ||
), | ||
); | ||
|
||
protected readonly list = computed(() => LIST[this.type() ?? 'Pages']); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
apps/taiga-lumbermill/src/dashboards/crypto/crypto.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.