-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Display and style message thread on member's profile page
- Loading branch information
Showing
2 changed files
with
67 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
.card { | ||
border: none; | ||
} | ||
|
||
.chat { | ||
list-style: none; | ||
margin: 0; | ||
padding: 0; | ||
} | ||
|
||
.chat li { | ||
margin-bottom: 10px; | ||
padding-bottom: 5px; | ||
border-bottom: 1px dotted #B3A9A9; | ||
} | ||
|
||
.rounded-circle { | ||
height: 50px; | ||
width: 50px; | ||
} | ||
|
||
.card-body { | ||
overflow-y: scroll; | ||
height: 400px; | ||
} |
45 changes: 42 additions & 3 deletions
45
Client/src/app/components/members/member-messages/member-messages.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,42 @@ | ||
<p *ngFor="let message of messages"> | ||
{{message.content}} | ||
</p> | ||
<div class="card"> | ||
<div class="card-body"> | ||
<div *ngIf="messages?.length === 0"> | ||
<p>No messages</p> | ||
</div> | ||
<ul class="chat"> | ||
<li *ngFor="let message of messages"> | ||
<!-- to other member --> | ||
<div> | ||
<span class="chat-img float-left"> | ||
<img src="{{message.senderPhotoUrl}}" alt="{{message.senderKnownAs}}" class="rounded-circle mr-2"> | ||
</span> | ||
<div class="chat-body"> | ||
<div class="header"> | ||
<strong *ngIf="message.senderId == recipientId" class="primary-font text-warning">{{message.senderKnownAs}}</strong> | ||
<strong *ngIf="message.senderId != recipientId" class="primary-font">You</strong> | ||
<small class="text-muted float-right"> | ||
<span class="fa fa-clock-o"> {{message.messageSent | timeAgo}}</span> | ||
|
||
</small> | ||
<small *ngIf="message.senderId != recipientId"> | ||
<span *ngIf="!message.isRead" class="text-danger"> (unread)</span> | ||
</small> | ||
</div> | ||
<p>{{message.content}}</p> | ||
</div> | ||
</div> | ||
</li> | ||
</ul> | ||
|
||
</div> | ||
<div class="card-footer"> | ||
<form action=""> | ||
<div class="input-group"> | ||
<input type="text" class="form-control input-sm" placeholder="Send a message" /> | ||
<div class="input-group-append"> | ||
<button class="btn btn-primary">Send</button> | ||
</div> | ||
</div> | ||
</form> | ||
</div> | ||
</div> |