-
Notifications
You must be signed in to change notification settings - Fork 0
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
65fe807
commit 92de08e
Showing
7 changed files
with
73 additions
and
16 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,8 @@ | ||
<p>home works!</p> | ||
<div class="p-1"> | ||
<p-menubar [model]="menuItems"> | ||
<ng-template #end> | ||
<p-menu #userMenu [popup]="true" [model]="userMenuItems"/> | ||
Check notice on line 4 in src/app/pages/home/home.component.html
|
||
<p-avatar class="cursor-pointer" (click)="userMenu.toggle($event)" [image]="principal()?.avatar" shape="circle"/> | ||
Check notice on line 5 in src/app/pages/home/home.component.html
|
||
</ng-template> | ||
</p-menubar> | ||
</div> |
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,3 @@ | ||
:host { | ||
@apply grid grid-rows-[auto_1fr] w-full h-full; | ||
} |
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,11 +1,32 @@ | ||
import { Component } from '@angular/core'; | ||
import { Menubar } from 'primeng/menubar'; | ||
import { MenuItem } from 'primeng/api'; | ||
import { dispatch, select } from '@ngxs/store'; | ||
import { principal, SignOut } from '../../state/user'; | ||
import { Avatar } from 'primeng/avatar'; | ||
import { Menu } from 'primeng/menu'; | ||
|
||
@Component({ | ||
selector: 'tm-home', | ||
imports: [], | ||
imports: [ | ||
Menubar, | ||
Avatar, | ||
Menu | ||
], | ||
templateUrl: './home.component.html', | ||
styleUrl: './home.component.scss' | ||
}) | ||
export class HomeComponent { | ||
|
||
private readonly signOut = dispatch(SignOut); | ||
readonly principal = select(principal); | ||
readonly menuItems: MenuItem[] = [ | ||
{ label: 'Home', routerLink: '/', icon: 'pi pi-home', routerLinkActiveOptions: { match: true } }, | ||
]; | ||
readonly userMenuItems: MenuItem[] = [ | ||
{ label: 'Profile', icon: 'pi pi-user', routerLink: '/auth/profile' }, | ||
{ separator: true }, | ||
{ | ||
label: 'Sign out', icon: 'pi pi-sign-out', command: () => this.signOut() | ||
}, | ||
] | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
@import "primeicons/primeicons.css"; | ||
@layer tailwind-base, primeng, tailwind-utilities; | ||
|
||
@layer tailwind-base { | ||
|