Skip to content

Commit

Permalink
reverting from preact approach
Browse files Browse the repository at this point in the history
  • Loading branch information
qiyundai committed Mar 31, 2024
1 parent a31409a commit 975586a
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 35 deletions.
16 changes: 16 additions & 0 deletions blocks/checkbox-component/checkbox-component.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
export default function init(el) {
const incasingFormHandler = el.closest('.form-handler');
if (!incasingFormHandler) return;

const heading = el.querySelector('h2')?.textContent.trim();
const tooltip = el.querySelector('p > em')?.textContent.trim();
const checkboxes = Array.from(el.querySelectorAll('ul > li'))?.map((li) => li.textContent.trim());
const props = {
heading,
tooltip,
checkboxes,
};

el.innerHTML = '';
console.log(props);
}
35 changes: 0 additions & 35 deletions blocks/checkbox-section/checkbox-section.js

This file was deleted.

0 comments on commit 975586a

Please sign in to comment.