diff --git a/blocks/contactus/contactus.js b/blocks/contactus/contactus.js index 8333e3f0..8cdf7ce5 100644 --- a/blocks/contactus/contactus.js +++ b/blocks/contactus/contactus.js @@ -13,18 +13,19 @@ export default function decorate() { let phone = ''; for (let i = 0; i < pTags.length; i += 1) { if (i === 0) { - const ContactUsTitle = pTags[i].outerHTML.replace(/
/g, '
/g, '
/g, ``);
- phone.replace(/<\/p>/g, '');
- pTags[i].innerHTML = `
/g, ''); - innerElements += button.replace(/<\/p>/g, ''); + } else if (i === 2) { + phone = pTags[i].innerText; + const anchor = document.createElement('a'); + anchor.classList.add('phone'); + anchor.setAttribute('href', `tel:${phone}`); + anchor.innerText = phone; + innerElements += anchor.outerHTML; // Use anchor.outerHTML here + } else { + innerElements += pTags[i].outerHTML; } } contactUsDiv.innerHTML = innerElements; diff --git a/styles/template.css b/styles/template.css index fb1f2247..f15e2666 100644 --- a/styles/template.css +++ b/styles/template.css @@ -490,6 +490,7 @@ body { display: block; font-size: 26px; font-weight: 700; + margin-top: 30px; margin-bottom: 15px; text-decoration: none }