changes in profile

This commit is contained in:
tiago.kayaya
2021-07-28 16:27:10 +01:00
parent ba82497d8e
commit 8b3d195403
14 changed files with 619 additions and 228 deletions
+39 -96
View File
@@ -6,6 +6,7 @@ import { AuthService } from 'src/app/services/auth.service';
import { FingerprintPage } from 'src/app/shared/fingerprint/fingerprint.page';
import { PinPage } from 'src/app/shared/pin/pin.page';
import { LocalstoreService } from 'src/app/store/localstore.service';
import { EditProfilePage } from './edit-profile/edit-profile.page';
@Component({
selector: 'app-profile',
@@ -37,80 +38,7 @@ export class ProfilePage implements OnInit {
this.modalController.dismiss();
}
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: {
}
});
modal.present();
}
async addFingerprint() {
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: FingerprintPage,
cssClass: 'model profile-modal',
componentProps: {
}
});
modal.present();
}
notImplemented(){}
logout() {
// clear local storage
@@ -121,28 +49,6 @@ export class ProfilePage implements OnInit {
location.reload();
}, 1000)
}
LoginPreferenceMethod(type: string) {
let userData = this.localstoreService.get('UserData', {})
if (userData.hasOwnProperty('loginPreference')) {
if (userData.loginPreference != type) {
if (type) {
userData.loginPreference = type
}
} else {
userData.loginPreference = 'none'
}
} else {
userData.loginPreference = 'none'
}
this.localstoreService.set('UserData', userData)
}
checkState() {
@@ -157,4 +63,41 @@ export class ProfilePage implements OnInit {
}
async editProfile() {
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: EditProfilePage,
cssClass: 'model profile-modal',
componentProps: {
}
});
return await modal.present();
}
}