Skip to content

Commit

Permalink
Display and style message thread on member's profile page
Browse files Browse the repository at this point in the history
  • Loading branch information
marvac committed Feb 27, 2019
1 parent 32d3a64 commit 757a04b
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 3 deletions.
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;
}
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>

0 comments on commit 757a04b

Please sign in to comment.