top wallet

This commit is contained in:
CHIEFSOFT\ameye
2024-01-13 14:56:32 -05:00
parent 233f809392
commit 43cf28f9f2
9 changed files with 165 additions and 35 deletions
@@ -0,0 +1,33 @@
<ion-toolbar class="top-tool" *ngIf="walletDescription !='' || active_job_count != 0">
<ion-buttons slot="secondary">
<ion-button
*ngIf="walletDescription !='' "
style="border-radius: 10px; font-weight: bolder;"
fill="solid"
color="primary"
(click)="myWallet()">
<ion-icon slot="end" name="wallet"></ion-icon>
{{walletDescription}}
</ion-button>
<ion-button
*ngIf="walletDescription =='' "
style="border-radius: 10px; font-weight: bolder;"
fill="solid"
color="primary"
(click)="myWallet()">
<ion-icon slot="end" name="wallet"></ion-icon>
Wallet
</ion-button>
</ion-buttons>
<ion-buttons slot="primary" *ngIf="active_job_count != 0">
<ion-button
style="border-radius: 15px;
font-weight: bolder"
fill="solid"
color="primary" (click)="myJobs(1)">
My Jobs
<ion-icon slot="end" name="list"></ion-icon>
</ion-button>
</ion-buttons>
<!-- <ion-title>{{walletDescription}}</ion-title>-->
</ion-toolbar>
@@ -0,0 +1,9 @@
.top-tool{
--background: #e9f1f1;
border-radius: 10px;
ion-buttons{
ion-button{
font-size: 12px;
}
}
}
@@ -0,0 +1,24 @@
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
import { IonicModule } from '@ionic/angular';
import { DashToptoolComponent } from './dash-toptool.component';
describe('DashToptoolComponent', () => {
let component: DashToptoolComponent;
let fixture: ComponentFixture<DashToptoolComponent>;
beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
declarations: [ DashToptoolComponent ],
imports: [IonicModule.forRoot()]
}).compileComponents();
fixture = TestBed.createComponent(DashToptoolComponent);
component = fixture.componentInstance;
fixture.detectChanges();
}));
it('should create', () => {
expect(component).toBeTruthy();
});
});
@@ -0,0 +1,47 @@
import { Component, OnInit } from '@angular/core';
import {SessionDataProviderService} from "../../store/session-data-provider.service";
import {WrenchService} from "../../services/wrench.service";
import {OnesignalService} from "../../services/onesignal.service";
import {BlogDataService} from "../../store/blog-data.service";
import {UserWalletService} from "../../store/user-wallet.service";
@Component({
selector: 'app-dash-toptool',
templateUrl: './dash-toptool.component.html',
styleUrls: ['./dash-toptool.component.scss'],
})
export class DashToptoolComponent implements OnInit {
walletDescription:string ="";
walletData:any;
active_job_count:number=0;
constructor( public sessionDataProviderService: SessionDataProviderService,
private wrenchService: WrenchService,
private onesignalService: OnesignalService,
public blogDataService: BlogDataService,
public userWalletService: UserWalletService) { }
ngOnInit() {
this.walletPresentation();
this.active_job_count = this.sessionDataProviderService.active_job_count;
setInterval(()=>{
this.walletPresentation();
this.active_job_count = this.sessionDataProviderService.active_job_count;
}, 100000);
}
async walletPresentation(){
this.walletData = this.userWalletService.getWallet();
if( this.walletData?.length > 0 ) {
var num = new Number(this.walletData[0].amount*0.01);
//this.fee_display = num.toFixed(2); //outputs 14
this.walletDescription = num.toFixed(2) + ' ' + this.walletData[0].description;
}
}
myJobs(jmode){
dispatchEvent(new Event("dash_tool_myjobs"));
}
myWallet(){
dispatchEvent(new Event("dash_tool_mywallet"));
}
}