mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 21:06:06 +00:00
Add profile modal
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { ModalController } from '@ionic/angular';
|
||||
import { AnimationController, ModalController } from '@ionic/angular';
|
||||
import { SearchPage } from 'src/app/pages/search/search.page';
|
||||
import { MenuController } from '@ionic/angular';
|
||||
|
||||
import { ProfileComponent } from './profile/profile.component';
|
||||
@Component({
|
||||
selector: 'app-header-no-search',
|
||||
templateUrl: './header-no-search.page.html',
|
||||
@@ -11,15 +11,43 @@ import { MenuController } from '@ionic/angular';
|
||||
export class HeaderNoSearchPage implements OnInit {
|
||||
|
||||
constructor(private modalController: ModalController,
|
||||
private menu: MenuController) { }
|
||||
private menu: MenuController,
|
||||
private animationController: AnimationController,) { }
|
||||
|
||||
ngOnInit() {
|
||||
}
|
||||
|
||||
async openSearch() {
|
||||
|
||||
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({
|
||||
component: SearchPage,
|
||||
cssClass: 'group-messages',
|
||||
enterAnimation,
|
||||
leaveAnimation,
|
||||
component: ProfileComponent,
|
||||
cssClass: 'model profile-modal',
|
||||
componentProps: {
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user