Skip to content

Open Source Wealth Management Software. Angular + NestJS + Prisma + Nx + TypeScript 🤍

Improve sidebar (#2343)

Thomas Kaul6f6ff9497986
diff --git a/CHANGELOG.md b/CHANGELOG.md
index fff9bb217b..9e10fe5f4a 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed
+- Improved the style of the system message
- Upgraded _Postgres_ from version `12` to `15` in the `docker-compose` files
## 2.1.0 - 2023-09-15
diff --git a/apps/client/src/app/app.component.html b/apps/client/src/app/app.component.html
index c9457cfc0c..b8dfbdb9c5 100644
--- a/apps/client/src/app/app.component.html
+++ b/apps/client/src/app/app.component.html
@@ -1,37 +1,26 @@
<header>
- <gf-header
- class="position-fixed w-100"
- [currentRoute]="currentRoute"
- [info]="info"
- [pageTitle]="pageTitle"
- [user]="user"
- (signOut)="onSignOut()"
- ></gf-header>
-</header>
-
-<main role="main">
<div
*ngIf="canCreateAccount || (info?.systemMessage && user)"
- class="container info-message-container"
+ class="info-message-container"
>
- <div class="row">
- <div class="col-md-8 offset-md-2 text-center">
+ <div class="info-message-inner-container position-fixed w-100">
+ <div class="align-items-center d-flex h-100 justify-content-center">
<a
*ngIf="canCreateAccount"
class="text-center"
[routerLink]="routerLinkRegister"
>
<div
- class="cursor-pointer d-inline-block info-message px-3 py-2"
+ class="cursor-pointer d-inline-block info-message"
(click)="onCreateAccount()"
>
- <span>You are using the Live Demo.</span>
- <span class="a ml-2">Create Account</span>
+ <span i18n>You are using the Live Demo.</span>
+ <span class="a ml-2" i18n>Create Account</span>
</div></a
>
<div
*ngIf="!canCreateAccount && info?.systemMessage && user"
- class="cursor-pointer d-inline-block info-message px-3 py-2 text-truncate"
+ class="cursor-pointer d-inline-block info-message text-truncate"
(click)="onShowSystemMessage()"
>
{{ info.systemMessage }}
@@ -40,6 +29,18 @@
</div>
</div>
+ <gf-header
+ class="position-fixed w-100"
+ [currentRoute]="currentRoute"
+ [hasTabs]="hasTabs"
+ [info]="info"
+ [pageTitle]="pageTitle"
+ [user]="user"
+ (signOut)="onSignOut()"
+ ></gf-header>
+</header>
+
+<main role="main">
<router-outlet></router-outlet>
</main>
diff --git a/apps/client/src/app/app.component.scss b/apps/client/src/app/app.component.scss
index 0c0828880d..2cc6d9a173 100644
--- a/apps/client/src/app/app.component.scss
+++ b/apps/client/src/app/app.component.scss
@@ -4,31 +4,47 @@
display: block;
min-height: 100vh;
+ &.has-info-message {
+ header {
+ height: calc(2 * var(--mat-toolbar-standard-height));
+
+ .info-message-container {
+ height: var(--mat-toolbar-standard-height);
+
+ .info-message-inner-container {
+ background-color: rgba(var(--palette-primary-500), 1);
+ height: var(--mat-toolbar-standard-height);
+ z-index: 999;
+
+ .info-message {
+ color: rgba(var(--palette-foreground-text), 1);
+ font-size: 80%;
+ max-width: 100%;
+
+ .a {
+ font-weight: 500;
+ }
+ }
+ }
+ }
+ }
+
+ main {
+ min-height: calc(100vh - 2 * var(--mat-toolbar-standard-height));
+ }
+ }
+
footer {
background-color: rgba(var(--palette-foreground-text), 0.05);
font-size: 90%;
}
+ header {
+ height: var(--mat-toolbar-standard-height);
+ }
+
main {
- min-height: 100vh;
- padding-top: 5rem;
-
- .info-message-container {
- height: 3.5rem;
- margin-top: -0.5rem;
-
- .info-message {
- background-color: rgba(var(--palette-foreground-text), 0.05);
- border-radius: 2rem;
- font-size: 80%;
- max-width: 100%;
-
- .a {
- color: rgba(var(--palette-primary-500), 1);
- font-weight: 500;
- }
- }
- }
+ min-height: calc(100vh - var(--mat-toolbar-standard-height));
}
}
@@ -36,12 +52,4 @@
footer {
background-color: rgba(var(--palette-foreground-text-dark), 0.05);
}
-
- main {
- .info-message-container {
- .info-message {
- background-color: rgba(var(--palette-foreground-text-dark), 0.05);
- }
- }
- }
}
diff --git a/apps/client/src/app/app.component.ts b/apps/client/src/app/app.component.ts
index dd6240d983..f260f4bbd5 100644
--- a/apps/client/src/app/app.component.ts
+++ b/apps/client/src/app/app.component.ts
@@ -3,6 +3,7 @@ import {
ChangeDetectionStrategy,
ChangeDetectorRef,
Component,
+ HostBinding,
Inject,
OnDestroy,
OnInit
@@ -28,14 +29,20 @@ import { UserService } from './services/user/user.service';
styleUrls: ['./app.component.scss']
})
export class AppComponent implements OnDestroy, OnInit {
+ @HostBinding('class.has-info-message') get getHasMessage() {
+ return this.hasInfoMessage;
+ }
+
public canCreateAccount: boolean;
public currentRoute: string;
public currentYear = new Date().getFullYear();
public deviceType: string;
+ public hasInfoMessage: boolean;
public hasPermissionForBlog: boolean;
public hasPermissionForStatistics: boolean;
public hasPermissionForSubscription: boolean;
public hasPermissionToAccessFearAndGreedIndex: boolean;
+ public hasTabs = false;
public info: InfoItem;
public pageTitle: string;
public routerLinkAbout = ['/' + $localize`about`];
@@ -103,6 +110,14 @@ export class AppComponent implements OnDestroy, OnInit {
const urlSegments = urlSegmentGroup.segments;
this.currentRoute = urlSegments[0].path;
+ this.hasTabs =
+ (this.currentRoute === this.routerLinkAbout[0].slice(1) ||
+ this.currentRoute === 'admin' ||
+ this.currentRoute === 'home' ||
+ this.currentRoute === 'portfolio' ||
+ this.currentRoute === 'zen') &&
+ this.deviceType !== 'mobile';
+
this.showFooter =
(this.currentRoute === 'blog' ||
this.currentRoute === this.routerLinkFaq[0].slice(1) ||
@@ -140,6 +155,12 @@ export class AppComponent implements OnDestroy, OnInit {
permissions.createUserAccount
);
+ this.hasInfoMessage =
+ hasPermission(
+ this.user?.permissions,
+ permissions.createUserAccount
+ ) || !!this.info.systemMessage;
+
this.initializeTheme(this.user?.settings.colorScheme);
this.changeDetectorRef.markForCheck();
diff --git a/apps/client/src/app/components/admin-settings/admin-settings.component.ts b/apps/client/src/app/components/admin-settings/admin-settings.component.ts
index 97066d5338..35e6d5c634 100644
--- a/apps/client/src/app/components/admin-settings/admin-settings.component.ts
+++ b/apps/client/src/app/components/admin-settings/admin-settings.component.ts
@@ -8,7 +8,6 @@ import { Subject } from 'rxjs';
@Component({
changeDetection: ChangeDetectionStrategy.OnPush,
- host: { class: 'page' },
selector: 'gf-admin-settings',
styleUrls: ['./admin-settings.component.scss'],
templateUrl: './admin-settings.component.html'
diff --git a/apps/client/src/app/components/header/header.component.html b/apps/client/src/app/components/header/header.component.html
index 5c412a1b90..2c56cb7428 100644
--- a/apps/client/src/app/components/header/header.component.html
+++ b/apps/client/src/app/components/header/header.component.html
@@ -1,14 +1,17 @@
-<mat-toolbar class="px-2">
+<mat-toolbar class="px-0">
<ng-container *ngIf="user">
- <a
- class="align-items-center d-flex h-100 no-min-width px-2 rounded-0"
- mat-button
- [routerLink]="['/']"
- >
- <gf-logo [label]="pageTitle"></gf-logo>
- </a>
+ <div class="d-flex h-100 logo-container" [ngClass]="{ filled: hasTabs }">
+ <a
+ class="align-items-center justify-content-start rounded-0"
+ mat-button
+ [ngClass]="{ 'w-100': hasTabs }"
+ [routerLink]="['/']"
+ >
+ <gf-logo class="px-2" [label]="pageTitle"></gf-logo>
+ </a>
+ </div>
<span class="spacer"></span>
- <ul class="alig-items-center d-flex list-inline m-0">
+ <ul class="alig-items-center d-flex list-inline m-0 px-2">
<li class="list-inline-item">
<a
class="d-none d-sm-block"
@@ -246,18 +249,22 @@
</ul>
</ng-container>
<ng-container *ngIf="user === null">
- <a
- class="align-items-center d-flex h-100 mx-2 no-min-width px-2 rounded-0"
- mat-button
- [routerLink]="['/']"
- >
- <gf-logo
- [label]="pageTitle"
- [showLabel]="currentRoute !== 'register'"
- ></gf-logo>
- </a>
+ <div class="d-flex h-100 logo-container" [ngClass]="{ filled: hasTabs }">
+ <a
+ class="align-items-center justify-content-start rounded-0"
+ mat-button
+ [ngClass]="{ 'w-100': hasTabs }"
+ [routerLink]="['/']"
+ >
+ <gf-logo
+ class="px-2"
+ [label]="pageTitle"
+ [showLabel]="currentRoute !== 'register'"
+ ></gf-logo>
+ </a>
+ </div>
<span class="spacer"></span>
- <ul class="alig-items-center d-flex list-inline m-0">
+ <ul class="alig-items-center d-flex list-inline m-0 px-2">
<li class="list-inline-item">
<a
class="d-none d-sm-block"
diff --git a/apps/client/src/app/components/header/header.component.scss b/apps/client/src/app/components/header/header.component.scss
index d7c9491b16..ce43c55aba 100644
--- a/apps/client/src/app/components/header/header.component.scss
+++ b/apps/client/src/app/components/header/header.component.scss
@@ -7,6 +7,16 @@
.mat-toolbar {
background-color: var(--light-background);
+ .logo-container {
+ &.filled {
+ background-color: rgba(var(--palette-foreground-base), 0.02);
+ }
+
+ @media (min-width: 576px) {
+ width: 14rem;
+ }
+ }
+
.list-inline-item {
margin: 0;
}
@@ -34,5 +44,11 @@
:host-context(.is-dark-theme) {
.mat-toolbar {
background-color: var(--dark-background);
+
+ .logo-container {
+ &.filled {
+ background-color: rgba(var(--palette-foreground-base-dark), 0.02);
+ }
+ }
}
}
diff --git a/apps/client/src/app/components/header/header.component.ts b/apps/client/src/app/components/header/header.component.ts
index c2a0119f16..063a4d31c7 100644
--- a/apps/client/src/app/components/header/header.component.ts
+++ b/apps/client/src/app/components/header/header.component.ts
@@ -29,6 +29,7 @@ import { catchError, takeUntil } from 'rxjs/operators';
})
export class HeaderComponent implements OnChanges {
@Input() currentRoute: string;
+ @Input() hasTabs: boolean;
@Input() info: InfoItem;
@Input() pageTitle: string;
@Input() user: User;
diff --git a/apps/client/src/app/pages/about/about-page.component.ts b/apps/client/src/app/pages/about/about-page.component.ts
index 6d9887dde9..807dd8066c 100644
--- a/apps/client/src/app/pages/about/about-page.component.ts
+++ b/apps/client/src/app/pages/about/about-page.component.ts
@@ -1,10 +1,4 @@
-import {
- ChangeDetectorRef,
- Component,
- HostBinding,
- OnDestroy,
- OnInit
-} from '@angular/core';
+import { ChangeDetectorRef, Component, OnDestroy, OnInit } from '@angular/core';
import { DataService } from '@ghostfolio/client/services/data.service';
import { UserService } from '@ghostfolio/client/services/user/user.service';
import { TabConfiguration, User } from '@ghostfolio/common/interfaces';
@@ -14,18 +8,13 @@ import { Subject } from 'rxjs';
import { takeUntil } from 'rxjs/operators';
@Component({
- host: { class: 'page with-tabs' },
+ host: { class: 'page has-tabs' },
selector: 'gf-about-page',
styleUrls: ['./about-page.scss'],
templateUrl: './about-page.html'
})
export class AboutPageComponent implements OnDestroy, OnInit {
- @HostBinding('class.with-info-message') get getHasMessage() {
- return this.hasMessage;
- }
-
public deviceType: string;
- public hasMessage: boolean;
public hasPermissionForSubscription: boolean;
public tabs: TabConfiguration[] = [];
public user: User;
@@ -38,7 +27,7 @@ export class AboutPageComponent implements OnDestroy, OnInit {
private deviceService: DeviceDetectorService,
private userService: UserService
) {
- const { globalPermissions, systemMessage } = this.dataService.fetchInfo();
+ const { globalPermissions } = this.dataService.fetchInfo();
this.hasPermissionForSubscription = hasPermission(
globalPermissions,
@@ -75,12 +64,6 @@ export class AboutPageComponent implements OnDestroy, OnInit {
});
this.user = state.user;
- this.hasMessage =
- hasPermission(
- this.user?.permissions,
- permissions.createUserAccount
- ) || !!systemMessage;
-
this.changeDetectorRef.markForCheck();
}
diff --git a/apps/client/src/app/pages/about/about-page.html b/apps/client/src/app/pages/about/about-page.html
index 014f68b9f9..d3fbca534c 100644
--- a/apps/client/src/app/pages/about/about-page.html
+++ b/apps/client/src/app/pages/about/about-page.html
@@ -2,7 +2,12 @@
<router-outlet></router-outlet>
</mat-tab-nav-panel>
-<nav mat-align-tabs="center" mat-tab-nav-bar [tabPanel]="tabPanel">
+<nav
+ mat-align-tabs="center"
+ mat-tab-nav-bar
+ [disablePagination]="true"
+ [tabPanel]="tabPanel"
+>
<ng-container *ngFor="let tab of tabs">
<a
#rla="routerLinkActive"
diff --git a/apps/client/src/app/pages/about/changelog/changelog-page.component.ts b/apps/client/src/app/pages/about/changelog/changelog-page.component.ts
index e4528b1adb..0de907b6a4 100644
--- a/apps/client/src/app/pages/about/changelog/changelog-page.component.ts
+++ b/apps/client/src/app/pages/about/changelog/changelog-page.component.ts
@@ -2,7 +2,6 @@ import { Component, OnDestroy } from '@angular/core';
import { Subject } from 'rxjs';
@Component({
- host: { class: 'page' },
selector: 'gf-changelog-page',
styleUrls: ['./changelog-page.scss'],
templateUrl: './changelog-page.html'
diff --git a/apps/client/src/app/pages/about/license/license-page.component.ts b/apps/client/src/app/pages/about/license/license-page.component.ts
index 185fde0257..3eadaa4de7 100644
--- a/apps/client/src/app/pages/about/license/license-page.component.ts
+++ b/apps/client/src/app/pages/about/license/license-page.component.ts
@@ -2,7 +2,6 @@ import { Component, OnDestroy } from '@angular/core';
import { Subject } from 'rxjs';
@Component({
- host: { class: 'page' },
selector: 'gf-license-page',
styleUrls: ['./license-page.scss'],
templateUrl: './license-page.html'
diff --git a/apps/client/src/app/pages/about/oss-friends/oss-friends-page.component.ts b/apps/client/src/app/pages/about/oss-friends/oss-friends-page.component.ts
index 9b5caa8a85..f0a2e70a33 100644
--- a/apps/client/src/app/pages/about/oss-friends/oss-friends-page.component.ts
+++ b/apps/client/src/app/pages/about/oss-friends/oss-friends-page.component.ts
@@ -4,7 +4,6 @@ import { Subject } from 'rxjs';
const ossFriends = require('../../../../assets/oss-friends.json');
@Component({
- host: { class: 'page' },
selector: 'gf-oss-friends-page',
styleUrls: ['./oss-friends-page.scss'],
templateUrl: './oss-friends-page.html'
diff --git a/apps/client/src/app/pages/about/overview/about-overview-page.component.ts b/apps/client/src/app/pages/about/overview/about-overview-page.component.ts
index d06ebcf1ef..471874dc20 100644
--- a/apps/client/src/app/pages/about/overview/about-overview-page.component.ts
+++ b/apps/client/src/app/pages/about/overview/about-overview-page.component.ts
@@ -8,7 +8,6 @@ import { Subject } from 'rxjs';
import { takeUntil } from 'rxjs/operators';
@Component({
- host: { class: 'page' },
selector: 'gf-about-overview-page',
styleUrls: ['./about-overview-page.scss'],
templateUrl: './about-overview-page.html'
diff --git a/apps/client/src/app/pages/about/privacy-policy/privacy-policy-page.component.ts b/apps/client/src/app/pages/about/privacy-policy/privacy-policy-page.component.ts
index c00be0872f..9ebddfab34 100644
--- a/apps/client/src/app/pages/about/privacy-policy/privacy-policy-page.component.ts
+++ b/apps/client/src/app/pages/about/privacy-policy/privacy-policy-page.component.ts
@@ -2,7 +2,6 @@ import { Component, OnDestroy } from '@angular/core';
import { Subject } from 'rxjs';
@Component({
- host: { class: 'page' },
selector: 'gf-privacy-policy-page',
styleUrls: ['./privacy-policy-page.scss'],
templateUrl: './privacy-policy-page.html'
diff --git a/apps/client/src/app/pages/admin/admin-page.component.ts b/apps/client/src/app/pages/admin/admin-page.component.ts
index 6ba5d0ac80..86be607251 100644
--- a/apps/client/src/app/pages/admin/admin-page.component.ts
+++ b/apps/client/src/app/pages/admin/admin-page.component.ts
@@ -1,34 +1,21 @@
-import { Component, HostBinding, OnDestroy, OnInit } from '@angular/core';
-import { DataService } from '@ghostfolio/client/services/data.service';
+import { Component, OnDestroy, OnInit } from '@angular/core';
import { TabConfiguration } from '@ghostfolio/common/interfaces';
import { DeviceDetectorService } from 'ngx-device-detector';
import { Subject } from 'rxjs';
@Component({
- host: { class: 'page with-tabs' },
+ host: { class: 'page has-tabs' },
selector: 'gf-admin-page',
styleUrls: ['./admin-page.scss'],
templateUrl: './admin-page.html'
})
export class AdminPageComponent implements OnDestroy, OnInit {
- @HostBinding('class.with-info-message') get getHasMessage() {
- return this.hasMessage;
- }
-
public deviceType: string;
- public hasMessage: boolean;
public tabs: TabConfiguration[] = [];
private unsubscribeSubject = new Subject<void>();
- public constructor(
- private dataService: DataService,
- private deviceService: DeviceDetectorService
- ) {
- const { systemMessage } = this.dataService.fetchInfo();
-
- this.hasMessage = !!systemMessage;
- }
+ public constructor(private deviceService: DeviceDetectorService) {}
public ngOnInit() {
this.deviceType = this.deviceService.getDeviceInfo().deviceType;
diff --git a/apps/client/src/app/pages/admin/admin-page.html b/apps/client/src/app/pages/admin/admin-page.html
index 014f68b9f9..d3fbca534c 100644
--- a/apps/client/src/app/pages/admin/admin-page.html
+++ b/apps/client/src/app/pages/admin/admin-page.html
@@ -2,7 +2,12 @@
<router-outlet></router-outlet>
</mat-tab-nav-panel>
-<nav mat-align-tabs="center" mat-tab-nav-bar [tabPanel]="tabPanel">
+<nav
+ mat-align-tabs="center"
+ mat-tab-nav-bar
+ [disablePagination]="true"
+ [tabPanel]="tabPanel"
+>
<ng-container *ngFor="let tab of tabs">
<a
#rla="routerLinkActive"
diff --git a/apps/client/src/app/pages/home/home-page.component.ts b/apps/client/src/app/pages/home/home-page.component.ts
index 13904e0373..a39a371c4f 100644
--- a/apps/client/src/app/pages/home/home-page.component.ts
+++ b/apps/client/src/app/pages/home/home-page.component.ts
@@ -1,10 +1,4 @@
-import {
- ChangeDetectorRef,
- Component,
- HostBinding,
- OnDestroy,
- OnInit
-} from '@angular/core';
+import { ChangeDetectorRef, Component, OnDestroy, OnInit } from '@angular/core';
import { DataService } from '@ghostfolio/client/services/data.service';
import { UserService } from '@ghostfolio/client/services/user/user.service';
import { TabConfiguration, User } from '@ghostfolio/common/interfaces';
@@ -14,18 +8,13 @@ import { Subject } from 'rxjs';
import { takeUntil } from 'rxjs/operators';
@Component({
- host: { class: 'page with-tabs' },
+ host: { class: 'page has-tabs' },
selector: 'gf-home-page',
styleUrls: ['./home-page.scss'],
templateUrl: './home-page.html'
})
export class HomePageComponent implements OnDestroy, OnInit {
- @HostBinding('class.with-info-message') get getHasMessage() {
- return this.hasMessage;
- }
-
public deviceType: string;
- public hasMessage: boolean;
public hasPermissionToAccessFearAndGreedIndex: boolean;
public tabs: TabConfiguration[] = [];
public user: User;
@@ -38,7 +27,7 @@ export class HomePageComponent implements OnDestroy, OnInit {
private deviceService: DeviceDetectorService,
private userService: UserService
) {
- const { globalPermissions, systemMessage } = this.dataService.fetchInfo();
+ const { globalPermissions } = this.dataService.fetchInfo();
this.hasPermissionToAccessFearAndGreedIndex = hasPermission(
globalPermissions,
@@ -74,12 +63,6 @@ export class HomePageComponent implements OnDestroy, OnInit {
];
this.user = state.user;
- this.hasMessage =
- hasPermission(
- this.user?.permissions,
- permissions.createUserAccount
- ) || !!systemMessage;
-
this.changeDetectorRef.markForCheck();
}
});
diff --git a/apps/client/src/app/pages/home/home-page.html b/apps/client/src/app/pages/home/home-page.html
index 014f68b9f9..d3fbca534c 100644
--- a/apps/client/src/app/pages/home/home-page.html
+++ b/apps/client/src/app/pages/home/home-page.html
@@ -2,7 +2,12 @@
<router-outlet></router-outlet>
</mat-tab-nav-panel>
-<nav mat-align-tabs="center" mat-tab-nav-bar [tabPanel]="tabPanel">
+<nav
+ mat-align-tabs="center"
+ mat-tab-nav-bar
+ [disablePagination]="true"
+ [tabPanel]="tabPanel"
+>
<ng-container *ngFor="let tab of tabs">
<a
#rla="routerLinkActive"
diff --git a/apps/client/src/app/pages/landing/landing-page.html b/apps/client/src/app/pages/landing/landing-page.html
index 29543baf13..334a90cd52 100644
--- a/apps/client/src/app/pages/landing/landing-page.html
+++ b/apps/client/src/app/pages/landing/landing-page.html
@@ -1,7 +1,7 @@
<div class="container">
<div class="row">
<div class="col text-center">
- <div class="mt-5">
+ <div>
<div class="badge badge-light badge-pill border mb-3 px-3 py-2">
<a href="../en/blog/2023/09/ghostfolio-2"
><span class="mr-1 text-uppercase" i18n>New</span>
diff --git a/apps/client/src/app/pages/portfolio/activities/activities-page.component.ts b/apps/client/src/app/pages/portfolio/activities/activities-page.component.ts
index c89b6c490f..34525436d6 100644
--- a/apps/client/src/app/pages/portfolio/activities/activities-page.component.ts
+++ b/apps/client/src/app/pages/portfolio/activities/activities-page.component.ts
@@ -24,7 +24,6 @@ import { ImportActivitiesDialog } from './import-activities-dialog/import-activi
import { ImportActivitiesDialogParams } from './import-activities-dialog/interfaces/interfaces';
@Component({
- host: { class: 'page' },
selector: 'gf-activities-page',
styleUrls: ['./activities-page.scss'],
templateUrl: './activities-page.html'
diff --git a/apps/client/src/app/pages/portfolio/allocations/allocations-page.component.ts b/apps/client/src/app/pages/portfolio/allocations/allocations-page.component.ts
index ec7a070818..40bb38b8ab 100644
--- a/apps/client/src/app/pages/portfolio/allocations/allocations-page.component.ts
+++ b/apps/client/src/app/pages/portfolio/allocations/allocations-page.component.ts
@@ -27,7 +27,6 @@ import { Subject } from 'rxjs';
import { distinctUntilChanged, switchMap, takeUntil } from 'rxjs/operators';
@Component({
- host: { class: 'page' },
selector: 'gf-allocations-page',
styleUrls: ['./allocations-page.scss'],
templateUrl: './allocations-page.html'
diff --git a/apps/client/src/app/pages/portfolio/analysis/analysis-page.component.ts b/apps/client/src/app/pages/portfolio/analysis/analysis-page.component.ts
index 1fb25f44f4..ddac55046e 100644
--- a/apps/client/src/app/pages/portfolio/analysis/analysis-page.component.ts
+++ b/apps/client/src/app/pages/portfolio/analysis/analysis-page.component.ts
@@ -26,7 +26,6 @@ import { Subject } from 'rxjs';
import { distinctUntilChanged, map, takeUntil } from 'rxjs/operators';
@Component({
- host: { class: 'page' },
selector: 'gf-analysis-page',
styleUrls: ['./analysis-page.scss'],
templateUrl: './analysis-page.html'
diff --git a/apps/client/src/app/pages/portfolio/fire/fire-page.component.ts b/apps/client/src/app/pages/portfolio/fire/fire-page.component.ts
index 551f2066e2..58d0b3702f 100644
--- a/apps/client/src/app/pages/portfolio/fire/fire-page.component.ts
+++ b/apps/client/src/app/pages/portfolio/fire/fire-page.component.ts
@@ -10,7 +10,6 @@ import { Subject } from 'rxjs';
import { takeUntil } from 'rxjs/operators';
@Component({
- host: { class: 'page' },
selector: 'gf-fire-page',
styleUrls: ['./fire-page.scss'],
templateUrl: './fire-page.html'
diff --git a/apps/client/src/app/pages/portfolio/holdings/holdings-page.component.ts b/apps/client/src/app/pages/portfolio/holdings/holdings-page.component.ts
index 6d27b70f7f..d65f20165b 100644
--- a/apps/client/src/app/pages/portfolio/holdings/holdings-page.component.ts
+++ b/apps/client/src/app/pages/portfolio/holdings/holdings-page.component.ts
@@ -20,7 +20,6 @@ import { Subject } from 'rxjs';
import { distinctUntilChanged, switchMap, takeUntil } from 'rxjs/operators';
@Component({
- host: { class: 'page' },
selector: 'gf-holdings-page',
styleUrls: ['./holdings-page.scss'],
templateUrl: './holdings-page.html'
diff --git a/apps/client/src/app/pages/portfolio/portfolio-page.component.ts b/apps/client/src/app/pages/portfolio/portfolio-page.component.ts
index 8d4b3b6285..8666ca1e49 100644
--- a/apps/client/src/app/pages/portfolio/portfolio-page.component.ts
+++ b/apps/client/src/app/pages/portfolio/portfolio-page.component.ts
@@ -1,36 +1,18 @@
-import {
- ChangeDetectorRef,
- Component,
- HostBinding,
- OnDestroy,
- OnInit
-} from '@angular/core';
-import { DataService } from '@ghostfolio/client/services/data.service';
+import { ChangeDetectorRef, Component, OnDestroy, OnInit } from '@angular/core';
import { UserService } from '@ghostfolio/client/services/user/user.service';
-import {
- InfoItem,
- TabConfiguration,
- User
-} from '@ghostfolio/common/interfaces';
-import { hasPermission, permissions } from '@ghostfolio/common/permissions';
+import { TabConfiguration, User } from '@ghostfolio/common/interfaces';
import { DeviceDetectorService } from 'ngx-device-detector';
import { Subject } from 'rxjs';
import { takeUntil } from 'rxjs/operators';
@Component({
- host: { class: 'page with-tabs' },
+ host: { class: 'page has-tabs' },
selector: 'gf-portfolio-page',
styleUrls: ['./portfolio-page.scss'],
templateUrl: './portfolio-page.html'
})
export class PortfolioPageComponent implements OnDestroy, OnInit {
- @HostBinding('class.with-info-message') get getHasMessage() {
- return this.hasMessage;
- }
-
public deviceType: string;
- public hasMessage: boolean;
- public info: InfoItem;
public tabs: TabConfiguration[] = [];
public user: User;
@@ -38,12 +20,9 @@ export class PortfolioPageComponent implements OnDestroy, OnInit {
public constructor(
private changeDetectorRef: ChangeDetectorRef,
- private dataService: DataService,
private deviceService: DeviceDetectorService,
private userService: UserService
) {
- this.info = this.dataService.fetchInfo();
-
this.userService.stateChanged
.pipe(takeUntil(this.unsubscribeSubject))
.subscribe((state) => {
@@ -77,12 +56,6 @@ export class PortfolioPageComponent implements OnDestroy, OnInit {
];
this.user = state.user;
- this.hasMessage =
- hasPermission(
- this.user?.permissions,
- permissions.createUserAccount
- ) || !!this.info.systemMessage;
-
this.changeDetectorRef.markForCheck();
}
});
diff --git a/apps/client/src/app/pages/portfolio/portfolio-page.html b/apps/client/src/app/pages/portfolio/portfolio-page.html
index 014f68b9f9..d3fbca534c 100644
--- a/apps/client/src/app/pages/portfolio/portfolio-page.html
+++ b/apps/client/src/app/pages/portfolio/portfolio-page.html
@@ -2,7 +2,12 @@
<router-outlet></router-outlet>
</mat-tab-nav-panel>
-<nav mat-align-tabs="center" mat-tab-nav-bar [tabPanel]="tabPanel">
+<nav
+ mat-align-tabs="center"
+ mat-tab-nav-bar
+ [disablePagination]="true"
+ [tabPanel]="tabPanel"
+>
<ng-container *ngFor="let tab of tabs">
<a
#rla="routerLinkActive"
diff --git a/apps/client/src/app/pages/zen/zen-page.component.ts b/apps/client/src/app/pages/zen/zen-page.component.ts
index ab164af4c2..b0906ea6cf 100644
--- a/apps/client/src/app/pages/zen/zen-page.component.ts
+++ b/apps/client/src/app/pages/zen/zen-page.component.ts
@@ -6,7 +6,7 @@ import { Subject } from 'rxjs';
import { takeUntil } from 'rxjs/operators';
@Component({
- host: { class: 'page with-tabs' },
+ host: { class: 'page has-tabs' },
selector: 'gf-zen-page',
styleUrls: ['./zen-page.scss'],
templateUrl: './zen-page.html'
diff --git a/apps/client/src/app/pages/zen/zen-page.html b/apps/client/src/app/pages/zen/zen-page.html
index 014f68b9f9..d3fbca534c 100644
--- a/apps/client/src/app/pages/zen/zen-page.html
+++ b/apps/client/src/app/pages/zen/zen-page.html
@@ -2,7 +2,12 @@
<router-outlet></router-outlet>
</mat-tab-nav-panel>
-<nav mat-align-tabs="center" mat-tab-nav-bar [tabPanel]="tabPanel">
+<nav
+ mat-align-tabs="center"
+ mat-tab-nav-bar
+ [disablePagination]="true"
+ [tabPanel]="tabPanel"
+>
<ng-container *ngFor="let tab of tabs">
<a
#rla="routerLinkActive"
diff --git a/apps/client/src/styles.scss b/apps/client/src/styles.scss
index 88a7f9dc59..5920df530d 100644
--- a/apps/client/src/styles.scss
+++ b/apps/client/src/styles.scss
@@ -275,12 +275,18 @@ body {
}
.page {
- &.with-tabs {
+ &.has-tabs {
.mat-mdc-tab-nav-bar {
--mat-tab-header-inactive-label-text-color: rgba(
var(--light-primary-text)
);
}
+
+ @media (min-width: 576px) {
+ .mat-mdc-tab-header {
+ background-color: rgba(var(--palette-foreground-base-dark), 0.02);
+ }
+ }
}
}
@@ -367,6 +373,12 @@ ngx-skeleton-loader {
@include gf-table;
}
+.has-info-message {
+ .page.has-tabs {
+ height: calc(100vh - 2 * var(--mat-toolbar-standard-height));
+ }
+}
+
.hidden {
visibility: hidden;
}
@@ -469,12 +481,14 @@ ngx-skeleton-loader {
flex-direction: column;
overflow-y: auto;
- &:not(.with-tabs) {
- padding-bottom: 5rem;
+ &:not(.has-tabs) {
+ @media (min-width: 576px) {
+ padding: 2rem 0;
+ }
}
- &.with-tabs {
- height: calc(100vh - 5rem);
+ &.has-tabs {
+ height: calc(100vh - var(--mat-toolbar-standard-height));
padding-bottom: env(safe-area-inset-bottom);
padding-bottom: constant(safe-area-inset-bottom);
@@ -491,7 +505,10 @@ ngx-skeleton-loader {
flex-direction: row-reverse;
.mat-mdc-tab-header {
- width: 12rem;
+ background-color: rgba(var(--palette-foreground-base), 0.02);
+ padding: 2rem 0;
+ width: 14rem;
+ --mat-tab-header-label-text-tracking: normal;
--mdc-secondary-navigation-tab-container-height: 2rem;
.mat-mdc-tab-links {
@@ -502,6 +519,10 @@ ngx-skeleton-loader {
}
}
}
+
+ .mat-mdc-tab-nav-panel {
+ padding: 2rem 0;
+ }
}
}
}
@@ -518,10 +539,6 @@ ngx-skeleton-loader {
text-decoration: underline !important;
}
-.with-info-message {
- height: calc(100vh - 5rem - 3.5rem + 0.5rem) !important;
-}
-
.with-placeholder-as-option {
.mat-mdc-select-placeholder {
color: rgba(var(--dark-primary-text));