Make fiat component color class customizable

This commit is contained in:
nymkappa 2023-04-04 11:42:06 +09:00
parent bdbb1dcf8e
commit 90fa4a8f77
No known key found for this signature in database
GPG Key ID: E155910B16E8BD04
3 changed files with 4 additions and 6 deletions

View File

@ -1,4 +1,4 @@
<span class="green-color" *ngIf="blockConversion; else noblockconversion">
<span [class]="colorClass" *ngIf="blockConversion; else noblockconversion">
{{
(
(blockConversion.price[currency] > -1 ? blockConversion.price[currency] : null) ??
@ -8,7 +8,7 @@
</span>
<ng-template #noblockconversion>
<span class="green-color" *ngIf="(conversions$ | async) as conversions">
<span [class]="colorClass" *ngIf="(conversions$ | async) as conversions">
{{ (conversions[currency] > -1 ? conversions[currency] : 0) * value / 100000000 | fiatCurrency : digitsInfo : currency }}
</span>
</ng-template>

View File

@ -1,3 +0,0 @@
.green-color {
color: #3bcc49;
}

View File

@ -6,7 +6,7 @@ import { StateService } from '../services/state.service';
@Component({
selector: 'app-fiat',
templateUrl: './fiat.component.html',
styleUrls: ['./fiat.component.scss'],
styleUrls: [],
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class FiatComponent implements OnInit, OnDestroy {
@ -17,6 +17,7 @@ export class FiatComponent implements OnInit, OnDestroy {
@Input() value: number;
@Input() digitsInfo = '1.2-2';
@Input() blockConversion: Price;
@Input() colorClass = 'green-color';
constructor(
private stateService: StateService,