- Matrícula única {currency}
+ Matrícula única
+
+ {currency}
+
Contratação rápida e sem burocracia
@@ -134,6 +135,35 @@ const currency = new Intl.NumberFormat("pt-BR", {
connectedCallback() {
document.addEventListener("click", this.handleClickOutside);
+
+ const form = this.querySelector("form") as HTMLFormElement;
+ form.addEventListener("submit", (e) => {
+ e.preventDefault();
+
+ const radio = form.querySelector(
+ "input[type=radio]:checked",
+ ) as HTMLInputElement;
+
+ if (radio.value === "SINGLE") {
+ return;
+ }
+
+ // Dispatch a custom event with the selected solution,
+ // so a React component can listen to it using `window.addEventListener`.
+ window.dispatchEvent(
+ new CustomEvent("custom_event:react_form", {
+ detail: radio.value,
+ }),
+ );
+
+ window.dispatchEvent(
+ new CustomEvent("modal:open", {
+ detail: document.querySelector(
+ "#solutionmodal",
+ ) as HTMLDialogElement,
+ }),
+ );
+ });
}
disconnectedCallback() {
diff --git a/superpage/src/components/Course/Solutions.astro b/superpage/src/components/Course/Solutions.astro
index cfc52d7..fde0241 100644
--- a/superpage/src/components/Course/Solutions.astro
+++ b/superpage/src/components/Course/Solutions.astro
@@ -1,17 +1,7 @@
---
import Container from "~/components/Container.astro";
-import Contact from "./Contact.jsx";
-import Modal from "~/components/Modal.astro";
---
-{/* Modal */}
-
-
- Preencha os dados da sua empresa
-
-
-
-
@@ -45,7 +35,7 @@ import Modal from "~/components/Modal.astro";
+
+