Skip to content

Commit a0e5f36

Browse files
Restructured render methods in mgt-person-card (#335)
* Restructured render methods in mgt-person-card. Added hasTemplate() method to TemplatedComponent. Co-authored-by: Nikola Metulev <[email protected]>
1 parent 6efb757 commit a0e5f36

File tree

5 files changed

+424
-246
lines changed

5 files changed

+424
-246
lines changed

src/components/mgt-agenda/mgt-agenda.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,7 @@ export class MgtAgenda extends MgtTemplatedComponent {
418418
* @memberof MgtAgenda
419419
*/
420420
protected renderOther(event: MicrosoftGraph.Event): TemplateResult {
421-
return this.templates['event-other']
421+
return this.hasTemplate('event-other')
422422
? html`
423423
${this.renderTemplate('event-other', { event }, event.id + '-other')}
424424
`

src/components/mgt-get/mgt-get.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ export class MgtGet extends MgtTemplatedComponent {
145145
} else if (this.error) {
146146
return this.renderTemplate('error', this.error);
147147
// tslint:disable-next-line: no-string-literal
148-
} else if (this.templates['value'] && this.response && this.response.value) {
148+
} else if (this.hasTemplate('value') && this.response && this.response.value) {
149149
let valueContent;
150150

151151
if (Array.isArray(this.response.value)) {
@@ -161,7 +161,7 @@ export class MgtGet extends MgtTemplatedComponent {
161161
}
162162

163163
// tslint:disable-next-line: no-string-literal
164-
if (this.templates['default']) {
164+
if (this.hasTemplate('default')) {
165165
const defaultContent = this.renderTemplate('default', this.response);
166166

167167
// tslint:disable-next-line: no-string-literal

src/components/mgt-person-card/mgt-person-card.scss

Lines changed: 42 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ $color: var(--color, #{$ms-color-neutralDark});
1919
box-shadow: 0px 0px 4.55172px rgba(0, 0, 0, 0.16);
2020
font-family: var(--default-font-family);
2121

22-
.default-view {
22+
.person-details-container {
2323
display: flex;
2424
padding: 18px 14px;
2525

@@ -65,73 +65,70 @@ $color: var(--color, #{$ms-color-neutralDark});
6565
}
6666
}
6767

68-
.additional-details-container {
69-
.additional-details-button {
68+
.expanded-details-container {
69+
.expanded-details-button {
7070
display: flex;
7171
justify-content: center;
7272
align-items: center;
7373
height: 28px;
7474
background: rgba(196, 196, 196, 0.1);
75-
.additional-details-svg {
75+
.expanded-details-svg {
7676
margin-bottom: 3px;
7777
}
7878
}
79-
.additional-details-button:hover {
79+
.expanded-details-button:hover {
8080
background-color: rgba(0, 0, 0, 0.068);
8181
}
82-
.additional-details-info {
82+
.expanded-details-info {
8383
margin: 0 0 0 20px;
8484
padding-bottom: 18px;
85+
display: flex;
86+
flex-direction: column;
8587

8688
.contact-text {
8789
margin: 0 0 24px 0;
8890
font-weight: 600;
8991
font-size: 14px;
9092
color: #000000;
9193
}
92-
.additional-details-row {
93-
display: flex;
94-
.additional-details-item {
95-
line-height: normal;
96-
font-style: normal;
97-
font-weight: normal;
98-
font-size: 15px;
99-
.icons {
100-
text-align: left;
101-
.details-icon {
102-
margin: 0 0 10px 0;
103-
display: flex;
104-
flex-direction: row;
105-
align-items: center;
106-
}
107-
}
108-
.data {
109-
display: block;
110-
margin: 0 0 0px 10px;
111-
white-space: nowrap;
112-
overflow: hidden;
113-
text-overflow: ellipsis;
114-
width: 280px;
115-
}
116-
.normal-subtitle {
117-
padding-top: 2px;
118-
}
119-
.link-subtitle {
120-
color: #3078cd;
121-
cursor: pointer;
122-
}
123-
.link-subtitle:hover {
124-
opacity: 0.6;
125-
}
94+
95+
.icons {
96+
line-height: normal;
97+
font-style: normal;
98+
font-weight: normal;
99+
font-size: 15px;
100+
text-align: left;
101+
102+
.details-icon {
103+
margin: 0 0 10px 0;
104+
display: flex;
105+
flex-direction: row;
106+
align-items: center;
126107
}
127108
}
128-
.section-divider {
129-
width: 96%;
130-
height: 1px;
131-
background: #eaeaea;
109+
.data {
110+
display: block;
111+
margin: 0 0 0px 10px;
112+
white-space: nowrap;
113+
overflow: hidden;
114+
text-overflow: ellipsis;
115+
width: 280px;
132116
}
133-
.custom-section {
117+
.normal-subtitle {
118+
padding-top: 2px;
134119
}
120+
.link-subtitle {
121+
color: #3078cd;
122+
cursor: pointer;
123+
}
124+
.link-subtitle:hover {
125+
opacity: 0.6;
126+
}
127+
}
128+
.section-divider {
129+
width: 96%;
130+
height: 1px;
131+
background: #eaeaea;
135132
}
136133
}
137134
}

0 commit comments

Comments
 (0)