Skip to content

Commit

Permalink
Merge pull request #219 from amosproj/feat/xd-143
Browse files Browse the repository at this point in the history
Feat/xd 143
  • Loading branch information
Hydraneut authored Jul 1, 2024
2 parents f07525f + 4de009f commit 3e4c0d7
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 33 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<ix-application-header name="Xcelerator Demo App">
<button class="placeholder-logo" slot="logo" [routerLink]="['/']">
<img
src="https://cdn.c2comms.cloud/images/logo-collection/2.1/sie-logo-white-rgb.svg"
[src]=getCorrectImage()
class="h-5"
alt="Siemens logo"
/>
Expand All @@ -25,6 +25,7 @@
<ix-menu>
<ix-menu-item icon="building1" [routerLink]="['/facilities']">Facilities</ix-menu-item>
<ix-menu-item icon="tasks-open" [routerLink]="['/cases']">Cases</ix-menu-item>
<ix-menu-item [icon]=getCorrectIcon() slot="bottom" (click)="toggleMode()">toggle theme</ix-menu-item>

<ix-menu-about>
<app-legal-information></app-legal-information>
Expand Down
20 changes: 20 additions & 0 deletions apps/frontend/src/app/components/header/header.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
} from '@angular/core';
import { toSignal } from '@angular/core/rxjs-interop';
import { ActivatedRoute, NavigationEnd, Router, RouterLink, RouterOutlet } from '@angular/router';
import { themeSwitcher } from '@siemens/ix';
import { IxModule } from '@siemens/ix-angular';
import { filter } from 'rxjs';

Expand All @@ -28,6 +29,7 @@ import { LegalInformationComponent } from './legal-information/legal-information
export class HeaderComponent {
private readonly _activatedRoute: ActivatedRoute = inject(ActivatedRoute);
private readonly _router: Router = inject(Router);
private _lightMode = false;

readonly routerEvents = toSignal(
this._router.events.pipe(filter((e) => e instanceof NavigationEnd)),
Expand Down Expand Up @@ -66,4 +68,22 @@ export class HeaderComponent {
return urlSegments.slice(0, urlSegments.length - n).join('/');
}

toggleMode() {
themeSwitcher.toggleMode();
this._lightMode = !this._lightMode;
}

getCorrectImage() {
if (this._lightMode) {
return "https://cdn.c2comms.cloud/images/logo-collection/2.1/sie-logo-black-rgb.svg";
}
return "https://cdn.c2comms.cloud/images/logo-collection/2.1/sie-logo-white-rgb.svg";
}

getCorrectIcon() {
if (this._lightMode) {
return "sun-filled";
}
return "sun";
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,27 @@
@import 'libs/cases/shared/models/src/lib/styles/case.scss';
.table {
cursor: pointer;
& .emergency {
background-color: #ff26401a;
}

.table .clickable-row {
cursor: pointer; /* Changes the cursor to a hand */
& .status-open {
}

& .status-inprogress {
color: #ff9000;
}

& .status-overdue {
color: #ff2640;
}

& .status-onhold {
color: #00b5d1;
}

& .status-done {
color: #01c151;
}
}

.toggle-pill {
Expand Down

This file was deleted.

28 changes: 0 additions & 28 deletions libs/cases/shared/models/src/lib/styles/case.scss

This file was deleted.

0 comments on commit 3e4c0d7

Please sign in to comment.