Skip to content

Commit

Permalink
fixed line indentation lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Gowtami committed Oct 25, 2023
1 parent dca7478 commit 04d2470
Showing 1 changed file with 27 additions and 22 deletions.
49 changes: 27 additions & 22 deletions blocks/contactus/contactus.js
Original file line number Diff line number Diff line change
@@ -1,25 +1,30 @@
export default function decorate() {
const contactUsClass = document.getElementsByClassName('contactus block');
contactUsClass[0].setAttribute('id', 'section-support');
contactUsClass[0].children[0].setAttribute('class', 'outer');
contactUsClass[0].children[0].children[0].setAttribute('class', 'text');
const contactUsDiv = contactUsClass[0].children[0].children[0];
const pTags = contactUsDiv.getElementsByTagName('p');
let innerElements = '';
let phone = '';
for (let i = 0; i < pTags.length; i += 1) {
if (i === 0) {
const ContactUsTitle = pTags[i].outerHTML.replace(/<p>/g, '<h2>');
innerElements += ContactUsTitle.replace(/<\/p>/g, '</h2>');
} else if (i === 1) {
innerElements += pTags[i].outerHTML;
} else if (i === 3) {
phone = pTags[2].outerHTML.replace(/<p>/g, `<a class="phone" href="tel:' ${pTags[2].innerHTML.trim()} '">`);
phone.replace(/<\/p>/g, '</a>');
pTags[i].innerHTML = `<div class="buttons">' ${phone + pTags[i].innerHTML} '</div>`;
const button = pTags[i].outerHTML.replace(/<p>/g, '');
innerElements += button.replace(/<\/p>/g, '');
}
const contactUsClass = document.getElementsByClassName('contactus block');
contactUsClass[0].setAttribute('id', 'section-support');
contactUsClass[0].children[0].setAttribute('class', 'outer');
contactUsClass[0].children[0].children[0].setAttribute('class', 'text');
const contactUsDiv = contactUsClass[0].children[0].children[0];
const pTags = contactUsDiv.getElementsByTagName('p');
let innerElements = '';
let phone = '';
for (let i = 0; i < pTags.length; i += 1) {
if (i === 0) {
const ContactUsTitle = pTags[i].outerHTML.replace(/<p>/g, '<h2>');
innerElements += ContactUsTitle.replace(/<\/p>/g, '</h2>');
} else if (i === 1) {
innerElements += pTags[i].outerHTML;
} else if (i === 3) {
phone = pTags[2].outerHTML.replace(
/<p>/g,
`<a class='phone' href="tel:' ${pTags[2].innerHTML.trim()} '">`

Check failure on line 19 in blocks/contactus/contactus.js

View workflow job for this annotation

GitHub Actions / build

Missing trailing comma
);
phone.replace(/<\/p>/g, '</a>');
pTags[i].innerHTML = `<div class="buttons">' ${
phone + pTags[i].innerHTML
} '</div>`;
const button = pTags[i].outerHTML.replace(/<p>/g, '');
innerElements += button.replace(/<\/p>/g, '');
}
contactUsDiv.innerHTML = innerElements;
}
contactUsDiv.innerHTML = innerElements;
}

0 comments on commit 04d2470

Please sign in to comment.