fix typescript typechecking errors
This commit is contained in:
parent
445bc39b9e
commit
c2951c0d6f
1 changed files with 7 additions and 5 deletions
|
@ -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 = {
|
||||
|
|
Loading…
Reference in a new issue