mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 13:02:56 +00:00
Add pin page
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { ModalController } from '@ionic/angular';
|
||||
import { AnimationController, ModalController } from '@ionic/angular';
|
||||
import { User } from 'src/app/models/user.model';
|
||||
import { AuthService } from 'src/app/services/auth.service';
|
||||
import { PinPage } from 'src/app/shared/pin/pin.page';
|
||||
|
||||
@Component({
|
||||
selector: 'app-profile',
|
||||
@@ -13,7 +14,9 @@ export class ProfileComponent implements OnInit {
|
||||
loggeduser: User;
|
||||
|
||||
constructor(private modalController:ModalController,
|
||||
private authService: AuthService) {
|
||||
private authService: AuthService,
|
||||
private animationController: AnimationController) {
|
||||
|
||||
this.loggeduser = authService.ValidatedUser;
|
||||
|
||||
console.log(this.loggeduser.RoleDescription)
|
||||
@@ -21,12 +24,44 @@ export class ProfileComponent implements OnInit {
|
||||
|
||||
ngOnInit() {}
|
||||
|
||||
close(){
|
||||
close() {
|
||||
this.modalController.dismiss();
|
||||
}
|
||||
|
||||
addPrin(){
|
||||
alert('Pin')
|
||||
async addPin() {
|
||||
const enterAnimation = (baseEl: any) => {
|
||||
const backdropAnimation = this.animationController.create()
|
||||
.addElement(baseEl.querySelector('ion-backdrop')!)
|
||||
.fromTo('opacity', '0.01', 'var(--backdrop-opacity)');
|
||||
|
||||
const wrapperAnimation = this.animationController.create()
|
||||
.addElement(baseEl.querySelector('.modal-wrapper')!)
|
||||
.keyframes([
|
||||
{ offset: 0, opacity: '1', right: '-100%' },
|
||||
{ offset: 1, opacity: '1', right: '0px' }
|
||||
]);
|
||||
|
||||
return this.animationController.create()
|
||||
.addElement(baseEl)
|
||||
.easing('ease-out')
|
||||
.duration(500)
|
||||
.addAnimation([backdropAnimation, wrapperAnimation]);
|
||||
}
|
||||
|
||||
const leaveAnimation = (baseEl: any) => {
|
||||
return enterAnimation(baseEl).direction('reverse');
|
||||
}
|
||||
|
||||
|
||||
const modal = await this.modalController.create({
|
||||
enterAnimation,
|
||||
leaveAnimation,
|
||||
component: PinPage,
|
||||
cssClass: 'model profile-modal',
|
||||
componentProps: {
|
||||
}
|
||||
});
|
||||
return await modal.present();
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user