mirror of
https://github.com/mempool/mempool.git
synced 2024-11-19 09:52:14 +01:00
Make fiat component color class customizable
This commit is contained in:
parent
bdbb1dcf8e
commit
90fa4a8f77
@ -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>
|
@ -1,3 +0,0 @@
|
||||
.green-color {
|
||||
color: #3bcc49;
|
||||
}
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user