@progressive-development/pd-contact 0.1.67 → 0.1.69
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/PdContact.js +13 -2
package/package.json
CHANGED
package/src/PdContact.js
CHANGED
|
@@ -369,7 +369,12 @@ function transformPhone(phone, country) {
|
|
|
369
369
|
}
|
|
370
370
|
|
|
371
371
|
_renderViewContact() {
|
|
372
|
-
|
|
372
|
+
|
|
373
|
+
if(!this.contact) {
|
|
374
|
+
return html`<p>Contact undefined</p>`;
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
const trPhoneNr = transformPhone(this.contact.phone1, this.contact.country || "be");
|
|
373
378
|
return html`
|
|
374
379
|
<address>
|
|
375
380
|
<dl>
|
|
@@ -383,6 +388,8 @@ function transformPhone(phone, country) {
|
|
|
383
388
|
<dd>${this._getFullLocation()}</dd>
|
|
384
389
|
${this.contact.additionalHint ? html`<dd>${this.contact.additionalHint}</dd>` : ''}
|
|
385
390
|
<dd>${this.contact.country}</dd>
|
|
391
|
+
|
|
392
|
+
${this.contact.phone1 ? html`
|
|
386
393
|
<dd class="larger">${this.phoneMailLink && trPhoneNr ? html`
|
|
387
394
|
<a href="${`tel:${trPhoneNr}`}"
|
|
388
395
|
aria-label="${`Phone call: ${this.contact.phone1}`}"
|
|
@@ -391,6 +398,9 @@ function transformPhone(phone, country) {
|
|
|
391
398
|
<pd-icon activeIcon icon="phoneIcon" class="round link-icon"></pd-icon>
|
|
392
399
|
</a>
|
|
393
400
|
` : this.contact.phone1}</dd>
|
|
401
|
+
` : ''}
|
|
402
|
+
|
|
403
|
+
${this.contact.email ? html`
|
|
394
404
|
<dd class="larger">${this.phoneMailLink ? html`
|
|
395
405
|
<a href="${`mailto:${this.contact.email}`}"
|
|
396
406
|
aria-label="${`Send mail: ${this.contact.email}`}"
|
|
@@ -398,7 +408,8 @@ function transformPhone(phone, country) {
|
|
|
398
408
|
<span style="margin-right: 8px;">${this.contact.email}</span>
|
|
399
409
|
<pd-icon activeIcon icon="mailIcon" class="round link-icon"></pd-icon>
|
|
400
410
|
</a>
|
|
401
|
-
` : this.contact.email}</dd>
|
|
411
|
+
` : this.contact.email}</dd>
|
|
412
|
+
` : ''}
|
|
402
413
|
|
|
403
414
|
${this.contact.btw
|
|
404
415
|
? html`<dt>BTW</dt>
|