diff --git a/blocks/connect/connect.js b/blocks/connect/connect.js new file mode 100644 index 00000000..c015f5f8 --- /dev/null +++ b/blocks/connect/connect.js @@ -0,0 +1,27 @@ +import { + a, + div, + span, +} from '../../scripts/dom-builder.js'; + +export default function decorate(block) { + const image = block.querySelector('picture'); + const anchorLink = block.querySelector('a'); + const bodytext = block.children[1].textContent.trim(); + const container = div( + { class: 'linkedin-bottom wide-section padding-btm' }, + div( + { class: 'outer' }, + a( + { + class: 'text-link', href: anchorLink.href, title: anchorLink.title, 'aria-label': anchorLink.title, + }, + image, + span({ class: 'text' }, bodytext), + span({ class: 'btn' }, anchorLink.textContent), + ), + ), + ); + block.innerHTML = ''; + block.append(container); +}