mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 12:37:53 +00:00
style menus
This commit is contained in:
@@ -92,7 +92,7 @@
|
||||
<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-contacts *ngIf="showContacts" class="d-flex height-100"></app-contacts>
|
||||
<app-contacts (openMessage)="openMessagesPage($event)" *ngIf="showContacts" class="d-flex height-100 flex-column"></app-contacts>
|
||||
<app-new-group (addGroupMessage)="openGroupContactsPage($event)" *ngIf="showNewGroup" class="d-flex height-100 flex-column"></app-new-group>
|
||||
<app-group-contacts (openGroupMessage)="openGroupMessagesPage($event)" [roomId]="groupRoomId" class="d-flex height-100 flex-column" *ngIf="showGroupContacts"></app-group-contacts>
|
||||
<app-group-messages (openGroupContacts)="openGroupContactsPage($event)" *ngIf="showGroupMessages" class="d-flex height-100 flex-column" [roomId]="roomId" #messagecontainer></app-group-messages>
|
||||
|
||||
@@ -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({
|
||||
|
||||
@@ -19,20 +19,22 @@
|
||||
</ion-header>
|
||||
|
||||
<ion-content>
|
||||
|
||||
<ion-refresher name="refresher" slot="fixed" (ionRefresh)="doRefresh($event)">
|
||||
<ion-progress-bar type="indeterminate" *ngIf="showLoader"></ion-progress-bar>
|
||||
<ion-refresher-content>
|
||||
</ion-refresher-content>
|
||||
</ion-refresher>
|
||||
|
||||
<div class="main-content">
|
||||
|
||||
<ion-virtual-scroll [items]="users | filter:textSearch: 'name'" approxItemHeight="70px" [headerFn]="separateLetter">
|
||||
<ion-virtual-scroll [items]="users" approxItemHeight="70px" [headerFn]="separateLetter">
|
||||
|
||||
<div class="item-divider" *virtualHeader="let header">
|
||||
<ion-label>{{header}}</ion-label>
|
||||
</div>
|
||||
|
||||
<div (click)="createRoom(user.username)" *virtualItem="let user" class="item-user">
|
||||
<div (click)="openMessagesPage(user.username)" *virtualItem="let user" class="item-user">
|
||||
<p>{{user.name}}</p>
|
||||
<span class="icon">
|
||||
<ion-icon class="{{user.status}}" slot="end" name="ellipse"></ion-icon>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
--opacity: 1;
|
||||
|
||||
.main-header{
|
||||
width: 100%; /* 400px */
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
font-family: Roboto;
|
||||
border-top-left-radius: 25px;
|
||||
@@ -27,7 +27,6 @@
|
||||
padding-left: 20px;
|
||||
}
|
||||
.title-content{
|
||||
width: 360px;
|
||||
margin: 0px auto;
|
||||
overflow: auto;
|
||||
padding: 0 !important;
|
||||
@@ -80,13 +79,13 @@
|
||||
--background:transparent;
|
||||
}
|
||||
.main-content{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
font-family: Roboto;
|
||||
margin: 0 auto;
|
||||
background-color: #fff;
|
||||
overflow:auto;
|
||||
padding: 0 0 0 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
font-family: Roboto;
|
||||
margin: 0 auto;
|
||||
background-color: #fff;
|
||||
padding: 0 0 0 0;
|
||||
overflow:auto;
|
||||
|
||||
.item-divider{
|
||||
background: #ebebeb;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { HttpClient, HttpHeaders } from '@angular/common/http';
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { Component, EventEmitter, OnInit, Output } from '@angular/core';
|
||||
import { ModalController } from '@ionic/angular';
|
||||
import { AuthService } from 'src/app/services/auth.service';
|
||||
import { ChatService } from 'src/app/services/chat.service';
|
||||
@@ -23,6 +23,8 @@ export class ContactsPage implements OnInit {
|
||||
room:any;
|
||||
dm:any;
|
||||
|
||||
@Output() openMessage:EventEmitter<any> = new EventEmitter<any>();
|
||||
|
||||
constructor(
|
||||
private modalController: ModalController,
|
||||
private http: HttpClient,
|
||||
@@ -46,6 +48,22 @@ export class ContactsPage implements OnInit {
|
||||
this.textSearch = event.detail.value;
|
||||
}
|
||||
|
||||
openMessagesPage(username:string){
|
||||
if( window.innerWidth <= 1024){
|
||||
this.createRoom(username);
|
||||
}
|
||||
else{
|
||||
let body = {
|
||||
username: username,
|
||||
}
|
||||
this.chatService.createRoom(body).subscribe(res => {
|
||||
console.log(res);
|
||||
this.room = res['room'];
|
||||
this.openMessage.emit(this.room._id);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
loadUsers(){
|
||||
this.options = {
|
||||
headers: this.headers,
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<span><ion-icon class="{{users.status}}" name="ellipse"></ion-icon></span>
|
||||
</div>
|
||||
<div class="right">
|
||||
<ion-icon (click)="openMessagesOptions()" src="assets/images/icons-menu.svg"></ion-icon>
|
||||
<ion-icon (click)="_openMessagesOptions()" src="assets/images/icons-menu.svg"></ion-icon>
|
||||
</div>
|
||||
</div>
|
||||
<div class="header-bottom" (click)="addContacts()">
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,15 @@
|
||||
<ion-content>
|
||||
<ion-row>
|
||||
<ion-content class="container">
|
||||
<div class="arrow-right">
|
||||
<ion-icon (click)="close()" slot="end" class="arrow-right-icon" src='assets/images/icons-arrow-arrow-right.svg'></ion-icon>
|
||||
</div>
|
||||
<div class="buttons">
|
||||
<button (click)="leaveGroup()" class="btn-cancel" shape="round" >Sair do Grupo</button>
|
||||
<button (click)="openChangeGroupName()" class="btn-ok" shape="round" >Alterar nome do grupo</button>
|
||||
<div class="solid"></div>
|
||||
<button (click)="close()" full class="btn-cancel mobile-only" shape="round" >Cancelar</button>
|
||||
<button (click)="deleteGroup()" class="btn-delete" shape="round">Apagar grupo</button>
|
||||
</div>
|
||||
<!-- <ion-row>
|
||||
<ion-col>
|
||||
<button (click)="leaveGroup()" class="btn-cancel" shape="round" >Sair do Grupo</button>
|
||||
</ion-col>
|
||||
@@ -14,5 +24,5 @@
|
||||
<ion-col>
|
||||
<button (click)="deleteGroup()" class="btn-delete" shape="round">Apagar grupo</button>
|
||||
</ion-col>
|
||||
</ion-row>
|
||||
</ion-row> -->
|
||||
</ion-content>
|
||||
|
||||
@@ -1,15 +1,53 @@
|
||||
ion-row{
|
||||
padding: 10px 10px 5px 10px;
|
||||
.container{
|
||||
--padding-top:20px !important;
|
||||
--padding-bottom:20px !important;
|
||||
--padding-start:20px !important;
|
||||
--padding-end:20px !important;
|
||||
}
|
||||
.border-top{
|
||||
padding-top: 5px !important;
|
||||
border-top: 1px solid #ebebeb;
|
||||
.arrow-right{
|
||||
display: none;
|
||||
margin-bottom: 20px;
|
||||
.arrow-right-icon{
|
||||
width: 37px;
|
||||
float: right;
|
||||
font-size: 35px;
|
||||
overflow: hidden;
|
||||
}
|
||||
}
|
||||
.buttons{
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: space-around;
|
||||
}
|
||||
.solid {
|
||||
display: none;
|
||||
width: 90%;
|
||||
border-top: 1px solid #bbb;
|
||||
margin: 0 auto !important;
|
||||
}
|
||||
@media only screen and (min-width: 1024px) {
|
||||
.arrow-right{
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
.btn-cancel{
|
||||
//display: none;
|
||||
width: 100% !important;
|
||||
margin-bottom: 10px !important;
|
||||
}
|
||||
.btn-ok{
|
||||
width: 100% !important;
|
||||
margin-bottom: 10px !important;
|
||||
}
|
||||
.btn-delete{
|
||||
width: 100% !important;
|
||||
margin-bottom: 10px !important;
|
||||
margin-top: 10px !important;
|
||||
}
|
||||
.solid{
|
||||
display: block;
|
||||
}
|
||||
.mobile-only{
|
||||
display: none !important;
|
||||
}
|
||||
}
|
||||
/* ion-col{
|
||||
border: 1px solid red;
|
||||
} */
|
||||
|
||||
/* .btn-ok, .btn-cancel, .btn-delete{
|
||||
font-size: 13px;
|
||||
padding:0 !important;
|
||||
} */
|
||||
|
||||
@@ -25,7 +25,12 @@ export class ChatPopoverPage implements OnInit {
|
||||
|
||||
}
|
||||
close(){
|
||||
this.popoverController.dismiss();
|
||||
if( window.innerWidth <= 1024){
|
||||
this.popoverController.dismiss();
|
||||
}
|
||||
else{
|
||||
this.modalController.dismiss();
|
||||
}
|
||||
}
|
||||
|
||||
//Top menu options
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
<ion-content>
|
||||
<ion-row class="border-top">
|
||||
<ion-col>
|
||||
<button (click)="close()" full class="btn-cancel" shape="round" >Cancelar</button>
|
||||
</ion-col>
|
||||
<ion-col>
|
||||
<button (click)="closeChatRoom()" full class="btn-delete" shape="round" >Apagar conversa</button>
|
||||
</ion-col>
|
||||
</ion-row>
|
||||
<ion-content class="container">
|
||||
<div class="arrow-right">
|
||||
<ion-icon slot="end" class="arrow-right-icon" (click)="close()" src='assets/images/icons-arrow-arrow-right.svg'></ion-icon>
|
||||
</div>
|
||||
<div class="buttons">
|
||||
<button (click)="close()" full class="btn-cancel" shape="round" >Cancelar</button>
|
||||
<div class="solid"></div>
|
||||
<button (click)="closeChatRoom()" full class="btn-delete" shape="round" >Apagar conversa</button>
|
||||
</div>
|
||||
</ion-content>
|
||||
|
||||
@@ -1,3 +1,46 @@
|
||||
ion-row{
|
||||
padding: 10px 10px 5px 10px;
|
||||
.container{
|
||||
--padding-top:20px !important;
|
||||
--padding-bottom:20px !important;
|
||||
--padding-start:20px !important;
|
||||
--padding-end:20px !important;
|
||||
}
|
||||
.arrow-right{
|
||||
display: none;
|
||||
margin-bottom: 20px;
|
||||
.arrow-right-icon{
|
||||
width: 37px;
|
||||
float: right;
|
||||
font-size: 35px;
|
||||
overflow: hidden;
|
||||
}
|
||||
}
|
||||
.buttons{
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: space-around;
|
||||
}
|
||||
.solid {
|
||||
display: none;
|
||||
width: 90%;
|
||||
border-top: 1px solid #bbb;
|
||||
margin: 0 auto !important;
|
||||
}
|
||||
@media only screen and (min-width: 1024px) {
|
||||
.arrow-right{
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
.btn-cancel{
|
||||
display: none;
|
||||
width: 100% !important;
|
||||
margin-bottom: 10px !important;
|
||||
}
|
||||
.btn-delete{
|
||||
width: 100% !important;
|
||||
margin-bottom: 10px !important;
|
||||
margin-top: 10px !important;
|
||||
}
|
||||
/* .solid{
|
||||
display: block;
|
||||
} */
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { NavParams, PopoverController } from '@ionic/angular';
|
||||
import { ModalController, NavParams, PopoverController } from '@ionic/angular';
|
||||
import { ChatService } from 'src/app/services/chat.service';
|
||||
|
||||
@Component({
|
||||
@@ -13,6 +13,7 @@ export class MessagesOptionsPage implements OnInit {
|
||||
|
||||
constructor(
|
||||
private popoverController: PopoverController,
|
||||
private modalController: ModalController,
|
||||
private chatService: ChatService,
|
||||
private navParams: NavParams,
|
||||
)
|
||||
@@ -24,7 +25,12 @@ export class MessagesOptionsPage implements OnInit {
|
||||
}
|
||||
|
||||
close(){
|
||||
this.popoverController.dismiss();
|
||||
if( window.innerWidth <= 1024){
|
||||
this.popoverController.dismiss();
|
||||
}
|
||||
else{
|
||||
this.modalController.dismiss();
|
||||
}
|
||||
}
|
||||
|
||||
closeChatRoom(){
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="36" height="35" viewBox="0 0 36 35">
|
||||
<g fill="none" fill-rule="evenodd" stroke-linecap="round" stroke-linejoin="round">
|
||||
<g stroke="#42B9FE" stroke-width="2">
|
||||
<g>
|
||||
<g>
|
||||
<path d="M22.629 9L13.371 18 22.629 27" transform="translate(-20 -124) translate(0 99) translate(20 25)"/>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 447 B |
@@ -0,0 +1,9 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="36" height="35" viewBox="0 0 36 35">
|
||||
<g fill="none" fill-rule="evenodd" stroke-linecap="round" stroke-linejoin="round">
|
||||
<g stroke="#42B9FE" stroke-width="2">
|
||||
<g>
|
||||
<path d="M22.629 9L13.371 18 22.629 27" transform="translate(-968 -20) matrix(-1 0 0 1 1004 20)"/>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 394 B |
Reference in New Issue
Block a user