fix typescript typechecking errors

This commit is contained in:
chark1es 2024-03-20 01:17:18 -07:00
parent 445bc39b9e
commit c2951c0d6f

View file

@ -201,19 +201,21 @@ import Layout from "../layouts/Layout.astro";
const { PUBLIC_SLACK_WEBHOOK_LINK } = import.meta.env;
document.addEventListener("DOMContentLoaded", function () {
const form = document.getElementById("contactForm");
const form = document.getElementById(
"contactForm"
) as HTMLFormElement;
const policyAgreeButton = document.querySelector(
'button[role="switch"]'
);
) as HTMLElement;
let policyAgreed = false;
// Toggle privacy policy agreement
policyAgreeButton.addEventListener("click", function () {
policyAgreed = !policyAgreed;
this.setAttribute("aria-checked", policyAgreed);
this.setAttribute("aria-checked", policyAgreed.toString());
const indicator = this.querySelector(
'span[aria-hidden="true"]'
);
) as HTMLElement;
if (policyAgreed) {
this.classList.replace("bg-gray-200", "bg-ieee");
indicator.classList.replace(
@ -236,7 +238,7 @@ import Layout from "../layouts/Layout.astro";
return;
}
const formData = new FormData(form);
const formData = new FormData(form as HTMLFormElement);
const formProps = Object.fromEntries(formData);
const discordPayload = {