Fix routes for /mining - Share blockchain component instances - remove animations

This commit is contained in:
nymkappa
2022-02-17 17:10:20 +09:00
parent 538ae3b757
commit 7761e75d4c
8 changed files with 21 additions and 40 deletions

View File

@@ -1,8 +1,8 @@
<div class="text-center" class="blockchain-wrapper animate" #container [class]="stateService.blockShifted ? 'move-left' : ''">
<div class="text-center" class="blockchain-wrapper animate" #container>
<div class="position-container {{ network }}">
<span>
<app-mempool-blocks></app-mempool-blocks>
<app-blockchain-blocks [miningInfo]="miningInfo"></app-blockchain-blocks>
<app-blockchain-blocks [showMiningInfo]="showMiningInfo"></app-blockchain-blocks>
<div id="divider"></div>
</span>
</div>

View File

@@ -1,4 +1,4 @@
import { Component, OnInit, ChangeDetectionStrategy, Input, ViewChild, ElementRef } from '@angular/core';
import { Component, OnInit, ChangeDetectionStrategy } from '@angular/core';
import { StateService } from 'src/app/services/state.service';
@Component({
@@ -8,8 +8,7 @@ import { StateService } from 'src/app/services/state.service';
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class BlockchainComponent implements OnInit {
@Input() miningInfo: boolean = false;
@ViewChild('container') container: ElementRef;
showMiningInfo: boolean = false;
network: string;
constructor(
@@ -18,15 +17,5 @@ export class BlockchainComponent implements OnInit {
ngOnInit() {
this.network = this.stateService.network;
setTimeout(() => {
if (this.miningInfo) {
this.container.nativeElement.className += ' move-left';
this.stateService.blockShifted = true;
} else if (this.stateService.blockShifted) {
this.container.nativeElement.className = this.container.nativeElement.className.replace(' move-left', '');
this.stateService.blockShifted = false;
}
}, 250);
}
}