improvements are done
This commit is contained in:
@@ -16,7 +16,7 @@
|
||||
@if (!loading() && !error()) {
|
||||
<div class="projects-grid">
|
||||
@for (project of projects(); track project.id) {
|
||||
<mat-card class="project-card" (click)="openProject(project.id)">
|
||||
<mat-card class="project-card" [class.selected]="currentProjectId() === project.id" (click)="openProject(project.id)">
|
||||
<mat-card-header>
|
||||
@if (project.logoUrl) {
|
||||
<img [src]="project.logoUrl" [alt]="project.displayName" class="project-logo">
|
||||
|
||||
@@ -39,6 +39,15 @@
|
||||
box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
|
||||
}
|
||||
|
||||
&.selected {
|
||||
border: 2px solid #1976d2;
|
||||
box-shadow: 0 4px 12px rgba(25, 118, 210, 0.3);
|
||||
|
||||
&:hover {
|
||||
box-shadow: 0 8px 16px rgba(25, 118, 210, 0.4);
|
||||
}
|
||||
}
|
||||
|
||||
mat-card-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
@@ -17,6 +17,7 @@ export class ProjectsDashboardComponent implements OnInit {
|
||||
projects = signal<Project[]>([]);
|
||||
loading = signal(true);
|
||||
error = signal<string | null>(null);
|
||||
currentProjectId = signal<string | null>(null);
|
||||
|
||||
constructor(
|
||||
private apiService: ApiService,
|
||||
@@ -25,6 +26,22 @@ export class ProjectsDashboardComponent implements OnInit {
|
||||
|
||||
ngOnInit() {
|
||||
this.loadProjects();
|
||||
|
||||
// Check if we're currently viewing a project
|
||||
const urlSegments = this.router.url.split('/');
|
||||
if (urlSegments[1] === 'project' && urlSegments[2]) {
|
||||
this.currentProjectId.set(urlSegments[2]);
|
||||
}
|
||||
|
||||
// Listen to route changes
|
||||
this.router.events.subscribe(() => {
|
||||
const segments = this.router.url.split('/');
|
||||
if (segments[1] === 'project' && segments[2]) {
|
||||
this.currentProjectId.set(segments[2]);
|
||||
} else {
|
||||
this.currentProjectId.set(null);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
loadProjects() {
|
||||
|
||||
Reference in New Issue
Block a user