style menus

This commit is contained in:
tiago.kayaya
2021-03-18 09:25:59 +01:00
parent 1b5d98dd2b
commit c16fc7197a
17 changed files with 291 additions and 50 deletions
+54 -1
View File
@@ -1,10 +1,11 @@
import { AfterViewChecked, Component, ElementRef, Input, OnChanges, OnInit, SimpleChanges, ViewChild } from '@angular/core';
import { ModalController, NavParams, PopoverController } from '@ionic/angular';
import { AnimationController, ModalController, NavParams, PopoverController } from '@ionic/angular';
import { Status } from 'src/app/models/chat/status.model';
import { AuthService } from 'src/app/services/auth.service';
import { ChatService } from 'src/app/services/chat.service';
import { ChatOptionsPopoverPage } from 'src/app/shared/popover/chat-options-popover/chat-options-popover.page';
import { MessagesOptionsPage } from 'src/app/shared/popover/messages-options/messages-options.page';
import { ProfileComponent } from '../../headers/header-no-search/profile/profile.component';
import { ContactsPage } from '../new-group/contacts/contacts.page';
@Component({
@@ -33,6 +34,7 @@ export class MessagesPage implements OnInit, AfterViewChecked, OnChanges {
/* private navParams: NavParams, */
private chatService: ChatService,
private authService: AuthService,
private animationController: AnimationController,
) {
/* this.dm = this.navParams.get('dm'); */
}
@@ -155,5 +157,56 @@ export class MessagesPage implements OnInit, AfterViewChecked, OnChanges {
return await popover.present();
}
async _openMessagesOptions() {
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: MessagesOptionsPage,
cssClass: 'model profile-modal search-submodal',
componentProps: {
roomId: this.roomId,
}
});
return await modal.present();
}
}