2021-10-20 20:51:14 +00:00
|
|
|
import {Component, OnInit, OnDestroy} from '@angular/core';
|
2021-10-28 20:34:48 +00:00
|
|
|
import { MatDialog, MatDialogConfig} from '@angular/material/dialog';
|
2021-10-15 19:14:49 +00:00
|
|
|
import {FullnodeService} from '../fullnode.service';
|
2021-10-20 20:51:14 +00:00
|
|
|
import { UserService } from '../user.service';
|
2021-10-21 16:22:48 +00:00
|
|
|
import {Subscription, Observable} from 'rxjs';
|
2021-10-15 19:14:49 +00:00
|
|
|
|
2021-10-20 20:51:14 +00:00
|
|
|
import {Owner} from '../owner.model';
|
|
|
|
|
2021-10-15 19:14:49 +00:00
|
|
|
@Component({
|
|
|
|
selector: 'app-header',
|
|
|
|
templateUrl: './header.component.html',
|
|
|
|
styleUrls: ['./header.component.css']
|
|
|
|
})
|
|
|
|
|
2021-10-20 20:51:14 +00:00
|
|
|
export class HeaderComponent implements OnInit, OnDestroy {
|
2021-10-15 19:14:49 +00:00
|
|
|
|
2021-10-20 20:51:14 +00:00
|
|
|
public height = 0;
|
2021-11-22 20:37:45 +00:00
|
|
|
private owner: Owner= {
|
|
|
|
_id:'',
|
|
|
|
address: 'none',
|
|
|
|
name:'',
|
|
|
|
currency: 'usd',
|
|
|
|
tax: false,
|
|
|
|
taxValue: 0,
|
|
|
|
vat: false,
|
2022-01-17 20:49:08 +00:00
|
|
|
vatValue: 0,
|
|
|
|
email: '',
|
|
|
|
street: '',
|
|
|
|
city: '',
|
|
|
|
state: '',
|
|
|
|
postal: '',
|
|
|
|
phone: '',
|
2022-01-18 22:40:20 +00:00
|
|
|
paid: false,
|
2022-01-19 16:26:25 +00:00
|
|
|
website: '',
|
|
|
|
country: ''
|
2021-11-22 20:37:45 +00:00
|
|
|
};
|
2021-10-20 20:51:14 +00:00
|
|
|
private session: string | null = '';
|
2021-10-21 16:22:48 +00:00
|
|
|
public heightUpdate: Observable<number>;
|
|
|
|
public ownerUpdate: Observable<Owner>;
|
2021-10-21 19:29:04 +00:00
|
|
|
public uZaddrUpdate: Observable<string>;
|
2021-10-21 16:22:48 +00:00
|
|
|
|
2021-10-20 20:51:14 +00:00
|
|
|
constructor(
|
|
|
|
public fullnodeService: FullnodeService,
|
2021-10-28 20:34:48 +00:00
|
|
|
public userService: UserService,
|
|
|
|
private dialog: MatDialog
|
2021-10-20 20:51:14 +00:00
|
|
|
){
|
2021-10-21 16:22:48 +00:00
|
|
|
this.heightUpdate = fullnodeService.heightUpdate;
|
2021-10-21 19:29:04 +00:00
|
|
|
this.uZaddrUpdate = userService.uZaddrUpdate;
|
2021-10-21 16:22:48 +00:00
|
|
|
this.ownerUpdate = userService.ownerUpdate;
|
2021-10-28 20:34:48 +00:00
|
|
|
this.ownerUpdate.subscribe((owner) => {
|
|
|
|
this.owner = owner;
|
|
|
|
});
|
2021-10-15 19:14:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
ngOnInit(){
|
2021-10-20 20:51:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
ngOnDestroy(){
|
|
|
|
}
|
|
|
|
|
2021-11-22 20:37:45 +00:00
|
|
|
getCurrency(){
|
|
|
|
return this.owner.currency.toUpperCase();
|
|
|
|
}
|
2021-10-15 19:14:49 +00:00
|
|
|
}
|