This commit is contained in:
tiago.kayaya
2021-03-15 15:19:07 +01:00
parent 22c8951c0f
commit 6fba6c0d64
13 changed files with 148 additions and 33 deletions
+4 -1
View File
@@ -11,6 +11,8 @@ import { SharedModule } from 'src/app/shared/shared.module';
import { RouterModule } from '@angular/router';
import { GroupMessagesPage } from 'src/app/shared/chat/group-messages/group-messages.page';
import { MessagesPage } from 'src/app/shared/chat/messages/messages.page';
import { EmptyChatPage } from 'src/app/shared/chat/empty-chat/empty-chat.page';
import { ContactsPage } from 'src/app/shared/chat/messages/contacts/contacts.page';
@NgModule({
imports: [
@@ -24,9 +26,10 @@ import { MessagesPage } from 'src/app/shared/chat/messages/messages.page';
declarations: [
ChatPage,
MessagesPage,
ContactsPage,
GroupMessagesPage,
],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
entryComponents: [MessagesPage, GroupMessagesPage]
entryComponents: [MessagesPage,ContactsPage, GroupMessagesPage]
})
export class ChatPageModule {}
+4 -2
View File
@@ -18,7 +18,7 @@
</div>
<div class="div-icon">
<ion-icon slot="end" (click)="newGroup()" src="assets/images/icons-chat-new-group.svg" ></ion-icon>
<ion-icon slot="end" (click)="selectContact()" src="assets/images/icons-chat-new-conversation.svg"></ion-icon>
<ion-icon slot="end" (click)="openContactsPage()" src="assets/images/icons-chat-new-conversation.svg"></ion-icon>
</div>
</div>
<ion-toolbar>
@@ -90,8 +90,10 @@
<!-- <ion-button (click)="openMessagesPage()">Messages</ion-button>
<ion-button (click)="openGroupMessagesPage('MduvQyrQBejb3xMrY')">Groups</ion-button>
<ion-button (click)="destroyComponent()">Destroy</ion-button> -->
<app-empty-chat class="d-flex height-100" *ngIf="showEmptyComponent"></app-empty-chat>
<app-messages class="d-flex height-100 flex-column" [roomId]="roomId" *ngIf="showMessages" #messagecontainer></app-messages>
<app-group-messages class="d-flex height-100 flex-column" [roomId]="roomId" *ngIf="showGroupMessages" #messagecontainer></app-group-messages>
<app-contacts *ngIf="showContacts" class="d-flex height-100"></app-contacts>
<app-group-messages *ngIf="showGroupMessages" class="d-flex height-100 flex-column" [roomId]="roomId" #messagecontainer></app-group-messages>
</div>
</div>
</ion-content>
+18 -1
View File
@@ -57,7 +57,9 @@ export class ChatPage implements OnInit {
componentRef: any;
roomId:any;
showEmptyComponent=true;
showMessages=false;
showContacts=false;
showGroupMessages=false;
@Output() getRoomInfo;
@@ -99,7 +101,9 @@ export class ChatPage implements OnInit {
}
closeAllDesktopComponents() {
this.showMessages=false;
this.showContacts=false;
this.showGroupMessages=false;
this.showEmptyComponent=false;
}
openMessagesPage(rid) {
if( window.innerWidth <= 1024){
@@ -107,22 +111,35 @@ export class ChatPage implements OnInit {
}
else{
this.closeAllDesktopComponents();
this.showEmptyComponent = false;
this.roomId = rid;
this.showMessages=true;
}
}
openContactsPage() {
console.log('OK');
this.closeAllDesktopComponents();
if( window.innerWidth <= 1024){
//this.selectContact();
}
else{
console.log('here');
this.showContacts=true;
}
}
openGroupMessagesPage(rid) {
if( window.innerWidth <= 1024){
this.openGroupMessagesModal(rid);
}
else{
this.closeAllDesktopComponents();
this.showEmptyComponent = false;
this.roomId = rid;
this.showGroupMessages=true;
}
}
onSegmentChange(){
this.load();
}