From 1b9fa252aea9176bb104f8f593844af1aa2e572d Mon Sep 17 00:00:00 2001
From: Thomas <4159106+dtslvr@users.noreply.github.com>
Date: Tue, 14 Nov 2023 22:33:04 +0100
Subject: [PATCH] Add integration
---
.../position/position.component.html | 1 +
.../lib/benchmark/benchmark.component.html | 49 ++++++++++++++++++-
.../src/lib/benchmark/benchmark.component.ts | 35 ++++++++++++-
libs/ui/src/lib/benchmark/benchmark.module.ts | 2 +
.../trend-indicator.component.html | 10 ++--
.../trend-indicator.component.ts | 1 +
6 files changed, 90 insertions(+), 8 deletions(-)
diff --git a/apps/client/src/app/components/position/position.component.html b/apps/client/src/app/components/position/position.component.html
index e173b0f00..979975176 100644
--- a/apps/client/src/app/components/position/position.component.html
+++ b/apps/client/src/app/components/position/position.component.html
@@ -13,6 +13,7 @@
+
+
+ 50-Day Trend
+ |
+
+
+
+
+ |
+
+
+
+
+ 200-Day Trend
+ |
+
+
+
+
+ |
+
+
();
+
+ public constructor(
+ private changeDetectorRef: ChangeDetectorRef,
+ private userService: UserService
+ ) {
+ this.userService.stateChanged
+ .pipe(takeUntil(this.unsubscribeSubject))
+ .subscribe((state) => {
+ if (state?.user) {
+ this.user = state.user;
+
+ if (this.user?.settings?.isExperimentalFeatures) {
+ this.displayedColumns = [
+ 'name',
+ 'trend50d',
+ 'trend200d',
+ 'date',
+ 'change',
+ 'marketCondition'
+ ];
+ }
+
+ this.changeDetectorRef.markForCheck();
+ }
+ });
+ }
public ngOnChanges() {
if (!this.locale) {
diff --git a/libs/ui/src/lib/benchmark/benchmark.module.ts b/libs/ui/src/lib/benchmark/benchmark.module.ts
index 1768aa39f..5b3e00209 100644
--- a/libs/ui/src/lib/benchmark/benchmark.module.ts
+++ b/libs/ui/src/lib/benchmark/benchmark.module.ts
@@ -3,6 +3,7 @@ import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core';
import { MatTableModule } from '@angular/material/table';
import { NgxSkeletonLoaderModule } from 'ngx-skeleton-loader';
+import { GfTrendIndicatorModule } from '../trend-indicator';
import { GfValueModule } from '../value';
import { BenchmarkComponent } from './benchmark.component';
@@ -11,6 +12,7 @@ import { BenchmarkComponent } from './benchmark.component';
exports: [BenchmarkComponent],
imports: [
CommonModule,
+ GfTrendIndicatorModule,
GfValueModule,
MatTableModule,
NgxSkeletonLoaderModule
diff --git a/libs/ui/src/lib/trend-indicator/trend-indicator.component.html b/libs/ui/src/lib/trend-indicator/trend-indicator.component.html
index 27251fc24..d6180cba7 100644
--- a/libs/ui/src/lib/trend-indicator/trend-indicator.component.html
+++ b/libs/ui/src/lib/trend-indicator/trend-indicator.component.html
@@ -13,7 +13,7 @@
*ngIf="marketState === 'closed' && range === '1d'; else delayed"
class="text-muted"
name="pause-circle-outline"
- size="large"
+ [size]="size"
>
@@ -21,7 +21,7 @@
*ngIf="marketState === 'delayed' && range === '1d'; else trend"
class="text-muted"
name="time-outline"
- size="large"
+ [size]="size"
>
@@ -31,21 +31,21 @@
*ngIf="value <= -0.0005"
class="text-danger"
name="arrow-down-circle-outline"
- size="large"
[ngClass]="{ 'rotate-45-down': value > -0.01 }"
+ [size]="size"
>
-0.0005 && value < 0.0005"
class="text-muted"
name="arrow-forward-circle-outline"
- size="large"
+ [size]="size"
>
= 0.0005"
class="text-success"
name="arrow-up-circle-outline"
- size="large"
[ngClass]="{ 'rotate-45-up': value < 0.01 }"
+ [size]="size"
>
diff --git a/libs/ui/src/lib/trend-indicator/trend-indicator.component.ts b/libs/ui/src/lib/trend-indicator/trend-indicator.component.ts
index 4da6d6c8e..e9152f8a0 100644
--- a/libs/ui/src/lib/trend-indicator/trend-indicator.component.ts
+++ b/libs/ui/src/lib/trend-indicator/trend-indicator.component.ts
@@ -11,6 +11,7 @@ export class TrendIndicatorComponent {
@Input() isLoading = false;
@Input() marketState: MarketState = 'open';
@Input() range: DateRange = 'max';
+ @Input() size: 'large' | 'medium' | 'small' = 'small';
@Input() value = 0;
public constructor() {}
|