-
Notifications
You must be signed in to change notification settings - Fork 2
/
paper-drawer-title.html
95 lines (75 loc) · 1.74 KB
/
paper-drawer-title.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
<!doctype html>
<link rel="import" href="../polymer/polymer.html">
<link rel="import" href="../paper-styles/paper-styles.html">
<!--
Title section of the drawer
### Styling
Style | Description
------------------------------------- | ------------
--paper-drawer-title-background-color | Background color of the title area
--paper-drawer-title-color | Font color of the name and email
--paper-drawer-title | Mix-in applied to the title area
@demo demo/index.html
-->
<dom-module id="paper-drawer-title">
<template>
<style>
:host {
display: block;
padding: 16px 16px 0 16px;
background: var(--paper-drawer-title-background-color, black);
@apply --paper-drawer-title;
cursor: pointer;
}
.photo {
height: 60px;
width: 60px;
border-radius: 50%;
display: block;
}
.sub-title {
color: var(--paper-drawer-title-color, white);
min-height: 56px;
height: 56px;
@apply --layout-vertical;
@apply --layout-center-justified;
@apply --layout-flex;
@apply --paper-font-body1;
}
.name,.email {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
</style>
<img src="[[_emptyIfUndefined(photo)]]" class="photo" />
<div class="sub-title">
<div class="name">[[name]]</div>
<div class="email">[[email]]</div>
</div>
</template>
</dom-module>
<script>
(function() {
Polymer({
is: 'paper-drawer-title',
properties: {
/**
* URL to the photo of the person
*/
photo: String,
/**
* Name of the person
*/
name: String,
/**
* Email of the person
*/
email: String,
},
_emptyIfUndefined: function(photo) {
return photo || '';
},
});
})();
</script>