Fix graphs button layout

This commit is contained in:
nymkappa 2022-07-11 09:36:42 +02:00
parent b8b50b552e
commit f2e703e928
No known key found for this signature in database
GPG Key ID: E155910B16E8BD04
2 changed files with 9 additions and 3 deletions

View File

@ -1,10 +1,10 @@
<div *ngIf="stateService.env.MINING_DASHBOARD || stateService.env.LIGHTNING" class="mb-3 d-flex menu" <div *ngIf="stateService.env.MINING_DASHBOARD || stateService.env.LIGHTNING" class="mb-3 d-flex menu"
style="padding: 0px 35px;"> style="padding: 0px 35px;">
<a routerLinkActive="active" class="btn btn-primary w-50 mr-1" <a routerLinkActive="active" class="btn btn-primary mr-1" [class]="padding"
[routerLink]="['/graphs/mempool' | relativeUrl]">Mempool</a> [routerLink]="['/graphs/mempool' | relativeUrl]">Mempool</a>
<div ngbDropdown class="w-50" *ngIf="stateService.env.MINING_DASHBOARD"> <div ngbDropdown class="mr-1" [class]="padding" *ngIf="stateService.env.MINING_DASHBOARD">
<button class="btn btn-primary w-100" id="dropdownBasic1" ngbDropdownToggle i18n="mining">Mining</button> <button class="btn btn-primary w-100" id="dropdownBasic1" ngbDropdownToggle i18n="mining">Mining</button>
<div ngbDropdownMenu aria-labelledby="dropdownBasic1"> <div ngbDropdownMenu aria-labelledby="dropdownBasic1">
<a class="dropdown-item" routerLinkActive="active" [routerLink]="['/graphs/mining/pools' | relativeUrl]" <a class="dropdown-item" routerLinkActive="active" [routerLink]="['/graphs/mining/pools' | relativeUrl]"
@ -27,7 +27,7 @@
</div> </div>
</div> </div>
<div ngbDropdown class="w-50" *ngIf="stateService.env.LIGHTNING"> <div ngbDropdown [class]="padding" *ngIf="stateService.env.LIGHTNING">
<button class="btn btn-primary w-100" id="dropdownBasic1" ngbDropdownToggle i18n="lightning">Lightning</button> <button class="btn btn-primary w-100" id="dropdownBasic1" ngbDropdownToggle i18n="lightning">Lightning</button>
<div ngbDropdownMenu aria-labelledby="dropdownBasic1"> <div ngbDropdownMenu aria-labelledby="dropdownBasic1">
<a class="dropdown-item" routerLinkActive="active" [routerLink]="['/graphs/lightning/nodes-networks' | relativeUrl]" <a class="dropdown-item" routerLinkActive="active" [routerLink]="['/graphs/lightning/nodes-networks' | relativeUrl]"

View File

@ -8,6 +8,8 @@ import { WebsocketService } from "src/app/services/websocket.service";
styleUrls: ['./graphs.component.scss'], styleUrls: ['./graphs.component.scss'],
}) })
export class GraphsComponent implements OnInit { export class GraphsComponent implements OnInit {
padding = 'w-50';
constructor( constructor(
public stateService: StateService, public stateService: StateService,
private websocketService: WebsocketService private websocketService: WebsocketService
@ -15,5 +17,9 @@ export class GraphsComponent implements OnInit {
ngOnInit(): void { ngOnInit(): void {
this.websocketService.want(['blocks']); this.websocketService.want(['blocks']);
if (this.stateService.env.MINING_DASHBOARD === true && this.stateService.env.LIGHTNING === true) {
this.padding = 'w-33';
}
} }
} }