This commit is contained in:
tiago.kayaya
2021-07-26 14:09:26 +01:00
parent 8be47ab2e7
commit 2ca3859f87
5 changed files with 41 additions and 27 deletions
@@ -37,19 +37,21 @@
<ion-label>Esta conversa passou a grupo</ion-label><br /> <ion-label>Esta conversa passou a grupo</ion-label><br />
<ion-label>A conversa original mantêm-se como chat individual</ion-label> <ion-label>A conversa original mantêm-se como chat individual</ion-label>
</div> </div>
<div *ngFor="let msg of messages" class="messages" #scrollMe> <div class="messages overflow-y-auto" #scrollMe>
<div *ngIf="msg.t != 'r'" class='incoming-{{msg.u.username!=loggedUser.me.username}}'> <div *ngFor="let msg of messages" >
<div class="title"> <div *ngIf="msg.t != 'r'" class='incoming-{{msg.u.username!=loggedUser.me.username}}'>
<ion-label>{{msg.u.name}}</ion-label> <div class="title">
<span class="time">{{msg._updatedAt | date: 'HH:mm' }}</span> <ion-label>{{msg.u.name}}</ion-label>
<span class="time">{{msg._updatedAt | date: 'HH:mm' }}</span>
</div>
<div>
<ion-label>{{msg.msg}}</ion-label>
</div>
</div> </div>
<div> <div *ngIf="msg.t == 'r'" class="info-text">
<ion-label>{{msg.msg}}</ion-label> <ion-label>Alterou o assunto para "{{msg.msg.split('-').join(' ')}}"</ion-label><br />
</div> </div>
</div> </div>
<div *ngIf="msg.t == 'r'" class="info-text">
<ion-label>Alterou o assunto para "{{msg.msg.split('-').join(' ')}}"</ion-label><br />
</div>
</div> </div>
<div *ngIf="leaveStatus" class="info-text-leave"> <div *ngIf="leaveStatus" class="info-text-leave">
<ion-label>{{leaveStatus}}</ion-label> <ion-label>{{leaveStatus}}</ion-label>
@@ -123,6 +123,8 @@
font-size: 13px; font-size: 13px;
font-family: Roboto; font-family: Roboto;
overflow: auto; overflow: auto;
width: 100%;
//height: 100%;
.incoming-true, .incoming-false{ .incoming-true, .incoming-false{
width: 305px; width: 305px;
@@ -1,4 +1,4 @@
import { Component, OnInit } from '@angular/core'; import { Component, ElementRef, OnInit, ViewChild } from '@angular/core';
import { ActionSheetController, MenuController, ModalController, NavParams, PopoverController } from '@ionic/angular'; import { ActionSheetController, MenuController, ModalController, NavParams, PopoverController } from '@ionic/angular';
import { AlertService } from 'src/app/services/alert.service'; import { AlertService } from 'src/app/services/alert.service';
import { AuthService } from 'src/app/services/auth.service'; import { AuthService } from 'src/app/services/auth.service';
@@ -30,6 +30,8 @@ export class GroupMessagesPage implements OnInit {
roomId: string; roomId: string;
loggedUserChat:any; loggedUserChat:any;
@ViewChild('scrollMe') private myScrollContainer: ElementRef;
constructor( constructor(
private menu: MenuController, private menu: MenuController,
private modalController: ModalController, private modalController: ModalController,
@@ -51,8 +53,14 @@ export class GroupMessagesPage implements OnInit {
this.getRoomInfo(); this.getRoomInfo();
} }
notImplemented(){ ngAfterViewChecked() {
this.alertService.presentAlert('Funcionalidade em desenvolvimento'); this.scrollToBottom();
}
scrollToBottom(): void {
try {
this.myScrollContainer.nativeElement.scrollTop = this.myScrollContainer.nativeElement.scrollHeight;
} catch(err) { }
} }
getRoomInfo(){ getRoomInfo(){
@@ -32,11 +32,12 @@
<ion-refresher-content> <ion-refresher-content>
</ion-refresher-content> </ion-refresher-content>
</ion-refresher> </ion-refresher>
<div class="welcome-text">
<ion-label> {{message}} Esta conversa passou a grupo</ion-label><br /> <div class="messages overflow-y-auto" #scrollMe>
<ion-label>A conversa original mantêm-se como chat individual</ion-label> <div class="welcome-text">
</div> <ion-label> Esta conversa passou a grupo</ion-label><br />
<div class="messages" #scrollMe> <ion-label>A conversa original mantêm-se como chat individual</ion-label>
</div>
<div class="container-width-100" *ngFor="let msg of messages" #scrollMe> <div class="container-width-100" *ngFor="let msg of messages" #scrollMe>
<div *ngIf="msg.t != 'r'" class='incoming-{{msg.u.username!=loggedUser.me.username}} max-width-45'> <div *ngIf="msg.t != 'r'" class='incoming-{{msg.u.username!=loggedUser.me.username}} max-width-45'>
<div class="title"> <div class="title">
@@ -117,7 +117,8 @@
.messages{ .messages{
font-size: 13px; font-size: 13px;
font-family: Roboto; font-family: Roboto;
overflow: auto; width: 100%;
height: 100%;
.incoming-true, .incoming-false{ .incoming-true, .incoming-false{
padding: 15px 20px; padding: 15px 20px;