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
@@ -26,9 +26,6 @@
</ion-refresher-content>
</ion-refresher>
<div class="main-content">
<div *ngIf="members">
<ion-label class="members-label">Contactos selecção:</ion-label>
@@ -6,7 +6,7 @@
<ion-label class="title">{{room.name.split('-').join(' ')}}</ion-label>
</div>
<div class="right">
<ion-icon (click)="openOptions()" src="assets/images/icons-menu.svg"></ion-icon>
<ion-icon (click)="openGroupMessagesOptions()" src="assets/images/icons-menu.svg"></ion-icon>
</div>
</div>
<div (click)="openGroupContactsPage()" class="header-bottom">
@@ -1,5 +1,5 @@
import { Component, OnChanges, OnInit, Input, SimpleChanges, Output, EventEmitter} from '@angular/core';
import { ActionSheetController, MenuController, ModalController, PopoverController } from '@ionic/angular';
import { ActionSheetController, AnimationController, MenuController, ModalController, PopoverController } from '@ionic/angular';
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';
@@ -34,6 +34,7 @@ export class GroupMessagesPage implements OnInit, OnChanges {
public popoverController: PopoverController,
private chatService: ChatService,
private authService: AuthService,
private animationController: AnimationController,
) {
this.isGroupCreated = true;
}
@@ -137,6 +138,55 @@ export class GroupMessagesPage implements OnInit, OnChanges {
});
this.message = "";
}
async openGroupMessagesOptions() {
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: ChatPopoverPage,
cssClass: 'model profile-modal search-submodal',
componentProps: {
roomId: this.roomId,
}
});
return await modal.present();
}
/* async openOptions(ev: any) {
const popover = await this.popoverController.create({