Skip to content
This repository has been archived by the owner on Aug 3, 2018. It is now read-only.

Commit

Permalink
Merge pull request #68 from Sirimangalo/feat/questions
Browse files Browse the repository at this point in the history
feat: add mark as question feature
  • Loading branch information
binarious authored Aug 6, 2016
2 parents f06698a + a1233e7 commit d75ae22
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/app/emoji/emoji-select.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export class EmojiSelectComponent {

// Emojis that should be displayed for selection
emojiList: string[] = [
'question',
'slight_smile',
'sunglasses',
'grin',
Expand Down
4 changes: 4 additions & 0 deletions src/app/message/message.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,10 @@ export class MessageComponent {
this.messageList.nativeElement.scrollTop = this.messageList.nativeElement.scrollHeight;
}

isQuestion(str: string): boolean {
return str.indexOf(':question:') >= 0 ? true : false;
}

ngOnDestroy() {
this.messageSocket.unsubscribe();
}
Expand Down
4 changes: 4 additions & 0 deletions src/app/message/message.css
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@ md-list p[md-line] {
display: none;
}

.message-question {
background: rgba(180, 231, 206, .6);
}

.old-chat {
opacity: .7;
}
2 changes: 1 addition & 1 deletion src/app/message/message.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
</div>

<md-list>
<div *ngFor="let message of messages" class="message-row">
<div *ngFor="let message of messages" class="message-row" [class.message-question]="isQuestion(message.text)">
<md-list-item>
<img [routerLink]="['/profile', message.user._id]" md-list-avatar avatar [hash]="message.user.gravatarHash" [size]="40">
<h3 md-line>
Expand Down

0 comments on commit d75ae22

Please sign in to comment.