-
Notifications
You must be signed in to change notification settings - Fork 0
/
message-thread.html
43 lines (37 loc) · 1.03 KB
/
message-thread.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<link rel="import" href="bower_components/polymer/polymer.html">
<!--
##### Example
<message-thread></message-thread>
@element message-thread
@blurb Element providing solution to [...].
@status [...]
-->
<polymer-element name="message-thread" attributes="thread" noscript>
<template>
<style>
.message-container {
margin: 50px 0;
height: 210px;
overflow: auto;
}
.message[fromSelf] {
color: white;
background-color: #4285f4;
align-self: flex-end;
}
.message {
background-color: rgba(0, 0, 0, .1);
margin-top: 10px;
border-radius: 5px;
padding: 7px;
min-height: 17px;
align-self: flex-start;
}
</style>
<div class="message-container" layout vertical hidden?="{{thread === undefined}}">
<template repeat="{{message in thread.messages}}">
<div class="message" fromSelf?="{{message.from == 'Me'}}">{{message.message}}</div>
</template>
</div>
</template>
</polymer-element>