try frontend...

This commit is contained in:
wilfried 2021-05-30 10:40:48 +02:00
parent 1dcf975c97
commit 362a1f236b
3 changed files with 52 additions and 80 deletions

View file

@ -5,35 +5,34 @@
<div class="user-list-card"> <div class="user-list-card">
<div class="user-card" <div class="user-card"
[ngClass]="{'active' : user?.login === selectedUser?.login}"
*ngFor="let user of dataSource.data"
(click)="selectUserHandler(user.login)"
> >
<!----> <!---->
<img src="../../assets/image/user.png" height="25" width="25"/> <img src="../../assets/image/user.png" height="25" width="25"/>
<p class="username">{{user?.login}}</p> <p class="username">{{username}}</p>
</div> </div>
</div> </div>
</div> </div>
<div class="col-md-8"> <div class="col-md-8">
<div class="chat-container">
<ng-container >
<div class="chat-header"> <div class="chat-header">
<p class="username">{{username}}</p> <p class="username">General Chat</p>
</div> </div>
<div class="chat-body"> <div class="chat-body">
<div *ngFor="let item of messageArray">
<span><strong>{{item.user}} : </strong> {{item.message}}</span>
</div>
<ul #ulMessages id="messages"> <ul #ulMessages id="messages">
</ul> </ul>
</div> </div>
<div class="chat-footer"> <div class="chat-footer">
<div class="row"> <div class="row">
<div class="col-md-10"> <div class="col-md-10">
@ -48,8 +47,6 @@
</div> </div>
</div> </div>
</ng-container>
</div>
</div> </div>
</div> </div>
</div> </div>

View file

@ -11,7 +11,7 @@ import {MessageService} from "../services/message/message.service";
}) })
export class GeneralComponent implements OnInit { export class GeneralComponent implements OnInit {
private username = sessionStorage.getItem('login'); public username = sessionStorage.getItem('login');
private room = 'general'; private room = 'general';
public msg = ''; public msg = '';

View file

@ -47,8 +47,12 @@ body {
position: relative; position: relative;
overflow: hidden; overflow: hidden;
.chat-header {
}
.chat-header {
height: 70px; height: 70px;
border-radius: 10px;
background-color: #E5E5E5; background-color: #E5E5E5;
display: flex; display: flex;
justify-content: flex-start; justify-content: flex-start;
@ -63,51 +67,22 @@ body {
justify-content: center; justify-content: center;
align-items: center; align-items: center;
} }
} }
.chat-body { .chat-body {
background-image: url(./assets/image/fond.png);
background-repeat: no-repeat;
background-size: cover;
background-position: center center;
height: calc(100vh - 125px);
overflow-y: auto;
.message-container {
background-color: white; background-color: white;
padding: 7px; border-radius: 10px;
border-radius: 5px; height: calc(89.5vh - 89.5px);
width: fit-content; overflow-y: auto;
max-width: 90%; }
margin-bottom: 15px;
}
.same-user { .chat-footer {
display: flex; border-radius: 10px;
justify-content: flex-end;
.message-container {
background-color: lightskyblue;
}
}
}
.chat-footer {
position: absolute;
bottom: 0; bottom: 0;
left: 0; left: 0;
right: 0; right: 0;
background-color: #EDEDED; background-color: #EDEDED;
padding: 10px 20px; padding: 10px 20px;
.form-control {
background-color: white;
border: 1px solid #D8DDEC;
box-sizing: border-box;
font-size: 1rem;
color: black;
}
}
} }
.modal-footer { .modal-footer {