-style approve entents for desktop finished

-style expedient  for desktop ongoing
This commit is contained in:
tiago.kayaya
2021-03-18 16:30:03 +01:00
parent c16fc7197a
commit 2c766015e7
31 changed files with 685 additions and 94 deletions
@@ -147,6 +147,17 @@ export class MessagesPage implements OnInit, AfterViewChecked, OnChanges {
modal.onDidDismiss();
}
openSendMessageOptions(ev:any){
if(window.innerWidth <= 1024){
console.log('mobile');
this.openChatOptions(ev);
}
else{
console.log('desktop');
this._openChatOptions();
}
}
async openChatOptions(ev: any) {
const popover = await this.popoverController.create({
component: ChatOptionsPopoverPage,
@@ -208,5 +219,57 @@ export class MessagesPage implements OnInit, AfterViewChecked, OnChanges {
return await modal.present();
}
async _openChatOptions() {
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 popover = await this.popoverController.create({
component: MessagesOptionsPage,
componentProps: {
roomId: this.dm._id,
},
cssClass: 'messages-options',
event: ev,
translucent: true,
});
return await popover.present(); */
const modal = await this.modalController.create({
enterAnimation,
leaveAnimation,
component: ChatOptionsPopoverPage,
cssClass: 'model profile-modal search-submodal',
componentProps: {
roomId: this.roomId,
}
});
return await modal.present();
}
}