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) ??
 | 
					      (blockConversion.price[currency] > -1 ? blockConversion.price[currency] : null) ??
 | 
				
			||||||
@ -8,7 +8,7 @@
 | 
				
			|||||||
</span>
 | 
					</span>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
<ng-template #noblockconversion>
 | 
					<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 }}
 | 
					    {{ (conversions[currency] > -1 ? conversions[currency] : 0) * value / 100000000 | fiatCurrency : digitsInfo : currency }}
 | 
				
			||||||
  </span>
 | 
					  </span>
 | 
				
			||||||
</ng-template>
 | 
					</ng-template>
 | 
				
			||||||
@ -1,3 +0,0 @@
 | 
				
			|||||||
.green-color {
 | 
					 | 
				
			||||||
  color: #3bcc49;
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
@ -6,7 +6,7 @@ import { StateService } from '../services/state.service';
 | 
				
			|||||||
@Component({
 | 
					@Component({
 | 
				
			||||||
  selector: 'app-fiat',
 | 
					  selector: 'app-fiat',
 | 
				
			||||||
  templateUrl: './fiat.component.html',
 | 
					  templateUrl: './fiat.component.html',
 | 
				
			||||||
  styleUrls: ['./fiat.component.scss'],
 | 
					  styleUrls: [],
 | 
				
			||||||
  changeDetection: ChangeDetectionStrategy.OnPush,
 | 
					  changeDetection: ChangeDetectionStrategy.OnPush,
 | 
				
			||||||
})
 | 
					})
 | 
				
			||||||
export class FiatComponent implements OnInit, OnDestroy {
 | 
					export class FiatComponent implements OnInit, OnDestroy {
 | 
				
			||||||
@ -17,6 +17,7 @@ export class FiatComponent implements OnInit, OnDestroy {
 | 
				
			|||||||
  @Input() value: number;
 | 
					  @Input() value: number;
 | 
				
			||||||
  @Input() digitsInfo = '1.2-2';
 | 
					  @Input() digitsInfo = '1.2-2';
 | 
				
			||||||
  @Input() blockConversion: Price;
 | 
					  @Input() blockConversion: Price;
 | 
				
			||||||
 | 
					  @Input() colorClass = 'green-color';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  constructor(
 | 
					  constructor(
 | 
				
			||||||
    private stateService: StateService,
 | 
					    private stateService: StateService,
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user