From 40eed0016c22df453c634392ba9e34a76d3da4c8 Mon Sep 17 00:00:00 2001
From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com>
Date: Sun, 19 Feb 2023 10:36:52 +0100
Subject: [PATCH] Feature/migrate header module to angular material 15 (#1725)
* Migrate GfHeaderModule to Angular Material 15
* Update changelog
---
CHANGELOG.md | 1 +
.../components/header/header.component.html | 28 ++++++++-----------
.../components/header/header.component.scss | 4 ++-
.../app/components/header/header.module.ts | 4 +--
apps/client/src/styles.scss | 9 ++++++
5 files changed, 26 insertions(+), 20 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index af3dba18e..7fc6de4e8 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed
- Increased the file size limit for the activities import
+- Migrated the style of `GfHeaderModule` to `@angular/material` `15` (mdc)
- Upgraded `angular` from version `15.1.2` to `15.1.5`
- Upgraded `Nx` from version `15.6.3` to `15.7.2`
diff --git a/apps/client/src/app/components/header/header.component.html b/apps/client/src/app/components/header/header.component.html
index 5e060972b..2d3b1aee3 100644
--- a/apps/client/src/app/components/header/header.component.html
+++ b/apps/client/src/app/components/header/header.component.html
@@ -110,11 +110,7 @@
0">
-
Overview
Portfolio
Accounts
Pricing
About Ghostfolio
-
+
Logout
@@ -283,9 +277,9 @@
>Markets
diff --git a/apps/client/src/app/components/header/header.component.scss b/apps/client/src/app/components/header/header.component.scss
index b78df5e63..60d9b5ff9 100644
--- a/apps/client/src/app/components/header/header.component.scss
+++ b/apps/client/src/app/components/header/header.component.scss
@@ -11,7 +11,9 @@
flex: 1 1 auto;
}
- .mat-flat-button {
+ .mat-mdc-unelevated-button {
+ height: unset;
+
&:not(.mat-primary) {
background-color: transparent;
text-decoration-color: rgba(var(--palette-primary-500), 1) !important;
diff --git a/apps/client/src/app/components/header/header.module.ts b/apps/client/src/app/components/header/header.module.ts
index 35ec6ebf3..a3c61e8df 100644
--- a/apps/client/src/app/components/header/header.module.ts
+++ b/apps/client/src/app/components/header/header.module.ts
@@ -1,7 +1,7 @@
import { CommonModule } from '@angular/common';
import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core';
-import { MatLegacyButtonModule as MatButtonModule } from '@angular/material/legacy-button';
-import { MatLegacyMenuModule as MatMenuModule } from '@angular/material/legacy-menu';
+import { MatButtonModule } from '@angular/material/button';
+import { MatMenuModule } from '@angular/material/menu';
import { MatToolbarModule } from '@angular/material/toolbar';
import { RouterModule } from '@angular/router';
import { LoginWithAccessTokenDialogModule } from '@ghostfolio/client/components/login-with-access-token-dialog/login-with-access-token-dialog.module';
diff --git a/apps/client/src/styles.scss b/apps/client/src/styles.scss
index 181e4ab60..f26b3e617 100644
--- a/apps/client/src/styles.scss
+++ b/apps/client/src/styles.scss
@@ -420,6 +420,15 @@ ngx-skeleton-loader {
}
}
+.mat-mdc-menu-panel {
+ .mat-mdc-menu-item {
+ .mdc-list-item__primary-text {
+ align-items: center;
+ display: flex;
+ }
+ }
+}
+
.mat-mdc-unelevated-button {
&:not(:disabled) {
--mdc-filled-button-label-text-color: rgba(var(--light-primary-text));