SSR: placeholder bowtie diagram while loading

This commit is contained in:
Mononaut 2023-11-04 17:48:27 +00:00
parent c926088136
commit 48af95d722
No known key found for this signature in database
GPG Key ID: A3F058E41374C04E
2 changed files with 10 additions and 2 deletions

View File

@ -1,5 +1,13 @@
<div class="bowtie-graph">
<svg *ngIf="inputs && outputs" class="bowtie" [class.rtl]="dir === 'rtl'" [attr.height]="(height + 10) + 'px'" [attr.width]="width + 'px'">
<svg
*ngIf="inputs && outputs"
class="bowtie"
[class.rtl]="dir === 'rtl'"
[attr.height]="(height + 10) + 'px'"
[attr.width]="stateService.isBrowser ? (width + 'px') : '100%'"
[attr.viewBox]="stateService.isBrowser ? null : ('0 0 ' + width + ' ' + (height + 10))"
[attr.preserveAspectRatio]="stateService.isBrowser ? null : 'none'"
>
<defs>
<marker id="input-arrow" viewBox="-5 -5 10 10"
refX="0" refY="0"

View File

@ -101,7 +101,7 @@ export class TxBowtieGraphComponent implements OnInit, OnChanges {
constructor(
private router: Router,
private relativeUrlPipe: RelativeUrlPipe,
private stateService: StateService,
public stateService: StateService,
private electrsApiService: ElectrsApiService,
private assetsService: AssetsService,
@Inject(LOCALE_ID) private locale: string,